markdown-to-confluence 0.5.1__tar.gz → 0.5.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/LICENSE +1 -1
- markdown_to_confluence-0.5.3/MANIFEST.in +13 -0
- {markdown_to_confluence-0.5.1/markdown_to_confluence.egg-info → markdown_to_confluence-0.5.3}/PKG-INFO +160 -11
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/README.md +155 -6
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3/markdown_to_confluence.egg-info}/PKG-INFO +160 -11
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/markdown_to_confluence.egg-info/SOURCES.txt +62 -5
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/markdown_to_confluence.egg-info/requires.txt +4 -4
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/__init__.py +2 -2
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/__main__.py +94 -29
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/api.py +55 -10
- markdown_to_confluence-0.5.3/md2conf/attachment.py +72 -0
- markdown_to_confluence-0.5.3/md2conf/coalesce.py +43 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/collection.py +1 -1
- markdown_to_confluence-0.5.1/md2conf/extra.py → markdown_to_confluence-0.5.3/md2conf/compatibility.py +1 -1
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/converter.py +417 -590
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/csf.py +13 -11
- markdown_to_confluence-0.5.3/md2conf/drawio/extension.py +116 -0
- markdown_to_confluence-0.5.1/md2conf/drawio.py → markdown_to_confluence-0.5.3/md2conf/drawio/render.py +1 -1
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/emoticon.py +3 -3
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/environment.py +2 -2
- markdown_to_confluence-0.5.3/md2conf/extension.py +78 -0
- markdown_to_confluence-0.5.3/md2conf/external.py +49 -0
- markdown_to_confluence-0.5.3/md2conf/formatting.py +135 -0
- markdown_to_confluence-0.5.3/md2conf/frontmatter.py +70 -0
- markdown_to_confluence-0.5.3/md2conf/image.py +127 -0
- markdown_to_confluence-0.5.3/md2conf/latex.py +66 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/local.py +8 -8
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/markdown.py +1 -1
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/matcher.py +1 -1
- markdown_to_confluence-0.5.3/md2conf/mermaid/config.py +20 -0
- markdown_to_confluence-0.5.3/md2conf/mermaid/extension.py +109 -0
- markdown_to_confluence-0.5.1/md2conf/mermaid.py → markdown_to_confluence-0.5.3/md2conf/mermaid/render.py +10 -38
- markdown_to_confluence-0.5.3/md2conf/mermaid/scanner.py +55 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/metadata.py +1 -1
- markdown_to_confluence-0.5.3/md2conf/options.py +116 -0
- markdown_to_confluence-0.5.3/md2conf/plantuml/__init__.py +0 -0
- markdown_to_confluence-0.5.3/md2conf/plantuml/config.py +20 -0
- markdown_to_confluence-0.5.3/md2conf/plantuml/extension.py +158 -0
- markdown_to_confluence-0.5.3/md2conf/plantuml/render.py +139 -0
- markdown_to_confluence-0.5.3/md2conf/plantuml/scanner.py +56 -0
- markdown_to_confluence-0.5.1/md2conf/latex.py → markdown_to_confluence-0.5.3/md2conf/png.py +103 -146
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/processor.py +32 -11
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/publisher.py +17 -18
- markdown_to_confluence-0.5.3/md2conf/py.typed +0 -0
- markdown_to_confluence-0.5.3/md2conf/scanner.py +106 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/serializer.py +2 -2
- markdown_to_confluence-0.5.3/md2conf/svg.py +341 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/text.py +1 -1
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/toc.py +1 -1
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/uri.py +1 -1
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/xml.py +1 -1
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/pyproject.toml +8 -5
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/setup.py +1 -1
- markdown_to_confluence-0.5.3/tests/__init__.py +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/emoji.py +2 -4
- markdown_to_confluence-0.5.3/tests/relative.txt +2 -0
- markdown_to_confluence-0.5.3/tests/scanner/frontmatter.md +21 -0
- markdown_to_confluence-0.5.3/tests/scanner/id_only.md +5 -0
- markdown_to_confluence-0.5.3/tests/scanner/id_space_title.md +10 -0
- markdown_to_confluence-0.5.3/tests/source/.mdignore +7 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/alignment.md +2 -1
- markdown_to_confluence-0.5.3/tests/source/docs/sample.docx +0 -0
- markdown_to_confluence-0.5.3/tests/source/docs/sample.ods +0 -0
- markdown_to_confluence-0.5.3/tests/source/docs/sample.odt +0 -0
- markdown_to_confluence-0.5.3/tests/source/docs/sample.pdf +0 -0
- markdown_to_confluence-0.5.3/tests/source/docs/sample.xlsx +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/footnote.md +3 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/images.md +6 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/mermaid.md +4 -2
- markdown_to_confluence-0.5.3/tests/source/plantuml.md +98 -0
- markdown_to_confluence-0.5.3/tests/source/skip_title_heading.md +13 -0
- markdown_to_confluence-0.5.3/tests/source/skip_title_heading_abstract.md +13 -0
- markdown_to_confluence-0.5.3/tests/source/skip_title_heading_frontmatter.md +13 -0
- markdown_to_confluence-0.5.3/tests/source/skip_title_heading_multiple.md +9 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/table.md +6 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/footnote.xml +19 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/images.xml +6 -6
- markdown_to_confluence-0.5.3/tests/target/mermaid/class.mmd +6 -0
- markdown_to_confluence-0.5.3/tests/target/mermaid/mindmap.mmd +17 -0
- markdown_to_confluence-0.5.3/tests/target/mermaid/pie.mmd +3 -0
- markdown_to_confluence-0.5.3/tests/target/mermaid/quadrant.mmd +8 -0
- markdown_to_confluence-0.5.3/tests/target/mermaid/sequence.mmd +9 -0
- markdown_to_confluence-0.5.3/tests/target/mermaid/timeline.mmd +10 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/mermaid.xml +6 -7
- markdown_to_confluence-0.5.3/tests/target/plantuml/class.puml +22 -0
- markdown_to_confluence-0.5.3/tests/target/plantuml/component.puml +20 -0
- markdown_to_confluence-0.5.3/tests/target/plantuml/sequence.puml +13 -0
- markdown_to_confluence-0.5.3/tests/target/plantuml/usecase.puml +6 -0
- markdown_to_confluence-0.5.3/tests/target/plantuml.xml +59 -0
- markdown_to_confluence-0.5.3/tests/target/skip_title_heading.xml +1 -0
- markdown_to_confluence-0.5.3/tests/target/skip_title_heading_abstract.xml +1 -0
- markdown_to_confluence-0.5.3/tests/target/skip_title_heading_abstract_removed.xml +1 -0
- markdown_to_confluence-0.5.3/tests/target/skip_title_heading_frontmatter.xml +1 -0
- markdown_to_confluence-0.5.3/tests/target/skip_title_heading_multiple.xml +1 -0
- markdown_to_confluence-0.5.3/tests/target/skip_title_heading_preserved.xml +1 -0
- markdown_to_confluence-0.5.3/tests/target/skip_title_heading_removed.xml +1 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/table.xml +3 -3
- markdown_to_confluence-0.5.3/tests/test_conversion.py +517 -0
- markdown_to_confluence-0.5.3/tests/test_document.py +105 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/test_drawio.py +2 -2
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/test_matcher.py +1 -1
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/test_mermaid.py +2 -2
- markdown_to_confluence-0.5.3/tests/test_plantuml.py +62 -0
- markdown_to_confluence-0.5.3/tests/test_png.py +83 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/test_processor.py +9 -7
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/test_scanner.py +23 -23
- markdown_to_confluence-0.5.3/tests/test_svg.py +167 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/test_text.py +1 -1
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/test_unit.py +56 -5
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/test_xml.py +1 -1
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/utility.py +1 -1
- markdown_to_confluence-0.5.1/MANIFEST.in +0 -8
- markdown_to_confluence-0.5.1/md2conf/domain.py +0 -52
- markdown_to_confluence-0.5.1/md2conf/scanner.py +0 -203
- markdown_to_confluence-0.5.1/tests/test_conversion.py +0 -268
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/markdown_to_confluence.egg-info/dependency_links.txt +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/markdown_to_confluence.egg-info/entry_points.txt +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/markdown_to_confluence.egg-info/top_level.txt +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/markdown_to_confluence.egg-info/zip-safe +0 -0
- {markdown_to_confluence-0.5.1/tests → markdown_to_confluence-0.5.3/md2conf/drawio}/__init__.py +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/entities.dtd +0 -0
- /markdown_to_confluence-0.5.1/md2conf/py.typed → /markdown_to_confluence-0.5.3/md2conf/mermaid/__init__.py +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/md2conf/puppeteer-config.json +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/setup.cfg +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/admonition.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/alert.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/anchors.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/basic.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/code.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/collapsed.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/fenced.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/figure/diagram.drawio +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/figure/diagram.drawio.png +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/figure/diagram.drawio.svg +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/figure/raster.png +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/figure/vector.svg +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/ignore.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/images/images.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/macro.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/math.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/missing.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/sections.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/status.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/tags.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/tasklist.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/title.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/source/toc.md +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/admonition.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/alert.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/alignment.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/anchors.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/basic.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/code.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/collapsed.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/fenced.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/images/images.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/macro.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/math.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/missing.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/panel.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/sections.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/status.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/tags.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/tasklist.xml +0 -0
- {markdown_to_confluence-0.5.1 → markdown_to_confluence-0.5.3}/tests/target/toc.xml +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
recursive-include tests *.py
|
|
2
|
+
recursive-include tests *.md
|
|
3
|
+
recursive-include tests *.txt
|
|
4
|
+
recursive-include tests .mdignore
|
|
5
|
+
recursive-include tests/source *.drawio
|
|
6
|
+
recursive-include tests/source *.png
|
|
7
|
+
recursive-include tests/source *.svg
|
|
8
|
+
include tests/source/docs/sample.*
|
|
9
|
+
exclude tests/source/emoji.md
|
|
10
|
+
recursive-include tests/target *.xml
|
|
11
|
+
recursive-include tests/target *.mmd
|
|
12
|
+
recursive-include tests/target *.puml
|
|
13
|
+
exclude tests/target/emoji.xml
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: markdown-to-confluence
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary: Publish Markdown files to Confluence wiki
|
|
5
5
|
Author-email: Levente Hunyadi <hunyadi@gmail.com>
|
|
6
6
|
Maintainer-email: Levente Hunyadi <hunyadi@gmail.com>
|
|
@@ -27,18 +27,18 @@ Requires-Dist: cattrs>=25.3
|
|
|
27
27
|
Requires-Dist: lxml>=6.0
|
|
28
28
|
Requires-Dist: markdown>=3.10
|
|
29
29
|
Requires-Dist: orjson>=3.11
|
|
30
|
-
Requires-Dist: pymdown-extensions>=10.
|
|
30
|
+
Requires-Dist: pymdown-extensions>=10.19
|
|
31
31
|
Requires-Dist: PyYAML>=6.0
|
|
32
32
|
Requires-Dist: requests>=2.32
|
|
33
33
|
Requires-Dist: truststore>=0.10
|
|
34
34
|
Requires-Dist: typing-extensions>=4.15; python_version < "3.12"
|
|
35
35
|
Provides-Extra: dev
|
|
36
|
-
Requires-Dist: markdown_doc>=0.1.
|
|
37
|
-
Requires-Dist: types-lxml>=2025.
|
|
36
|
+
Requires-Dist: markdown_doc>=0.1.6; extra == "dev"
|
|
37
|
+
Requires-Dist: types-lxml>=2025.11.25; extra == "dev"
|
|
38
38
|
Requires-Dist: types-markdown>=3.10; extra == "dev"
|
|
39
39
|
Requires-Dist: types-PyYAML>=6.0; extra == "dev"
|
|
40
40
|
Requires-Dist: types-requests>=2.32; extra == "dev"
|
|
41
|
-
Requires-Dist: mypy>=1.
|
|
41
|
+
Requires-Dist: mypy>=1.19; extra == "dev"
|
|
42
42
|
Requires-Dist: ruff>=0.14; extra == "dev"
|
|
43
43
|
Provides-Extra: formulas
|
|
44
44
|
Requires-Dist: matplotlib>=3.9; extra == "formulas"
|
|
@@ -98,6 +98,15 @@ pip install markdown-to-confluence
|
|
|
98
98
|
npm install -g @mermaid-js/mermaid-cli
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
+
**Optional.** Pre-rendering PlantUML diagrams into PNG or SVG images requires Java, Graphviz and [PlantUML](https://plantuml.com/). (Refer to `--render-plantuml`.)
|
|
102
|
+
|
|
103
|
+
1. **Install Java**: Version 8 or later from [Adoptium](https://adoptium.net/) or [Oracle](https://www.oracle.com/java/technologies/downloads/)
|
|
104
|
+
2. **Install Graphviz**: Required for most diagram types in PlantUML (except sequence diagrams)
|
|
105
|
+
* **Ubuntu/Debian**: `sudo apt-get install Graphviz`
|
|
106
|
+
* **macOS**: `brew install graphviz`
|
|
107
|
+
* **Windows**: Download from [graphviz.org](https://graphviz.org/download/)
|
|
108
|
+
3. **Download PlantUML JAR**: Download [plantuml.jar](https://github.com/plantuml/plantuml/releases) and set `PLANTUML_JAR` environment variable to point to it
|
|
109
|
+
|
|
101
110
|
**Optional.** Converting formulas and equations to PNG or SVG images requires [Matplotlib](https://matplotlib.org/):
|
|
102
111
|
|
|
103
112
|
```sh
|
|
@@ -112,7 +121,11 @@ As authors of *md2conf*, we don't endorse or support any particular Confluence m
|
|
|
112
121
|
|
|
113
122
|
**Optional.** Displaying Mermaid diagrams in Confluence without pre-rendering in the synchronization phase requires a [marketplace app](https://marketplace.atlassian.com/apps/1226567/mermaid-diagrams-for-confluence). (Refer to `--no-render-mermaid`.)
|
|
114
123
|
|
|
115
|
-
**Optional.**
|
|
124
|
+
**Optional.** PlantUML diagrams are embedded with compressed source data and are displayed using the [PlantUML Diagrams for Confluence](https://marketplace.atlassian.com/apps/1215115/plantuml-diagrams-for-confluence) app (if installed). (Refer to `--no-render-plantuml`.)
|
|
125
|
+
|
|
126
|
+
Installing `plantuml.jar` (see above) helps display embedded diagrams with pre-calculated optimal dimensions.
|
|
127
|
+
|
|
128
|
+
**Optional.** Displaying formulas and equations in Confluence requires [marketplace app](https://marketplace.atlassian.com/apps/1226109/latex-math-for-confluence-math-formula-equations), refer to [LaTeX Math for Confluence - Math Formula & Equations](https://help.narva.net/latex-math-for-confluence/). (Refer to `--no-render-latex`.)
|
|
116
129
|
|
|
117
130
|
## Getting started
|
|
118
131
|
|
|
@@ -215,6 +228,21 @@ Provide generated-by prompt text in the Markdown file with a tag:
|
|
|
215
228
|
|
|
216
229
|
Alternatively, use the `--generated-by GENERATED_BY` option. The tag takes precedence.
|
|
217
230
|
|
|
231
|
+
The generated-by text can also be templated with the following variables:
|
|
232
|
+
|
|
233
|
+
- `%{filename}`: the name of the Markdown file
|
|
234
|
+
- `%{filestem}`: the name of the Markdown file without the extension
|
|
235
|
+
- `%{filepath}`: the path of the Markdown file relative to the _source root_
|
|
236
|
+
- `%{filedir}`: the dirname of the `%{filepath}` (the path without the filename)
|
|
237
|
+
|
|
238
|
+
When publishing a directory hierarchy, the *source root* is the directory in which *md2conf* is launched. When publishing a single file, this is the directory in which the Markdown file resides.
|
|
239
|
+
|
|
240
|
+
It can be used with the CLI `--generated-by` option or directly in the files:
|
|
241
|
+
|
|
242
|
+
```markdown
|
|
243
|
+
<!-- generated-by: Do not edit! Check out the file %{filepath} in the repo -->
|
|
244
|
+
```
|
|
245
|
+
|
|
218
246
|
### Publishing a single page
|
|
219
247
|
|
|
220
248
|
*md2conf* has two modes of operation: *single-page mode* and *directory mode*.
|
|
@@ -359,6 +387,11 @@ Likewise, if you have a nested list, make sure that nested items are indented by
|
|
|
359
387
|
|
|
360
388
|
Local images referenced in a Markdown file are automatically published to Confluence as attachments to the page.
|
|
361
389
|
|
|
390
|
+
* Relative paths (e.g. `path/to/image.png` or `../to/image.png`) resolve to absolute paths w.r.t. the Markdown document location.
|
|
391
|
+
* Absolute paths (e.g. `/path/to/image.png`) are interpreted w.r.t. to the synchronization root (typically the shell current directory).
|
|
392
|
+
|
|
393
|
+
As a security measure, resolved paths can only reference files that are in the directory hierarchy of the synchronization root; you can't use `..` to leave the top-level directory of the synchronization root.
|
|
394
|
+
|
|
362
395
|
Unfortunately, Confluence struggles with SVG images, e.g. they may only show in *edit* mode, display in a wrong size or text labels in the image may be truncated. (This seems to be a known issue in Confluence.) In order to mitigate the issue, whenever *md2conf* encounters a reference to an SVG image in a Markdown file, it checks whether a corresponding PNG image also exists in the same directory, and if a PNG image is found, it is published instead.
|
|
363
396
|
|
|
364
397
|
External images referenced with an absolute URL retain the original URL.
|
|
@@ -455,6 +488,58 @@ This is useful if you have a page in a hierarchy that participates in parent-chi
|
|
|
455
488
|
|
|
456
489
|
If the `title` attribute (in the front-matter) or the topmost unique heading (in the document body) changes, the Confluence page title is updated. A warning is raised if the new title conflicts with the title of another page, and thus cannot be updated.
|
|
457
490
|
|
|
491
|
+
#### Avoiding duplicate titles
|
|
492
|
+
|
|
493
|
+
By default, when *md2conf* extracts a page title from the first unique heading in a Markdown document, the heading remains in the document body. This means the title appears twice on the Confluence page: once as the page title at the top, and once as the first heading in the content.
|
|
494
|
+
|
|
495
|
+
To avoid this duplication, use the `--skip-title-heading` option. When enabled, *md2conf* removes the first heading from the document body if it was used as the page title. This option only takes effect when:
|
|
496
|
+
|
|
497
|
+
1. The title was extracted from the document's first unique heading (not from front-matter), AND
|
|
498
|
+
2. There is exactly one top-level heading in the document.
|
|
499
|
+
|
|
500
|
+
If the title comes from the `title` attribute in front-matter, the heading is preserved in the document body regardless of this setting, as the heading and title are considered separate.
|
|
501
|
+
|
|
502
|
+
**Example without `--skip-title-heading` (default):**
|
|
503
|
+
|
|
504
|
+
Markdown:
|
|
505
|
+
```markdown
|
|
506
|
+
# Installation Guide
|
|
507
|
+
|
|
508
|
+
Follow these steps...
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
Confluence displays:
|
|
512
|
+
- Page title: "Installation Guide"
|
|
513
|
+
- Content: Starts with heading "Installation Guide", followed by "Follow these steps..."
|
|
514
|
+
|
|
515
|
+
**Example with `--skip-title-heading`:**
|
|
516
|
+
|
|
517
|
+
Same Markdown source, but Confluence displays:
|
|
518
|
+
- Page title: "Installation Guide"
|
|
519
|
+
- Content: Starts directly with "Follow these steps..." (heading removed)
|
|
520
|
+
|
|
521
|
+
**Edge case: Abstract or introductory text before the title:**
|
|
522
|
+
|
|
523
|
+
When a document has content before the first heading (like an abstract), removing the heading eliminates the visual separator between the introductory text and the main content:
|
|
524
|
+
|
|
525
|
+
```markdown
|
|
526
|
+
This is an abstract paragraph providing context.
|
|
527
|
+
|
|
528
|
+
# Document Title
|
|
529
|
+
|
|
530
|
+
This is the main document content.
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
With `--skip-title-heading`, the output becomes:
|
|
534
|
+
- Page title: "Document Title"
|
|
535
|
+
- Content: "This is an abstract paragraph..." flows directly into "This is the main document content..." (no heading separator)
|
|
536
|
+
|
|
537
|
+
While the structure remains semantically correct, the visual separation is lost. If you need to maintain separation, consider these workarounds:
|
|
538
|
+
|
|
539
|
+
1. **Use a horizontal rule:** Add `---` after the abstract to create visual separation
|
|
540
|
+
2. **Use an admonition block:** Wrap the abstract in an info/note block
|
|
541
|
+
3. **Use front-matter title:** Set `title` in front-matter to keep the heading in the body
|
|
542
|
+
|
|
458
543
|
### Labels
|
|
459
544
|
|
|
460
545
|
If a Markdown document has the front-matter attribute `tags`, *md2conf* assigns the specified tags to the Confluence page as labels.
|
|
@@ -540,7 +625,9 @@ Specifically, image references for status labels (e.g. `![My label][STATUS-RED]`
|
|
|
540
625
|
|
|
541
626
|
### Running the tool
|
|
542
627
|
|
|
543
|
-
|
|
628
|
+
#### Command line
|
|
629
|
+
|
|
630
|
+
You can synchronize a (directory of) Markdown file(s) with Confluence using the command-line tool `md2conf`:
|
|
544
631
|
|
|
545
632
|
```sh
|
|
546
633
|
$ python3 -m md2conf sample/index.md
|
|
@@ -571,27 +658,89 @@ options:
|
|
|
571
658
|
-r ROOT_PAGE Root Confluence page to create new pages. If omitted, will raise exception when creating new pages.
|
|
572
659
|
--keep-hierarchy Maintain source directory structure when exporting to Confluence.
|
|
573
660
|
--flatten-hierarchy Flatten directories with no index.md or README.md when exporting to Confluence.
|
|
574
|
-
--generated-by
|
|
661
|
+
--generated-by MARKDOWN
|
|
575
662
|
Add prompt to pages (default: 'This page has been generated with a tool.').
|
|
576
663
|
--no-generated-by Do not add 'generated by a tool' prompt to pages.
|
|
577
664
|
--render-drawio Render draw.io diagrams as image files. (Installed utility required to covert.)
|
|
578
665
|
--no-render-drawio Upload draw.io diagram sources as Confluence page attachments. (Marketplace app required to display.)
|
|
579
666
|
--render-mermaid Render Mermaid diagrams as image files. (Installed utility required to convert.)
|
|
580
667
|
--no-render-mermaid Upload Mermaid diagram sources as Confluence page attachments. (Marketplace app required to display.)
|
|
668
|
+
--render-plantuml Render PlantUML diagrams as image files. (Installed utility required to convert.)
|
|
669
|
+
--no-render-plantuml Upload PlantUML diagram sources as Confluence page attachments. (Marketplace app required to display.)
|
|
581
670
|
--render-latex Render LaTeX formulas as image files. (Matplotlib required to convert.)
|
|
582
671
|
--no-render-latex Inline LaTeX formulas in Confluence page. (Marketplace app required to display.)
|
|
583
672
|
--diagram-output-format {png,svg}
|
|
584
673
|
Format for rendering Mermaid and draw.io diagrams (default: 'png').
|
|
674
|
+
--prefer-raster Prefer PNG over SVG when both exist (default: enabled).
|
|
675
|
+
--no-prefer-raster Use SVG files directly instead of preferring PNG equivalents.
|
|
585
676
|
--heading-anchors Place an anchor at each section heading with GitHub-style same-page identifiers.
|
|
586
677
|
--no-heading-anchors Don't place an anchor at each section heading.
|
|
587
678
|
--ignore-invalid-url Emit a warning but otherwise ignore relative URLs that point to ill-specified locations.
|
|
588
|
-
--
|
|
589
|
-
--
|
|
590
|
-
|
|
679
|
+
--skip-title-heading Skip the first heading from document body when it is used as the page title (does not apply if title comes from front-matter).
|
|
680
|
+
--no-skip-title-heading
|
|
681
|
+
Keep the first heading in document body even when used as page title (default).
|
|
682
|
+
--title-prefix TEXT String to prepend to Confluence page title for each published page.
|
|
591
683
|
--webui-links Enable Confluence Web UI links. (Typically required for on-prem versions of Confluence.)
|
|
592
684
|
--alignment {center,left,right}
|
|
593
685
|
Alignment for block-level images and formulas (default: 'center').
|
|
686
|
+
--max-image-width MAX_IMAGE_WIDTH
|
|
687
|
+
Maximum display width for images [px]. Wider images are scaled down for page display. Original size kept for full-size viewing.
|
|
594
688
|
--use-panel Transform admonitions and alerts into a Confluence custom panel.
|
|
689
|
+
--local Write XHTML-based Confluence Storage Format files locally without invoking Confluence API.
|
|
690
|
+
--headers KEY=VALUE [KEY=VALUE ...]
|
|
691
|
+
Apply custom headers to all Confluence API requests.
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
#### Python
|
|
695
|
+
|
|
696
|
+
*md2conf* has a Python interface. Create a `ConnectionProperties` object to set connection parameters to the Confluence server, and a `DocumentOptions` object to configure how Markdown files are converted into pages on a Confluence wiki site. Open a connection to the Confluence server with the context manager `ConfluenceAPI`, and instantiate a `Publisher` to start converting documents.
|
|
697
|
+
|
|
698
|
+
```python
|
|
699
|
+
from md2conf.api import ConfluenceAPI
|
|
700
|
+
from md2conf.environment import ConnectionProperties
|
|
701
|
+
from md2conf.options import ConverterOptions, DocumentOptions, ImageLayoutOptions, LayoutOptions, TableLayoutOptions
|
|
702
|
+
from md2conf.publisher import Publisher
|
|
703
|
+
|
|
704
|
+
properties = ConnectionProperties(
|
|
705
|
+
api_url=...,
|
|
706
|
+
domain=...,
|
|
707
|
+
base_path=...,
|
|
708
|
+
user_name=...,
|
|
709
|
+
api_key=...,
|
|
710
|
+
space_key=...,
|
|
711
|
+
headers=...,
|
|
712
|
+
)
|
|
713
|
+
options = DocumentOptions(
|
|
714
|
+
root_page_id=...,
|
|
715
|
+
keep_hierarchy=...,
|
|
716
|
+
title_prefix=...,
|
|
717
|
+
generated_by=...,
|
|
718
|
+
converter=ConverterOptions(
|
|
719
|
+
heading_anchors=...,
|
|
720
|
+
ignore_invalid_url=...,
|
|
721
|
+
skip_title_heading=...,
|
|
722
|
+
prefer_raster=...,
|
|
723
|
+
render_drawio=...,
|
|
724
|
+
render_mermaid=...,
|
|
725
|
+
render_plantuml=...,
|
|
726
|
+
render_latex=...,
|
|
727
|
+
diagram_output_format=...,
|
|
728
|
+
webui_links=...,
|
|
729
|
+
use_panel=...,
|
|
730
|
+
layout=LayoutOptions(
|
|
731
|
+
image=ImageLayoutOptions(
|
|
732
|
+
alignment=...,
|
|
733
|
+
max_width=...,
|
|
734
|
+
),
|
|
735
|
+
table=TableLayoutOptions(
|
|
736
|
+
width=...,
|
|
737
|
+
display_mode=...,
|
|
738
|
+
),
|
|
739
|
+
),
|
|
740
|
+
),
|
|
741
|
+
)
|
|
742
|
+
with ConfluenceAPI(properties) as api:
|
|
743
|
+
Publisher(api, options).process(mdpath)
|
|
595
744
|
```
|
|
596
745
|
|
|
597
746
|
### Confluence REST API v1 vs. v2
|
|
@@ -52,6 +52,15 @@ pip install markdown-to-confluence
|
|
|
52
52
|
npm install -g @mermaid-js/mermaid-cli
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
+
**Optional.** Pre-rendering PlantUML diagrams into PNG or SVG images requires Java, Graphviz and [PlantUML](https://plantuml.com/). (Refer to `--render-plantuml`.)
|
|
56
|
+
|
|
57
|
+
1. **Install Java**: Version 8 or later from [Adoptium](https://adoptium.net/) or [Oracle](https://www.oracle.com/java/technologies/downloads/)
|
|
58
|
+
2. **Install Graphviz**: Required for most diagram types in PlantUML (except sequence diagrams)
|
|
59
|
+
* **Ubuntu/Debian**: `sudo apt-get install Graphviz`
|
|
60
|
+
* **macOS**: `brew install graphviz`
|
|
61
|
+
* **Windows**: Download from [graphviz.org](https://graphviz.org/download/)
|
|
62
|
+
3. **Download PlantUML JAR**: Download [plantuml.jar](https://github.com/plantuml/plantuml/releases) and set `PLANTUML_JAR` environment variable to point to it
|
|
63
|
+
|
|
55
64
|
**Optional.** Converting formulas and equations to PNG or SVG images requires [Matplotlib](https://matplotlib.org/):
|
|
56
65
|
|
|
57
66
|
```sh
|
|
@@ -66,7 +75,11 @@ As authors of *md2conf*, we don't endorse or support any particular Confluence m
|
|
|
66
75
|
|
|
67
76
|
**Optional.** Displaying Mermaid diagrams in Confluence without pre-rendering in the synchronization phase requires a [marketplace app](https://marketplace.atlassian.com/apps/1226567/mermaid-diagrams-for-confluence). (Refer to `--no-render-mermaid`.)
|
|
68
77
|
|
|
69
|
-
**Optional.**
|
|
78
|
+
**Optional.** PlantUML diagrams are embedded with compressed source data and are displayed using the [PlantUML Diagrams for Confluence](https://marketplace.atlassian.com/apps/1215115/plantuml-diagrams-for-confluence) app (if installed). (Refer to `--no-render-plantuml`.)
|
|
79
|
+
|
|
80
|
+
Installing `plantuml.jar` (see above) helps display embedded diagrams with pre-calculated optimal dimensions.
|
|
81
|
+
|
|
82
|
+
**Optional.** Displaying formulas and equations in Confluence requires [marketplace app](https://marketplace.atlassian.com/apps/1226109/latex-math-for-confluence-math-formula-equations), refer to [LaTeX Math for Confluence - Math Formula & Equations](https://help.narva.net/latex-math-for-confluence/). (Refer to `--no-render-latex`.)
|
|
70
83
|
|
|
71
84
|
## Getting started
|
|
72
85
|
|
|
@@ -169,6 +182,21 @@ Provide generated-by prompt text in the Markdown file with a tag:
|
|
|
169
182
|
|
|
170
183
|
Alternatively, use the `--generated-by GENERATED_BY` option. The tag takes precedence.
|
|
171
184
|
|
|
185
|
+
The generated-by text can also be templated with the following variables:
|
|
186
|
+
|
|
187
|
+
- `%{filename}`: the name of the Markdown file
|
|
188
|
+
- `%{filestem}`: the name of the Markdown file without the extension
|
|
189
|
+
- `%{filepath}`: the path of the Markdown file relative to the _source root_
|
|
190
|
+
- `%{filedir}`: the dirname of the `%{filepath}` (the path without the filename)
|
|
191
|
+
|
|
192
|
+
When publishing a directory hierarchy, the *source root* is the directory in which *md2conf* is launched. When publishing a single file, this is the directory in which the Markdown file resides.
|
|
193
|
+
|
|
194
|
+
It can be used with the CLI `--generated-by` option or directly in the files:
|
|
195
|
+
|
|
196
|
+
```markdown
|
|
197
|
+
<!-- generated-by: Do not edit! Check out the file %{filepath} in the repo -->
|
|
198
|
+
```
|
|
199
|
+
|
|
172
200
|
### Publishing a single page
|
|
173
201
|
|
|
174
202
|
*md2conf* has two modes of operation: *single-page mode* and *directory mode*.
|
|
@@ -313,6 +341,11 @@ Likewise, if you have a nested list, make sure that nested items are indented by
|
|
|
313
341
|
|
|
314
342
|
Local images referenced in a Markdown file are automatically published to Confluence as attachments to the page.
|
|
315
343
|
|
|
344
|
+
* Relative paths (e.g. `path/to/image.png` or `../to/image.png`) resolve to absolute paths w.r.t. the Markdown document location.
|
|
345
|
+
* Absolute paths (e.g. `/path/to/image.png`) are interpreted w.r.t. to the synchronization root (typically the shell current directory).
|
|
346
|
+
|
|
347
|
+
As a security measure, resolved paths can only reference files that are in the directory hierarchy of the synchronization root; you can't use `..` to leave the top-level directory of the synchronization root.
|
|
348
|
+
|
|
316
349
|
Unfortunately, Confluence struggles with SVG images, e.g. they may only show in *edit* mode, display in a wrong size or text labels in the image may be truncated. (This seems to be a known issue in Confluence.) In order to mitigate the issue, whenever *md2conf* encounters a reference to an SVG image in a Markdown file, it checks whether a corresponding PNG image also exists in the same directory, and if a PNG image is found, it is published instead.
|
|
317
350
|
|
|
318
351
|
External images referenced with an absolute URL retain the original URL.
|
|
@@ -409,6 +442,58 @@ This is useful if you have a page in a hierarchy that participates in parent-chi
|
|
|
409
442
|
|
|
410
443
|
If the `title` attribute (in the front-matter) or the topmost unique heading (in the document body) changes, the Confluence page title is updated. A warning is raised if the new title conflicts with the title of another page, and thus cannot be updated.
|
|
411
444
|
|
|
445
|
+
#### Avoiding duplicate titles
|
|
446
|
+
|
|
447
|
+
By default, when *md2conf* extracts a page title from the first unique heading in a Markdown document, the heading remains in the document body. This means the title appears twice on the Confluence page: once as the page title at the top, and once as the first heading in the content.
|
|
448
|
+
|
|
449
|
+
To avoid this duplication, use the `--skip-title-heading` option. When enabled, *md2conf* removes the first heading from the document body if it was used as the page title. This option only takes effect when:
|
|
450
|
+
|
|
451
|
+
1. The title was extracted from the document's first unique heading (not from front-matter), AND
|
|
452
|
+
2. There is exactly one top-level heading in the document.
|
|
453
|
+
|
|
454
|
+
If the title comes from the `title` attribute in front-matter, the heading is preserved in the document body regardless of this setting, as the heading and title are considered separate.
|
|
455
|
+
|
|
456
|
+
**Example without `--skip-title-heading` (default):**
|
|
457
|
+
|
|
458
|
+
Markdown:
|
|
459
|
+
```markdown
|
|
460
|
+
# Installation Guide
|
|
461
|
+
|
|
462
|
+
Follow these steps...
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
Confluence displays:
|
|
466
|
+
- Page title: "Installation Guide"
|
|
467
|
+
- Content: Starts with heading "Installation Guide", followed by "Follow these steps..."
|
|
468
|
+
|
|
469
|
+
**Example with `--skip-title-heading`:**
|
|
470
|
+
|
|
471
|
+
Same Markdown source, but Confluence displays:
|
|
472
|
+
- Page title: "Installation Guide"
|
|
473
|
+
- Content: Starts directly with "Follow these steps..." (heading removed)
|
|
474
|
+
|
|
475
|
+
**Edge case: Abstract or introductory text before the title:**
|
|
476
|
+
|
|
477
|
+
When a document has content before the first heading (like an abstract), removing the heading eliminates the visual separator between the introductory text and the main content:
|
|
478
|
+
|
|
479
|
+
```markdown
|
|
480
|
+
This is an abstract paragraph providing context.
|
|
481
|
+
|
|
482
|
+
# Document Title
|
|
483
|
+
|
|
484
|
+
This is the main document content.
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
With `--skip-title-heading`, the output becomes:
|
|
488
|
+
- Page title: "Document Title"
|
|
489
|
+
- Content: "This is an abstract paragraph..." flows directly into "This is the main document content..." (no heading separator)
|
|
490
|
+
|
|
491
|
+
While the structure remains semantically correct, the visual separation is lost. If you need to maintain separation, consider these workarounds:
|
|
492
|
+
|
|
493
|
+
1. **Use a horizontal rule:** Add `---` after the abstract to create visual separation
|
|
494
|
+
2. **Use an admonition block:** Wrap the abstract in an info/note block
|
|
495
|
+
3. **Use front-matter title:** Set `title` in front-matter to keep the heading in the body
|
|
496
|
+
|
|
412
497
|
### Labels
|
|
413
498
|
|
|
414
499
|
If a Markdown document has the front-matter attribute `tags`, *md2conf* assigns the specified tags to the Confluence page as labels.
|
|
@@ -494,7 +579,9 @@ Specifically, image references for status labels (e.g. `![My label][STATUS-RED]`
|
|
|
494
579
|
|
|
495
580
|
### Running the tool
|
|
496
581
|
|
|
497
|
-
|
|
582
|
+
#### Command line
|
|
583
|
+
|
|
584
|
+
You can synchronize a (directory of) Markdown file(s) with Confluence using the command-line tool `md2conf`:
|
|
498
585
|
|
|
499
586
|
```sh
|
|
500
587
|
$ python3 -m md2conf sample/index.md
|
|
@@ -525,27 +612,89 @@ options:
|
|
|
525
612
|
-r ROOT_PAGE Root Confluence page to create new pages. If omitted, will raise exception when creating new pages.
|
|
526
613
|
--keep-hierarchy Maintain source directory structure when exporting to Confluence.
|
|
527
614
|
--flatten-hierarchy Flatten directories with no index.md or README.md when exporting to Confluence.
|
|
528
|
-
--generated-by
|
|
615
|
+
--generated-by MARKDOWN
|
|
529
616
|
Add prompt to pages (default: 'This page has been generated with a tool.').
|
|
530
617
|
--no-generated-by Do not add 'generated by a tool' prompt to pages.
|
|
531
618
|
--render-drawio Render draw.io diagrams as image files. (Installed utility required to covert.)
|
|
532
619
|
--no-render-drawio Upload draw.io diagram sources as Confluence page attachments. (Marketplace app required to display.)
|
|
533
620
|
--render-mermaid Render Mermaid diagrams as image files. (Installed utility required to convert.)
|
|
534
621
|
--no-render-mermaid Upload Mermaid diagram sources as Confluence page attachments. (Marketplace app required to display.)
|
|
622
|
+
--render-plantuml Render PlantUML diagrams as image files. (Installed utility required to convert.)
|
|
623
|
+
--no-render-plantuml Upload PlantUML diagram sources as Confluence page attachments. (Marketplace app required to display.)
|
|
535
624
|
--render-latex Render LaTeX formulas as image files. (Matplotlib required to convert.)
|
|
536
625
|
--no-render-latex Inline LaTeX formulas in Confluence page. (Marketplace app required to display.)
|
|
537
626
|
--diagram-output-format {png,svg}
|
|
538
627
|
Format for rendering Mermaid and draw.io diagrams (default: 'png').
|
|
628
|
+
--prefer-raster Prefer PNG over SVG when both exist (default: enabled).
|
|
629
|
+
--no-prefer-raster Use SVG files directly instead of preferring PNG equivalents.
|
|
539
630
|
--heading-anchors Place an anchor at each section heading with GitHub-style same-page identifiers.
|
|
540
631
|
--no-heading-anchors Don't place an anchor at each section heading.
|
|
541
632
|
--ignore-invalid-url Emit a warning but otherwise ignore relative URLs that point to ill-specified locations.
|
|
542
|
-
--
|
|
543
|
-
--
|
|
544
|
-
|
|
633
|
+
--skip-title-heading Skip the first heading from document body when it is used as the page title (does not apply if title comes from front-matter).
|
|
634
|
+
--no-skip-title-heading
|
|
635
|
+
Keep the first heading in document body even when used as page title (default).
|
|
636
|
+
--title-prefix TEXT String to prepend to Confluence page title for each published page.
|
|
545
637
|
--webui-links Enable Confluence Web UI links. (Typically required for on-prem versions of Confluence.)
|
|
546
638
|
--alignment {center,left,right}
|
|
547
639
|
Alignment for block-level images and formulas (default: 'center').
|
|
640
|
+
--max-image-width MAX_IMAGE_WIDTH
|
|
641
|
+
Maximum display width for images [px]. Wider images are scaled down for page display. Original size kept for full-size viewing.
|
|
548
642
|
--use-panel Transform admonitions and alerts into a Confluence custom panel.
|
|
643
|
+
--local Write XHTML-based Confluence Storage Format files locally without invoking Confluence API.
|
|
644
|
+
--headers KEY=VALUE [KEY=VALUE ...]
|
|
645
|
+
Apply custom headers to all Confluence API requests.
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
#### Python
|
|
649
|
+
|
|
650
|
+
*md2conf* has a Python interface. Create a `ConnectionProperties` object to set connection parameters to the Confluence server, and a `DocumentOptions` object to configure how Markdown files are converted into pages on a Confluence wiki site. Open a connection to the Confluence server with the context manager `ConfluenceAPI`, and instantiate a `Publisher` to start converting documents.
|
|
651
|
+
|
|
652
|
+
```python
|
|
653
|
+
from md2conf.api import ConfluenceAPI
|
|
654
|
+
from md2conf.environment import ConnectionProperties
|
|
655
|
+
from md2conf.options import ConverterOptions, DocumentOptions, ImageLayoutOptions, LayoutOptions, TableLayoutOptions
|
|
656
|
+
from md2conf.publisher import Publisher
|
|
657
|
+
|
|
658
|
+
properties = ConnectionProperties(
|
|
659
|
+
api_url=...,
|
|
660
|
+
domain=...,
|
|
661
|
+
base_path=...,
|
|
662
|
+
user_name=...,
|
|
663
|
+
api_key=...,
|
|
664
|
+
space_key=...,
|
|
665
|
+
headers=...,
|
|
666
|
+
)
|
|
667
|
+
options = DocumentOptions(
|
|
668
|
+
root_page_id=...,
|
|
669
|
+
keep_hierarchy=...,
|
|
670
|
+
title_prefix=...,
|
|
671
|
+
generated_by=...,
|
|
672
|
+
converter=ConverterOptions(
|
|
673
|
+
heading_anchors=...,
|
|
674
|
+
ignore_invalid_url=...,
|
|
675
|
+
skip_title_heading=...,
|
|
676
|
+
prefer_raster=...,
|
|
677
|
+
render_drawio=...,
|
|
678
|
+
render_mermaid=...,
|
|
679
|
+
render_plantuml=...,
|
|
680
|
+
render_latex=...,
|
|
681
|
+
diagram_output_format=...,
|
|
682
|
+
webui_links=...,
|
|
683
|
+
use_panel=...,
|
|
684
|
+
layout=LayoutOptions(
|
|
685
|
+
image=ImageLayoutOptions(
|
|
686
|
+
alignment=...,
|
|
687
|
+
max_width=...,
|
|
688
|
+
),
|
|
689
|
+
table=TableLayoutOptions(
|
|
690
|
+
width=...,
|
|
691
|
+
display_mode=...,
|
|
692
|
+
),
|
|
693
|
+
),
|
|
694
|
+
),
|
|
695
|
+
)
|
|
696
|
+
with ConfluenceAPI(properties) as api:
|
|
697
|
+
Publisher(api, options).process(mdpath)
|
|
549
698
|
```
|
|
550
699
|
|
|
551
700
|
### Confluence REST API v1 vs. v2
|