Syrinx
Spreadsheet to website
Syrinx is a super simple python package for generating a static website
Example
pip install syrinx
touch content/index.md
syrinx .
python -m http.server -d dist
Conventions
Organize your content with some standard structure and syrinx will interpret it.
Content
- a
content/
directory with markdown fileindex.md
- Frontmatter: Markdown files start with a standard header or "frontmatter" that is surrounded by either dashes
---
for YAML or pluses+++
for TOML. - in content directories other than root,
index.md
is optional. Leaving it out signifies that you do not want a separate page build for this branch. - Special frontmatter entries:
SequenceNumber
: Used by templates to order child items in menu's and lists.Archetype
: The name of the template used to import these table dataLastModified
: Date and time when the content was last changed. The item will only be included in the sitemap if the file has this attribute.
Templating and style
- Templates are written in jinja2 and go into the
theme/templates/
directory. - The default template used is
page.jinja2
. If a template is found matching the name of the node (e.g.foo.jinja2
), orroot.jinja2
for the top-most page, this takes precedence. - CSS, images and other assets go into
theme/assets/
.
Table Data
Syrinx can generate content (markdown) files from CSV tables in the data/
directory.
- The archetype file used will be based on the filename of the data file.
- Each row is considered one record.
- The header (1st) row will be used as keys.
- The first column is used as name for the content item.
- Each column will be converted to a variable in the front matter
Configuration
You can configure syrinx behavior with a syrinx.cfg
file in the project root directory,
or use commandline arguments (which will override any settings in the configuration file).
For options, run syrinx -h
.