Instantly share code, notes, and snippets.

@davidbgk davidbgk/
Last active Feb 5, 2017

What would you like to do?
Given a folder containing CommonMark files, turn it into HTML.



Given a folder containing CommonMark files, turn it into HTML.


File structure

  detail.html     # Jinja2 template for detail
  list.html       # …for list
  feed.xml        # …for feed   # An item to be generated  # Another one      # Filename is not significative
  and so one…


Each CommonMark file must have the given metadata elements:

title: A title
url: /bar/a-title/
date: 2017-01-30

And then the content.

Parsing with the metadata extension? The thread about that on CommonMark has no conclusion…


Generate HTML

$ python3 foo

Launch local server

$ python3 -m http.server

Browse it!

$ open http://localhost:8000/bar/a-title/


  • which URL for the list?
  • deploy with now? git*-pages? quid of domains?
  • use pex to ease Python execution?
  • add search with lunrjs which works even with i18n?

This comment has been minimized.

Copy link

karlcow commented Jan 30, 2017

It seems

  • the structure exceeds your goal
  • OR the goals are not completely defined.

From the structure, I see:

  1. Given a folder containing CommonMark files, turn them into HTML.
  2. Has a template management system for individual page and indexes
  3. Has a (atom?) feed.
  4. Is a flat directory with all files.
  5. Content has a creation date
  6. Content has a title
  7. Content has a predefined URI.

Missing things for me (but then we are drifting from your goals of simplicity I guess):

  • Template pointer management
  • Modification date management for feed (and HTTP etag computation)
  • No css?
  • I would separate template in their own subfolders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment