Oleksandr Gavenko's blog
2017-01-10 23:30 Defun blog has been opened. Salute!

A long time ago I had two blogs at Blogspot service:

dating from 2009-04-05 to 2011-09-19.

At some point I thought I should edit and post notes directly from Emacs. I managed to work with Blogspot API via GNU make and curl but stuck at writing Emacs mode. The legacy of those days can be found at:

Another issue which concerned me was keeping source text of notes under source control. With such thoughts the task became too complicated to be solved by me at that time.

So I stopped blogging until was caught by static blog movement.

Because of spent time on reStructuredText syntax and document model:

and because I hated to use GitHub (and so Jekyll) for blogging as this led to same dependency on service provider I decided to make own static blog engine.

It take some time on figuring out how to pragmatically transform .rst file into .html file, starting from:

import docutils.core
dom = docutils.core.publish_doctree("**Hello**")
print(dom.pformat())

import docutils.writers.html4css1
dom.settings.__dict__['xml_declaration'] = None
dom.settings.__dict__['doctype_declaration'] = None
dom.settings.__dict__['stylesheet'] = ""
dom.settings.__dict__['stylesheet_path'] = None
dom.settings.__dict__['math_output'] = "HTML"
dom.settings.__dict__['initial_header_level'] = 1
visitor = docutils.writers.html4css1.HTMLTranslator(dom)
dom.walkabout(visitor)
print(visitor.astext())

and leading to custom docutils.nodes.GenericNodeVisitor for full power to apply own templates and HTML wrapping patterns.

See source code of static blog generator (currently at first stage) at:

and blog served by it at:

By now I have no any barrier to publish notes on Internet and my 568 unpublished notes awaiting their order go out.

Bye-bye for the next time!

blog, rst

Feeds

all / emacs / java

Tags

adb(1), admin(1), android(1), anki(1), ansible(2), aop(1), blog(2), bytecode(1), c(1), css(2), cygwin(2), driver(1), emacs(3), fs(1), git(3), google(1), gradle(1), hardware(1), hg(2), html(1), interview(13), java(4), js(3), lang(2), lighttpd(1), markdown(1), mobile(1), naming(1), oracle(1), print(1), problem(5), python(1), quiz(6), rst(2), security(3), spring(2), sql(2), srs(1), style(1), tls(2), txt(1), unit(1), utils(1), vcs(3), web(2), win(2), windows(1)

Archive