diff --git a/README.md b/README.md index dc430c7..c4a60ea 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,16 @@ Simple and stylish text-to-html microblog generator. ## Requirements - python3 dateutil toml curl pycurl make urllib +The following python modules are used within the repository. -* `dateutil`, `toml`, `pycurl` are Python modules. -* `make` (optional), method for invoking the script. -* `urllib` (optional), for uploading multiple files to neocities (`neouploader.py`). + toml tomlkit python_dateutil pycurl + +* `tomlkit` (optional), for maintaining the configuration file between updates (`check-settings.py`). + +Some Gnu core utilities are expected to be present but can be substituted for other means. + +* `make` (optional), to invoke the script using Makefiles +* `date` (optional), to generate timestamps when writing posts ## Usage @@ -24,7 +29,7 @@ Using `make` is uptional; it does the following within a new directory: cp example/timeline.css ./timeline.css cp example/default.tpl ./template.tpl cp example/demo.txt ./content.txt - python microblog.py ./template.tpl ./content.txt > result.html + python src/microblog.py ./template.tpl ./content.txt > result.html This script generate a text file after operation. @@ -64,11 +69,13 @@ Configuration options as understood by the script are tentative and may change i >This script is throwing KeyError after I ran git pull -In most cases, this means I added new configuration options. You can resolve this error by copying and pasting the missing keys from `example/settings.toml` to `settings.toml`. +In most cases, this means I added new configuration options. You can resolve this error by adding missing keys from `example/settings.toml` to `settings.toml`. -The following command shows differences between the files. +The following command can check for missing keys and update if needed. - diff settings.toml example/settings.toml + python src/check-settings.py + +Missing keys if any are initialized to default values from `example/settings.toml`. ## Anything else diff --git a/example/Makefile b/example/Makefile index 8a91908..1775778 100644 --- a/example/Makefile +++ b/example/Makefile @@ -1,8 +1,12 @@ all: demo tpl css settings - python microblog.py ./template.tpl ./content.txt > result.html + python src/microblog.py ./template.tpl ./content.txt > result.html +check: + python src/check-settings.py + +# first time run only tpl: cp ./example/default.tpl ./template.tpl diff --git a/example/settings.toml b/example/settings.toml index 8d3ad6d..2e6a229 100644 --- a/example/settings.toml +++ b/example/settings.toml @@ -4,6 +4,11 @@ latestpages=["meta.json", "result.html"] [page] postsperpage = 20 relative_css=["./style.css", "./timeline.css"] +# this would be "latest.html" in earlier versions i.e +# user.domain.tld/microblog/tags/tagname/latest.html +# naming it as index enables paths like so +# user.domain.tld/microblog/tags/tagname +landing_page="index.html" [post] accepted_images= ["jpg", "JPG", "png", "PNG"] @@ -11,8 +16,7 @@ accepted_images= ["jpg", "JPG", "png", "PNG"] tag_paragraphs=true # apply
tags even if a line contains the following
inline_tags = ["i", "em", "b", "strong","u", "s", "a", "span"]
-# adds
or user defined string between each line
-# line_separator="
"
+date_format="%d %B %Y"
format="""