markdown-to-confluence 0.2.7__py3-none-any.whl → 0.3.1__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.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
@@ -0,0 +1,20 @@
1
+ md2conf/__init__.py,sha256=AtPkcrgEezF8jnJ14ALB3VdF6UAWPR9EPSYtoi6y5Nc,402
2
+ md2conf/__main__.py,sha256=ypjV_5mE0smlIRBFrpikgzXq18as2hY43HJxMLpzGp4,7145
3
+ md2conf/api.py,sha256=uwIR_wBSQqvZ9XZ2m2009Hf8B5w7T5PUXJ88BU8CJmA,19520
4
+ md2conf/application.py,sha256=5K-nCPHJZfIahjubrLtXTwI-zsTiD140fdYXDnh3GSk,9161
5
+ md2conf/converter.py,sha256=MoGbXqh5rE4qkdxxY8RHcnoZ5mz0aEuFz9nmUnt0WdM,36397
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=Alzkv0BY-lju4ojtBdW2qtCLZ59MO9kaS2RpQO6Kyfk,2304
10
+ md2conf/processor.py,sha256=G-MIh1jGq9jjgogHnlnRUSrNgiV6_xO6Fy7ct9alqgM,4769
11
+ md2conf/properties.py,sha256=WaVVOYSck7drVQfcBJmBMa7Mb0KVOZl9UZHvLS1Du8U,1892
12
+ md2conf/puppeteer-config.json,sha256=-dMTAN_7kNTGbDlfXzApl0KJpAWna9YKZdwMKbpOb60,159
13
+ md2conf/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ markdown_to_confluence-0.3.1.dist-info/LICENSE,sha256=Pv43so2bPfmKhmsrmXFyAvS7M30-1i1tzjz6-dfhyOo,1077
15
+ markdown_to_confluence-0.3.1.dist-info/METADATA,sha256=pTnAvuTg_rgETAUZbsN_5HYbOwXE7qVpDGvhaXMwB2Y,14936
16
+ markdown_to_confluence-0.3.1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
17
+ markdown_to_confluence-0.3.1.dist-info/entry_points.txt,sha256=F1zxa1wtEObtbHS-qp46330WVFLHdMnV2wQ-ZorRmX0,50
18
+ markdown_to_confluence-0.3.1.dist-info/top_level.txt,sha256=_FJfl_kHrHNidyjUOuS01ngu_jDsfc-ZjSocNRJnTzU,8
19
+ markdown_to_confluence-0.3.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
20
+ markdown_to_confluence-0.3.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.8.2)
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.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"
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
  """
@@ -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,