These are shared publicly at Fragments & Unity and GitHub Pages.
This repository uses a YAML-based build system to generate HTML files:
src/
- Source code and content
poems/
- Source files for all poems (one file per poem)
.yaml
files - YAML format (see docs/YAML-SCHEMA.md
).poem
files - Poem format (see docs/POEM-SYNTAX.md
and poem-syntax.ebnf
)_
(e.g., _shared.yaml
, _example.poem
) are ignored by the build processtemplates/
- Pug template for rendering poemstools/
- Build scripts (including .poem
to YAML converter)public/
- Generated HTML files and assetsdocs/
- Documentation fileseditors/
- Editor integrations (Vim syntax highlighting)examples/
- Example filesscripts/
- Shell scripts for setup and maintenancenpm install
# Build all HTML files from YAML sources
npm run build
# Build and start local development server
npm run build:all
# Inject CSS into Blogger template
npm run build:blogger
# View at http://localhost:8080
If you encounter issues with npm using Windows binaries, use the setup script:
# Build all HTML files from YAML sources
./scripts/setup-linux.sh npm run build
# Build and start local development server
./scripts/setup-linux.sh npm run build:all
# Inject CSS into Blogger template
./scripts/setup-linux.sh npm run build:blogger
# View at http://localhost:8080
The scripts/setup-linux.sh
script ensures the correct Linux Node.js and npm versions are used.
You can create poems in either YAML or Poem format:
src/poems/
directory (see docs/YAML-SCHEMA.md
for format)npm run build
to generate the HTML.poem
file in the src/poems/
directory (see docs/POEM-SYNTAX.md
for format)node src/tools/poem-to-yaml.js src/poems/your-poem.poem
npm run build
to generate the HTML.poem
file, generated YAML, and HTML filesNote: The Poem format supports variable substitution and other features detailed in docs/POEM-SYNTAX.md
.
.yaml
or .poem
) in the src/poems/
directory.poem
file, regenerate the YAML: node src/tools/poem-to-yaml.js src/poems/your-poem.poem
npm run build
to regenerate the HTMLThe poem-to-yaml.js
tool converts .poem
files to YAML format:
# Convert a single file
node src/tools/poem-to-yaml.js src/poems/your-poem.poem src/poems/your-poem.yaml
# Convert a single file (output defaults to same name with .yaml extension)
node src/tools/poem-to-yaml.js src/poems/your-poem.poem
# Convert all .poem files in the src/poems/ directory
node src/tools/poem-to-yaml.js --all
The converter fully supports all features including variable substitution, markup, literal blocks, and all structural elements defined in docs/POEM-SYNTAX.md
.
Shared Variables: The converter automatically prepends .shared.poem
(if it exists in the src/poems/
directory) to each poem file before processing. This allows you to define common variables (like disclaimer text) once and use them across all poems.
To view the poems locally without building:
public/index.html
in your web browsernpm start
to start a local server at http://localhost:8080The repository includes functionality to inject custom CSS into a Blogger template for the Fragments & Unity blog:
npm run build:blogger
This script:
public/styles.css
public/fragments-and-unity.template.html
/* ~~ CUSTOM CSS START ~~ */
and /* ~~ CUSTOM CSS END ~~ */
delimitersThe updated template can then be uploaded to Blogger to apply the custom styling.
All poem YAML files use the ISO date format (yyyy-mm-dd
, e.g., 2015-05-04
) for the date
field. The build system automatically converts these dates to the display format (DayOfWeek, DD Month YYYY
) in the generated HTML files.
docs/YAML-SCHEMA.md
- Detailed schema for poem YAML filesdocs/POEM-SYNTAX.md
- Complete specification for the .poem
file formatdocs/POEM-TO-YAML.md
- Documentation for the poem-to-yaml converterpoem-syntax.ebnf
- Formal EBNF grammar for the Poem file formatdocs/BUILD.md
- GitHub Pages deployment informationdocs/VIM-SYNTAX.md
- Vim syntax highlighting documentationdocs/QUICKSTART-VIM.md
- Quick start guide for Vim users