back to index | | home ., 2th revision

blogs entry script, test on debian, requires bash, python-mardown. Optional: trentm/python-markdown2, jq.

folder/files structure. @ means symlink/shortcut, * is executable.

$ alias ll='ls -F --color=auto -h --group-directories-first -a|tail -n +3|column|tr -s ' \t' ' '|column -t > /tmp/file'  
$ ll;cat /tmp/file  
im/                .style.css  
md-sh/                   .index.html     style.css  
neoup/                   index.html      test@  
python-markdown2-2.3.7/  not_found.html  

00blogdex.html       26.htm  
.00blogdex-old.html  28.htm  
01.htm               29.htm  
...                  ...  

bin/    22  blogdexHead.txt          templist  
lib/    28*   
oldmd/  29  entry-template.txt*  todo.txt  
01      30  im@                 json               x-curljq*  
10      b@  imdexHead.txt*      z-pad.txt  

Basic Usage:

jump to Upload, Misc,
./ n 'blog title quote include'; make new file numeric order start with 01, no file extension. Script looks for the largest number and +1 as new filename. A message appears once hit enter. This step can be skip, but the format is important, check my blog examples below.

./ [h|h2|i|i2] #; h or h2 makes markdown copies in /tmp, then add 2 spaces end of each line. Parsing extras option if found on third line. And convert to html, sandwhich btwn entry-template.txt, in b/ or im/. i or i2 adds entry or change existing title base on file name (#.htm) to or (only one entry per line not two, if seperate by comma the other one would be replace.). This script does not support multiple input, use for loop instead.

trentm/python-markdown2 from github can be standalone, no need for pip. By extracting its bin and lib folders to md-sh/, where is located.
See its test/ for examples.
my blog examples:,
On third line of blog entry, <!-- extras: target-blank-links, spoiler,code-friendly, fenced-code-blocks, header-ids, nofollow, cuddled-lists --> Use one or multiple and ./ [h|h2] # could run with python2 ./bin/markdown2 --extras spoiler,code-friendly,... Spacing is not important during inspection but spelling is. Start the blog content on 5th line and leave blank line after any heading #, code block ``` etc. Some difference btwn this and the deb package.

./ $1; just update a index. $1 can be nothing or anything, for b/ or im/ and sandwhich btwn blogdexHead.txt or imdexHead.txt. No per links limit.


x-curljq import functions from the latter for easier editing. Examples are in it and file path for key variable and need to change. Run ./x-curljq once done.


the index.html is not updated by script, style.css removes newline before upload.

I type in txt editor, no live preview. Can be annoying sometimes.

# On debian python-markdown 2.6.8-1 is not same as trentm/python-markdown2  
# Python-Markdown/markdown  
cat $input| markdown_py > $output;  
markdown_py $input > $output;  

# trentm/python-markdown2-2.3.7  
# Extract bin, and lib folder out the release. test/ has more examples  
python2 ./bin/markdown2 --extras $extra > $output;  
python2 ./bin/markdown2 -x nofollow -x header-ids $input  

# some extra doesn't work, like 'use-file-vars'  
$ cat 02  
### titles here!  
<!-- extras: header-ids, nofollow, tables -->  

start here if use extra, see git for more info.  
work or not, no promises.