# The basics of using SSGen
# (c) theokrueger 2024
# GPL-3.0 Licensed
# Intro
- h1: String Manipulation
- p: SSGen has helpful directives for manipulating strings
- p: >
The !SUBSTRING
directive takes a substring (duh).
The first two arguments are the bounds, and the third argument
is the YAML that gets parsed before being cut.
# Example
- span:
_class: two-column-grid-with-spacer
yaml:
- !DEF [NAMED_CODE_NAME, "input_directory/index.page"]
- !DEF
- NAMED_CODE_CONTENT
- |
\# This is a comment
html:
body:
h1: Title
p:
!SUBSTRING [0, 4, Paragraph Contents]
- !INCLUDE /blocks/named-code.block
br: ''
html:
- !DEF [NAMED_CODE_NAME, "output_directory/index.html"]
- !DEF
- NAMED_CODE_CONTENT
- |
<html>
<body>
<h1>Title</h1>
<p>Para</p>
</body>
</html>
- !INCLUDE /blocks/named-code.block
# Clarification
- p: Pretty fundamental stuff!