RittmanMead / md_to_conf

Markdown to Confluence import
MIT License
231 stars 84 forks source link

Support for in-page links (when markdown was written for bitbucket) #17

Closed OlegKarasik closed 4 years ago

OlegKarasik commented 4 years ago

This PR adds support for in-page links when source markdown was written for Bitbucket. In Bitbucket when you want to create a reference to a header you have to specify a link in the following format:

// Slug is a lowercase string where all words are joined using '-' (dash)
// This is original string -> this-is-original-string

#markdown-header-<slug or header>

The code in the PR does processes all links in the resulting HTML and if they match #markdown-header-<> pattern modifies them to be correct in-page confluence links (supports both confluence editors: v1 and v2).

While current implementation works only for bitbucket the code itself is written in such form to support future extensibility (adding more markdown sources like bitbucket).

Introduced parameters: Name Description
-v allows to specify confluence editor version this page should be created in
-mds allows to specify markdown source (currently supports only bitbucket).