hunyadi / md2conf

Publish Markdown files to Confluence wiki
MIT License
56 stars 31 forks source link

Add support for directory structures #34

Closed ojacques closed 7 months ago

ojacques commented 7 months ago
ojacques commented 7 months ago

Thanks @hunyadi for your kind words. I needed a Python project, and yours was the closest to providing the results I wanted. Great work!

Regarding the spaces, I have to admit it is a bit of a hack 😅. Now, Confluence does not allow duplicate page names in a given space, and this happens quite a bit in my case (multiple 'introduction', 'template' and other non-unique names for pages on a large documentation site). Not to mention that this documentation is also published in parallel to other folders in the same space, which I do not control at all.

As an alternative to hidden spaces, I tried just numbers ('Introduction 1', 'Template 2'), but I found it... Not pretty. I'm curious to read other ideas you might have. Maybe we should have multiple options, giving the choice on the command line?

hunyadi commented 7 months ago

A rather straightforward solution to the conflicting title issue could be to use a breadcrumb-style approach to building titles: use the parent page title as a prefix for the child page, e.g. assuming the parent page has the title Quest of the Avatar, and the child page has the title Magic, the synthesized unique title for the child page could be Quest of the Avatar: Magic. This could be applied recursively. My concern with the spaces is that while it solves the immediate issue with conflicting titles, it leads to cryptic behavior when the pages are referenced individually, and may make md2conf non-deterministic depending on the order the pages are published (i.e. they might be assigned a different space character).