Skip to content

Conversation

velp
Copy link

@velp velp commented Dec 14, 2016

These options allow you to use the module for generating html with a specific syntax of code block. For example, the generation of the page to confluence:

>>> import markdown
>>> txt = """some text
... ```bash
... some code
... ```
... Title:
... 
... 1. first
... 2. second
... """
>>> ext_conf = {'fenced_code': {
...                             'escape': False,
...                             'code_wrap': '<ac:structured-macro ac:name="code">%s<ac:plain-text-body><![CDATA[%s]]></ac:plain-text-body></ac:structured-macro>',
...                             'lang_tag': '<ac:parameter ac:name="language">%s</ac:parameter>'
...                             }
...             }
>>> markdown.markdown(txt, extensions=['fenced_code'], enable_attributes=True, extension_configs=ext_conf)
u'<p>some text</p>\n<p><ac:structured-macro ac:name="code"><ac:parameter ac:name="language">bash</ac:parameter><ac:plain-text-body><![CDATA[some code\n]]></ac:plain-text-body></ac:structured-macro></p>\n<p>Title:</p>\n<ol>\n<li>first</li>\n<li>second</li>\n</ol>'
>>>

The Atlassian confluence used its formatting macros.

The result page:
confluence_page

@waylan
Copy link
Member

waylan commented Dec 15, 2016

I don't see any reason why a "confluence" extension couldn't exist as a separate extension. Personally, I have no use for this and have no desire to maintain it. Of course, if you desire to release a third-party extension, feel free to list it on the wiki

@waylan waylan closed this Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants