markdown-to-confluence 0.2.7__tar.gz → 0.3.1__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.
Files changed (31) hide show
  1. {markdown_to_confluence-0.2.7/markdown_to_confluence.egg-info → markdown_to_confluence-0.3.1}/PKG-INFO +44 -7
  2. markdown_to_confluence-0.2.7/PKG-INFO → markdown_to_confluence-0.3.1/README.md +38 -34
  3. markdown_to_confluence-0.2.7/README.md → markdown_to_confluence-0.3.1/markdown_to_confluence.egg-info/PKG-INFO +71 -1
  4. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/markdown_to_confluence.egg-info/SOURCES.txt +0 -1
  5. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/markdown_to_confluence.egg-info/requires.txt +2 -2
  6. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/__init__.py +2 -2
  7. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/__main__.py +12 -4
  8. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/api.py +203 -146
  9. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/application.py +27 -19
  10. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/converter.py +38 -45
  11. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/emoji.py +1 -1
  12. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/matcher.py +11 -6
  13. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/mermaid.py +6 -2
  14. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/processor.py +7 -7
  15. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/properties.py +5 -7
  16. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/setup.cfg +4 -4
  17. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/setup.py +1 -1
  18. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/tests/test_conversion.py +1 -1
  19. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/tests/test_matcher.py +1 -1
  20. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/tests/test_mermaid.py +1 -1
  21. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/tests/test_processor.py +1 -1
  22. markdown_to_confluence-0.2.7/md2conf/util.py +0 -27
  23. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/LICENSE +0 -0
  24. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/markdown_to_confluence.egg-info/dependency_links.txt +0 -0
  25. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/markdown_to_confluence.egg-info/entry_points.txt +0 -0
  26. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/markdown_to_confluence.egg-info/top_level.txt +0 -0
  27. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/markdown_to_confluence.egg-info/zip-safe +0 -0
  28. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/entities.dtd +0 -0
  29. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/puppeteer-config.json +0 -0
  30. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/md2conf/py.typed +0 -0
  31. {markdown_to_confluence-0.2.7 → markdown_to_confluence-0.3.1}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: markdown-to-confluence
3
- Version: 0.2.7
3
+ Version: 0.3.1
4
4
  Summary: Publish Markdown files to Confluence wiki
5
5
  Home-page: https://github.com/hunyadi/md2conf
6
6
  Author: Levente Hunyadi
@@ -12,20 +12,20 @@ Classifier: Intended Audience :: End Users/Desktop
12
12
  Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
15
  Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
19
18
  Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
20
  Classifier: Typing :: Typed
21
- Requires-Python: >=3.8
21
+ Requires-Python: >=3.9
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Requires-Dist: lxml>=5.3
25
- Requires-Dist: types-lxml>=2024.11.8
25
+ Requires-Dist: types-lxml>=2024.12.13
26
26
  Requires-Dist: markdown>=3.7
27
27
  Requires-Dist: types-markdown>=3.7
28
- Requires-Dist: pymdown-extensions>=10.12
28
+ Requires-Dist: pymdown-extensions>=10.14
29
29
  Requires-Dist: pyyaml>=6.0
30
30
  Requires-Dist: types-PyYAML>=6.0
31
31
  Requires-Dist: requests>=2.32
@@ -57,6 +57,8 @@ This Python package
57
57
  * [Collapsed sections](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections)
58
58
  * [Mermaid diagrams](https://mermaid.live/) in code blocks (converted to images)
59
59
 
60
+ Whenever possible, the implementation uses [Confluence REST API v2](https://developer.atlassian.com/cloud/confluence/rest/v2/) to fetch space properties, and get, create or update page content.
61
+
60
62
  ## Installation
61
63
 
62
64
  Install the core package from PyPI:
@@ -160,6 +162,41 @@ First, *md2conf* builds an index of pages in the directory hierarchy. The index
160
162
 
161
163
  If a Markdown file doesn't yet pair up with a Confluence page, *md2conf* creates a new page and assigns a parent. Parent-child relationships are reflected in the navigation panel in Confluence. You can set a root page ID with the command-line option `-r`, which constitutes the topmost parent. (This could correspond to the landing page of your Confluence space. The Confluence page ID is always revealed when you edit a page.) Whenever a directory contains the file `index.md` or `README.md`, this page becomes the future parent page, and all Markdown files in this directory (and possibly nested directories) become its child pages (unless they already have a page ID). However, if an `index.md` or `README.md` file is subsequently found in one of the nested directories, it becomes the parent page of that directory, and any of its subdirectories.
162
164
 
165
+ The concepts above are illustrated in the following sections.
166
+
167
+ #### File-system directory hierarchy
168
+
169
+ The title of each Markdown file (either the text of the first heading (`#`), or the title specified in front-matter) is shown next to the file name.
170
+
171
+ ```
172
+ .
173
+ ├── computer-science
174
+ │ ├── index.md: Introduction to computer science
175
+ │ ├── algebra.md: Linear algebra
176
+ │ └── algorithms.md: Theory of algorithms
177
+ └── machine-learning
178
+ ├── README.md: AI and ML
179
+ ├── awareness.md: Consciousness and intelligence
180
+ └── statistics
181
+ ├── index.md: Introduction to statistics
182
+ └── median.md: Mean vs. median
183
+ ```
184
+
185
+ #### Page hierarchy in Confluence
186
+
187
+ Observe how `index.md` and `README.md` files have assumed parent (or ancestor) role for any Markdown files in the same directory (or below).
188
+
189
+ ```
190
+ root
191
+ ├── Introduction to computer science
192
+ │ ├── Linear algebra
193
+ │ └── Theory of algorithms
194
+ └── AI and ML
195
+ ├── Consciousness and intelligence
196
+ └── Introduction to statistics
197
+ └── Mean vs. median
198
+ ```
199
+
163
200
  ### Ignoring files
164
201
 
165
202
  Skip files in a directory with rules defined in `.mdignore`. Each rule should occupy a single line. Rules follow the syntax of [fnmatch](https://docs.python.org/3/library/fnmatch.html#fnmatch.fnmatch). Specifically, `?` matches any single character, and `*` matches zero or more characters. For example, use `up-*.md` to exclude Markdown files that start with `up-`. Lines that start with `#` are treated as comments.
@@ -214,7 +251,7 @@ options:
214
251
  --local Write XHTML-based Confluence Storage Format files locally without invoking Confluence API.
215
252
  --headers [KEY=VALUE ...]
216
253
  Apply custom headers to all Confluence API requests.
217
- --webui-links Enable Confluence Web UI links.
254
+ --webui-links Enable Confluence Web UI links. (Typically required for on-prem versions of Confluence.)
218
255
  ```
219
256
 
220
257
  ### Using the Docker container
@@ -1,36 +1,3 @@
1
- Metadata-Version: 2.1
2
- Name: markdown-to-confluence
3
- Version: 0.2.7
4
- Summary: Publish Markdown files to Confluence wiki
5
- Home-page: https://github.com/hunyadi/md2conf
6
- Author: Levente Hunyadi
7
- Author-email: hunyadi@gmail.com
8
- License: MIT
9
- Classifier: Development Status :: 5 - Production/Stable
10
- Classifier: Environment :: Console
11
- Classifier: Intended Audience :: End Users/Desktop
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Operating System :: OS Independent
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3.11
19
- Classifier: Programming Language :: Python :: 3.12
20
- Classifier: Typing :: Typed
21
- Requires-Python: >=3.8
22
- Description-Content-Type: text/markdown
23
- License-File: LICENSE
24
- Requires-Dist: lxml>=5.3
25
- Requires-Dist: types-lxml>=2024.11.8
26
- Requires-Dist: markdown>=3.7
27
- Requires-Dist: types-markdown>=3.7
28
- Requires-Dist: pymdown-extensions>=10.12
29
- Requires-Dist: pyyaml>=6.0
30
- Requires-Dist: types-PyYAML>=6.0
31
- Requires-Dist: requests>=2.32
32
- Requires-Dist: types-requests>=2.32
33
-
34
1
  # Publish Markdown files to Confluence wiki
35
2
 
36
3
  Contributors to software projects typically write documentation in Markdown format and host Markdown files in collaborative version control systems (VCS) such as GitHub or GitLab to track changes and facilitate the review process. However, not everyone at a company has access to VCS, and documents are often circulated in Confluence wiki instead.
@@ -57,6 +24,8 @@ This Python package
57
24
  * [Collapsed sections](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections)
58
25
  * [Mermaid diagrams](https://mermaid.live/) in code blocks (converted to images)
59
26
 
27
+ Whenever possible, the implementation uses [Confluence REST API v2](https://developer.atlassian.com/cloud/confluence/rest/v2/) to fetch space properties, and get, create or update page content.
28
+
60
29
  ## Installation
61
30
 
62
31
  Install the core package from PyPI:
@@ -160,6 +129,41 @@ First, *md2conf* builds an index of pages in the directory hierarchy. The index
160
129
 
161
130
  If a Markdown file doesn't yet pair up with a Confluence page, *md2conf* creates a new page and assigns a parent. Parent-child relationships are reflected in the navigation panel in Confluence. You can set a root page ID with the command-line option `-r`, which constitutes the topmost parent. (This could correspond to the landing page of your Confluence space. The Confluence page ID is always revealed when you edit a page.) Whenever a directory contains the file `index.md` or `README.md`, this page becomes the future parent page, and all Markdown files in this directory (and possibly nested directories) become its child pages (unless they already have a page ID). However, if an `index.md` or `README.md` file is subsequently found in one of the nested directories, it becomes the parent page of that directory, and any of its subdirectories.
162
131
 
132
+ The concepts above are illustrated in the following sections.
133
+
134
+ #### File-system directory hierarchy
135
+
136
+ The title of each Markdown file (either the text of the first heading (`#`), or the title specified in front-matter) is shown next to the file name.
137
+
138
+ ```
139
+ .
140
+ ├── computer-science
141
+ │ ├── index.md: Introduction to computer science
142
+ │ ├── algebra.md: Linear algebra
143
+ │ └── algorithms.md: Theory of algorithms
144
+ └── machine-learning
145
+ ├── README.md: AI and ML
146
+ ├── awareness.md: Consciousness and intelligence
147
+ └── statistics
148
+ ├── index.md: Introduction to statistics
149
+ └── median.md: Mean vs. median
150
+ ```
151
+
152
+ #### Page hierarchy in Confluence
153
+
154
+ Observe how `index.md` and `README.md` files have assumed parent (or ancestor) role for any Markdown files in the same directory (or below).
155
+
156
+ ```
157
+ root
158
+ ├── Introduction to computer science
159
+ │ ├── Linear algebra
160
+ │ └── Theory of algorithms
161
+ └── AI and ML
162
+ ├── Consciousness and intelligence
163
+ └── Introduction to statistics
164
+ └── Mean vs. median
165
+ ```
166
+
163
167
  ### Ignoring files
164
168
 
165
169
  Skip files in a directory with rules defined in `.mdignore`. Each rule should occupy a single line. Rules follow the syntax of [fnmatch](https://docs.python.org/3/library/fnmatch.html#fnmatch.fnmatch). Specifically, `?` matches any single character, and `*` matches zero or more characters. For example, use `up-*.md` to exclude Markdown files that start with `up-`. Lines that start with `#` are treated as comments.
@@ -214,7 +218,7 @@ options:
214
218
  --local Write XHTML-based Confluence Storage Format files locally without invoking Confluence API.
215
219
  --headers [KEY=VALUE ...]
216
220
  Apply custom headers to all Confluence API requests.
217
- --webui-links Enable Confluence Web UI links.
221
+ --webui-links Enable Confluence Web UI links. (Typically required for on-prem versions of Confluence.)
218
222
  ```
219
223
 
220
224
  ### Using the Docker container
@@ -1,3 +1,36 @@
1
+ Metadata-Version: 2.2
2
+ Name: markdown-to-confluence
3
+ Version: 0.3.1
4
+ Summary: Publish Markdown files to Confluence wiki
5
+ Home-page: https://github.com/hunyadi/md2conf
6
+ Author: Levente Hunyadi
7
+ Author-email: hunyadi@gmail.com
8
+ License: MIT
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: End Users/Desktop
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: lxml>=5.3
25
+ Requires-Dist: types-lxml>=2024.12.13
26
+ Requires-Dist: markdown>=3.7
27
+ Requires-Dist: types-markdown>=3.7
28
+ Requires-Dist: pymdown-extensions>=10.14
29
+ Requires-Dist: pyyaml>=6.0
30
+ Requires-Dist: types-PyYAML>=6.0
31
+ Requires-Dist: requests>=2.32
32
+ Requires-Dist: types-requests>=2.32
33
+
1
34
  # Publish Markdown files to Confluence wiki
2
35
 
3
36
  Contributors to software projects typically write documentation in Markdown format and host Markdown files in collaborative version control systems (VCS) such as GitHub or GitLab to track changes and facilitate the review process. However, not everyone at a company has access to VCS, and documents are often circulated in Confluence wiki instead.
@@ -24,6 +57,8 @@ This Python package
24
57
  * [Collapsed sections](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections)
25
58
  * [Mermaid diagrams](https://mermaid.live/) in code blocks (converted to images)
26
59
 
60
+ Whenever possible, the implementation uses [Confluence REST API v2](https://developer.atlassian.com/cloud/confluence/rest/v2/) to fetch space properties, and get, create or update page content.
61
+
27
62
  ## Installation
28
63
 
29
64
  Install the core package from PyPI:
@@ -127,6 +162,41 @@ First, *md2conf* builds an index of pages in the directory hierarchy. The index
127
162
 
128
163
  If a Markdown file doesn't yet pair up with a Confluence page, *md2conf* creates a new page and assigns a parent. Parent-child relationships are reflected in the navigation panel in Confluence. You can set a root page ID with the command-line option `-r`, which constitutes the topmost parent. (This could correspond to the landing page of your Confluence space. The Confluence page ID is always revealed when you edit a page.) Whenever a directory contains the file `index.md` or `README.md`, this page becomes the future parent page, and all Markdown files in this directory (and possibly nested directories) become its child pages (unless they already have a page ID). However, if an `index.md` or `README.md` file is subsequently found in one of the nested directories, it becomes the parent page of that directory, and any of its subdirectories.
129
164
 
165
+ The concepts above are illustrated in the following sections.
166
+
167
+ #### File-system directory hierarchy
168
+
169
+ The title of each Markdown file (either the text of the first heading (`#`), or the title specified in front-matter) is shown next to the file name.
170
+
171
+ ```
172
+ .
173
+ ├── computer-science
174
+ │ ├── index.md: Introduction to computer science
175
+ │ ├── algebra.md: Linear algebra
176
+ │ └── algorithms.md: Theory of algorithms
177
+ └── machine-learning
178
+ ├── README.md: AI and ML
179
+ ├── awareness.md: Consciousness and intelligence
180
+ └── statistics
181
+ ├── index.md: Introduction to statistics
182
+ └── median.md: Mean vs. median
183
+ ```
184
+
185
+ #### Page hierarchy in Confluence
186
+
187
+ Observe how `index.md` and `README.md` files have assumed parent (or ancestor) role for any Markdown files in the same directory (or below).
188
+
189
+ ```
190
+ root
191
+ ├── Introduction to computer science
192
+ │ ├── Linear algebra
193
+ │ └── Theory of algorithms
194
+ └── AI and ML
195
+ ├── Consciousness and intelligence
196
+ └── Introduction to statistics
197
+ └── Mean vs. median
198
+ ```
199
+
130
200
  ### Ignoring files
131
201
 
132
202
  Skip files in a directory with rules defined in `.mdignore`. Each rule should occupy a single line. Rules follow the syntax of [fnmatch](https://docs.python.org/3/library/fnmatch.html#fnmatch.fnmatch). Specifically, `?` matches any single character, and `*` matches zero or more characters. For example, use `up-*.md` to exclude Markdown files that start with `up-`. Lines that start with `#` are treated as comments.
@@ -181,7 +251,7 @@ options:
181
251
  --local Write XHTML-based Confluence Storage Format files locally without invoking Confluence API.
182
252
  --headers [KEY=VALUE ...]
183
253
  Apply custom headers to all Confluence API requests.
184
- --webui-links Enable Confluence Web UI links.
254
+ --webui-links Enable Confluence Web UI links. (Typically required for on-prem versions of Confluence.)
185
255
  ```
186
256
 
187
257
  ### Using the Docker container
@@ -23,7 +23,6 @@ md2conf/processor.py
23
23
  md2conf/properties.py
24
24
  md2conf/puppeteer-config.json
25
25
  md2conf/py.typed
26
- md2conf/util.py
27
26
  tests/test_conversion.py
28
27
  tests/test_matcher.py
29
28
  tests/test_mermaid.py
@@ -1,8 +1,8 @@
1
1
  lxml>=5.3
2
- types-lxml>=2024.11.8
2
+ types-lxml>=2024.12.13
3
3
  markdown>=3.7
4
4
  types-markdown>=3.7
5
- pymdown-extensions>=10.12
5
+ pymdown-extensions>=10.14
6
6
  pyyaml>=6.0
7
7
  types-PyYAML>=6.0
8
8
  requests>=2.32
@@ -5,9 +5,9 @@ Parses Markdown files, converts Markdown content into the Confluence Storage For
5
5
  Confluence API endpoints to upload images and content.
6
6
  """
7
7
 
8
- __version__ = "0.2.7"
8
+ __version__ = "0.3.1"
9
9
  __author__ = "Levente Hunyadi"
10
- __copyright__ = "Copyright 2022-2024, Levente Hunyadi"
10
+ __copyright__ = "Copyright 2022-2025, Levente Hunyadi"
11
11
  __license__ = "MIT"
12
12
  __maintainer__ = "Levente Hunyadi"
13
13
  __status__ = "Production"
@@ -4,7 +4,7 @@ Publish Markdown files to Confluence wiki.
4
4
  Parses Markdown files, converts Markdown content into the Confluence Storage Format (XHTML), and invokes
5
5
  Confluence API endpoints to upload images and content.
6
6
 
7
- Copyright 2022-2024, Levente Hunyadi
7
+ Copyright 2022-2025, Levente Hunyadi
8
8
 
9
9
  :see: https://github.com/hunyadi/md2conf
10
10
  """
@@ -38,9 +38,12 @@ class Arguments(argparse.Namespace):
38
38
  ignore_invalid_url: bool
39
39
  heading_anchors: bool
40
40
  root_page: Optional[str]
41
+ keep_hierarchy: bool
41
42
  generated_by: Optional[str]
42
43
  render_mermaid: bool
43
44
  diagram_output_format: Literal["png", "svg"]
45
+ local: bool
46
+ headers: dict[str, str]
44
47
  webui_links: bool
45
48
 
46
49
 
@@ -107,6 +110,12 @@ def main() -> None:
107
110
  dest="root_page",
108
111
  help="Root Confluence page to create new pages. If omitted, will raise exception when creating new pages.",
109
112
  )
113
+ parser.add_argument(
114
+ "--keep-hierarchy",
115
+ action="store_true",
116
+ default=False,
117
+ help="Maintain source directory structure when exporting to Confluence.",
118
+ )
110
119
  parser.add_argument(
111
120
  "--generated-by",
112
121
  default="This page has been generated with a tool.",
@@ -169,14 +178,12 @@ def main() -> None:
169
178
  "--webui-links",
170
179
  action="store_true",
171
180
  default=False,
172
- help="Enable Confluence Web UI links.",
181
+ help="Enable Confluence Web UI links. (Typically required for on-prem versions of Confluence.)",
173
182
  )
174
183
 
175
184
  args = Arguments()
176
185
  parser.parse_args(namespace=args)
177
186
 
178
- # NOTE: If we switch to modern type aware CLI tool like typer
179
- # the following line won't be necessary
180
187
  args.mdpath = Path(args.mdpath)
181
188
 
182
189
  logging.basicConfig(
@@ -189,6 +196,7 @@ def main() -> None:
189
196
  ignore_invalid_url=args.ignore_invalid_url,
190
197
  generated_by=args.generated_by,
191
198
  root_page_id=args.root_page,
199
+ keep_hierarchy=args.keep_hierarchy,
192
200
  render_mermaid=args.render_mermaid,
193
201
  diagram_output_format=args.diagram_output_format,
194
202
  webui_links=args.webui_links,