Simple and stylish text-to-html microblog generator. https://likho.neocities.org/microblog
likho 575bf336f9 squash merge semantic2 | 5 ay önce | |
---|---|---|
example | 5 ay önce | |
src | 5 ay önce | |
.gitignore | 2 yıl önce | |
LICENSE | 2 yıl önce | |
README.md | 5 ay önce | |
requirements.txt | 5 ay önce |
Simple and stylish text-to-html microblog generator.
The following python modules are used within the repository.
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 Makefilesdate
(optional), to generate timestamps when writing postsThe following generates a sample page result.html
.
cp example/Makefile .
make
Using make
is uptional; it does the following within a new directory:
cp example/settings.toml ./settings.toml
cp example/timeline.css ./timeline.css
cp example/default.tpl ./template.tpl
cp example/demo.txt ./content.txt
python src/microblog.py ./template.tpl ./content.txt > result.html
This script generate a text file after operation.
updatedfiles.txt
, a list of files updated by the script for use in automated uploads.See example/demo.txt
.
The content file is a plain text file of posts. Each post has two types of information: timestamp and message. For example:
Thu Mar 17 11:11:11 PM EDT 2022
Today I ate ice cream.
It was strawberry flavored.
#TouchingGrass
Thu Mar 16 2:22:22 PM EDT 2022
I took these pictures.
/images/1.jpg /images/2.jpg /images/3.jpg
Settings are read from settings.toml
. See example/settings.toml
.
Configuration options as understood by the script are tentative and may change in the future.
I'm getting KeyError when I run the program
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 adding missing keys from example/settings.toml
to settings.toml
.
The following command can check for missing keys and update if needed.
python src/check-settings.py
Missing keys if any are initialized to default values from example/settings.toml
.
This is a script I wrote for personal use. The output can be seen on https://likho.neocities.org/microblog/index.html. I figure someone else may want to use it for their own personal websites, so it is published.
It works for me and my workflow; therefore, it is simple and involves little lines of code. But I am still open to comments, questions, or suggestions.