Interesting, I've started similar work some time back but never finished
it :) Back then I thought that this is a cross cutting concern, md files
can be stored anywhere, in the file system, in jcr, fetched by a special
github provider etc. Therefore I started with implementing a resource
decorator instead which was configured with a path prefix. All resources
beneath that path with the extension md where "decorated" in a similar
way as you describe.

What are you using for the md to html transformation?

Regards
Carsten

Robert Munteanu wrote
> 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
-- 
Carsten Ziegeler
Adobe Research Switzerland
[email protected]

Reply via email to