From 5b63c384ef8e100518ff50b9cb023ac07265df35 Mon Sep 17 00:00:00 2001 From: Starfall Date: Fri, 22 Oct 2021 22:14:41 -0500 Subject: strike: set goals for config file format --- README | 22 +++++++++++++++++----- sample/blog/also-exclude.html | 1 + sample/blog/empty.html | 0 sample/blog/exclude.html | 1 + sample/blog/happy.html | 1 + sample/strike.ini | 21 +++++++++++++++++++++ sample/template.html | 13 +++++++++++++ 7 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 sample/blog/also-exclude.html create mode 100644 sample/blog/empty.html create mode 100644 sample/blog/exclude.html create mode 100644 sample/blog/happy.html create mode 100644 sample/strike.ini create mode 100644 sample/template.html diff --git a/README b/README index 454d931..f8aefaa 100644 --- a/README +++ b/README @@ -21,13 +21,25 @@ And some stretch goals to turn it into a blog generator: * Turn the extra page into a flexible component that can be added into any other page * Use different templates on different files -Markup: +strike.ini file +--------------- + +Strike should be passed the location of a .ini file or a directory containing a file named strike.ini. This is a text file in Python's configparser format (for now). You can see an example config file in the sample directory. + +Markup +------ + +TBD. No markup is used at the moment. reStructuredText fulfills most of our desires: https://docutils.sourceforge.io/rst.html It generates
s and has specific markup for page titles. -Templating: -Complicated templating isn't necessary, just pre-content and post-content boilerplate for now. -The slight gotcha is that the page title may need updated as well, but we'll cross that bridge if we have to. +Templating +---------- + +TBD. Right now, templates should be written in plain HTML. The special marker ${content} will be replaced with all custom page content (also in raw HTML). + +Front matter +------------ -Front matter: None for now. + diff --git a/sample/blog/also-exclude.html b/sample/blog/also-exclude.html new file mode 100644 index 0000000..6ce0fb1 --- /dev/null +++ b/sample/blog/also-exclude.html @@ -0,0 +1 @@ +This file shouldn't be processed by Strike either. diff --git a/sample/blog/empty.html b/sample/blog/empty.html new file mode 100644 index 0000000..e69de29 diff --git a/sample/blog/exclude.html b/sample/blog/exclude.html new file mode 100644 index 0000000..d881dce --- /dev/null +++ b/sample/blog/exclude.html @@ -0,0 +1 @@ +This file should be excluded from processing when Strike is processed using strike.ini diff --git a/sample/blog/happy.html b/sample/blog/happy.html new file mode 100644 index 0000000..af5626b --- /dev/null +++ b/sample/blog/happy.html @@ -0,0 +1 @@ +Hello, world! diff --git a/sample/strike.ini b/sample/strike.ini new file mode 100644 index 0000000..4ccc027 --- /dev/null +++ b/sample/strike.ini @@ -0,0 +1,21 @@ +[Input] +# Directory with all of the markup files that you want Strike to process. +# Location should be relative to this config file. +# For now, Strike will only process files in this directory and not in any subdirectories. +directory = blog +# Files in the input directory to exclude. +# Location should be relative to the default input directory. +excludes = exclude.html + also-exclude.html + +[Templates] +# For now, Strike only supports using a single template, named default. +default = template.html + +[Output] +# Directory to put the output into. +# When Strike processes subdirectories, this will become the base directory - output will be placed into the same subdirectory relative to this as it was to the input directory. +directory = html + +# That's all for now. In the future, we hope to allow the use of multiple templates, +# letting you choose individual directories and files for each template. diff --git a/sample/template.html b/sample/template.html new file mode 100644 index 0000000..3e94683 --- /dev/null +++ b/sample/template.html @@ -0,0 +1,13 @@ + + +aaaa need a title + + + + +
+ ${content} +
+ -- cgit