Hi,
I've been toying around with a Markdown resource provider in the
whiteboard [0]. It's very much a work-in-progress but since it does
something - aka render Markdown files, including support for arbitrary
Sling properties, I would like to discuss a couple of design decisions.
1. The resource is created from a markdown file in the following way:
- if a first level heading is found, place the text into jcr:title
- if a YAML front matter is found, save the properties in the resource
properties
- render everything else as HTML into jcr:description
I am not sure that rendering the markdown in the resource provider is
the best way. On one hand, it keeps everything simple and does not
require special work in the rendering script. On the other hand,
rendering JSON/TXT with HTML inside is not that nice.
2. Only files with the 'md' extension are handled, all others are
ignored.
To generate static sites, usually markdown files are mixed with images,
css, js files. Does it make sense to 'pass-through' these files and
expose them as plain files? There could be some ties with the
FsResourceProvider. Alternatively the static assets can be placed in a
different subtree.
Thoughts?
Thanks,
Robert
[0]:
https://github.com/apache/sling-whiteboard/tree/master/mdresourceprovider