markdown-to-confluence 0.2.6__py3-none-any.whl → 0.3.0__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: markdown-to-confluence
3
- Version: 0.2.6
3
+ Version: 0.3.0
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
@@ -50,13 +50,15 @@ This Python package
50
50
  * Link to [sections on the same page](#getting-started) or [external locations](http://example.com/)
51
51
  * Ordered and unordered lists
52
52
  * Code blocks (e.g. Python, JSON, XML)
53
- * Image references (uploaded as Confluence page attachments)
53
+ * Images (uploaded as Confluence page attachments or hosted externally)
54
54
  * Tables
55
55
  * [Table of contents](https://docs.gitlab.com/ee/user/markdown.html#table-of-contents)
56
56
  * [Admonitions](https://python-markdown.github.io/extensions/admonition/) and alert boxes in [GitHub](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts) and [GitLab](https://docs.gitlab.com/ee/development/documentation/styleguide/#alert-boxes)
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
@@ -0,0 +1,21 @@
1
+ md2conf/__init__.py,sha256=Lveuwj776s0e_lokulqzAtv64eStsiMROB96DimCLd0,402
2
+ md2conf/__main__.py,sha256=Sga_W_b5E1YokJcBAXcmZVnYk-us8A0kkhfkmdHogsg,6883
3
+ md2conf/api.py,sha256=KIZNwdsMGXYy9i4FHSe0XbbCjjVJzTTlnryGesxM-GI,19312
4
+ md2conf/application.py,sha256=Udp79iB0bGc7sPmE3jD7PSK35yedS_XBhfTEVap91-o,8777
5
+ md2conf/converter.py,sha256=BlS51hjiJd0lgrh5wJkun1_FZ9kAtmInKjEYhr5YOLA,36620
6
+ md2conf/emoji.py,sha256=IZeguWqcboeOyJkGLTVONDMO4ZXfYXPgfkp56PTI-hE,1924
7
+ md2conf/entities.dtd,sha256=M6NzqL5N7dPs_eUA_6sDsiSLzDaAacrx9LdttiufvYU,30215
8
+ md2conf/matcher.py,sha256=FgMFPvGiOqGezCs8OyerfsVo-iIHFoI6LRMzdcjM5UY,3693
9
+ md2conf/mermaid.py,sha256=82NGv6x_LNrN3c-VPx368KCBO87_Sv8-uz2ue40DzKg,2192
10
+ md2conf/processor.py,sha256=G-MIh1jGq9jjgogHnlnRUSrNgiV6_xO6Fy7ct9alqgM,4769
11
+ md2conf/properties.py,sha256=HqFveB-Wgg29e60tARHSk21l8b-SCk953eb_Mw-nI80,1984
12
+ md2conf/puppeteer-config.json,sha256=-dMTAN_7kNTGbDlfXzApl0KJpAWna9YKZdwMKbpOb60,159
13
+ md2conf/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ md2conf/util.py,sha256=Ct7T21oI2AUs6hIZVNljPhq5HbNscjnFXMpVCzRlRHw,743
15
+ markdown_to_confluence-0.3.0.dist-info/LICENSE,sha256=Pv43so2bPfmKhmsrmXFyAvS7M30-1i1tzjz6-dfhyOo,1077
16
+ markdown_to_confluence-0.3.0.dist-info/METADATA,sha256=oAWMGSnPXtLZZyDiwNdbb4QWwEP0uXPxzKiBqY9mfT0,14936
17
+ markdown_to_confluence-0.3.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
+ markdown_to_confluence-0.3.0.dist-info/entry_points.txt,sha256=F1zxa1wtEObtbHS-qp46330WVFLHdMnV2wQ-ZorRmX0,50
19
+ markdown_to_confluence-0.3.0.dist-info/top_level.txt,sha256=_FJfl_kHrHNidyjUOuS01ngu_jDsfc-ZjSocNRJnTzU,8
20
+ markdown_to_confluence-0.3.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
21
+ markdown_to_confluence-0.3.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
md2conf/__init__.py CHANGED
@@ -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.6"
8
+ __version__ = "0.3.0"
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"
md2conf/__main__.py CHANGED
@@ -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
  """
@@ -41,6 +41,8 @@ class Arguments(argparse.Namespace):
41
41
  generated_by: Optional[str]
42
42
  render_mermaid: bool
43
43
  diagram_output_format: Literal["png", "svg"]
44
+ local: bool
45
+ headers: dict[str, str]
44
46
  webui_links: bool
45
47
 
46
48
 
@@ -169,14 +171,12 @@ def main() -> None:
169
171
  "--webui-links",
170
172
  action="store_true",
171
173
  default=False,
172
- help="Enable Confluence Web UI links.",
174
+ help="Enable Confluence Web UI links. (Typically required for on-prem versions of Confluence.)",
173
175
  )
174
176
 
175
177
  args = Arguments()
176
178
  parser.parse_args(namespace=args)
177
179
 
178
- # NOTE: If we switch to modern type aware CLI tool like typer
179
- # the following line won't be necessary
180
180
  args.mdpath = Path(args.mdpath)
181
181
 
182
182
  logging.basicConfig(