markdown-to-confluence 0.1.12__py3-none-any.whl → 0.1.13__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,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022-2024 Levente Hunyadi
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022-2024 Levente Hunyadi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,168 +1,168 @@
1
- Metadata-Version: 2.1
2
- Name: markdown-to-confluence
3
- Version: 0.1.12
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.2
25
- Requires-Dist: types-lxml >=2024.4.14
26
- Requires-Dist: markdown >=3.6
27
- Requires-Dist: types-markdown >=3.6
28
- Requires-Dist: pymdown-extensions >=10.8
29
- Requires-Dist: requests >=2.32
30
- Requires-Dist: types-requests >=2.32
31
-
32
- # Publish Markdown files to Confluence wiki
33
-
34
- 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.
35
-
36
- Replicating documentation to Confluence by hand is tedious, and a lack of automated synchronization with the project repositories where the documents live leads to outdated documentation.
37
-
38
- This Python package
39
-
40
- * parses Markdown files,
41
- * converts Markdown content into the Confluence Storage Format (XHTML),
42
- * invokes Confluence API endpoints to upload images and content.
43
-
44
- ## Features
45
-
46
- * Sections and subsections
47
- * Text with **bold**, *italic*, `monospace`, <ins>underline</ins> and ~~strikethrough~~
48
- * Link to [external locations](http://example.com/)
49
- * Ordered and unordered lists
50
- * Code blocks (e.g. Python, JSON, XML)
51
- * Image references (uploaded as Confluence page attachments)
52
- * [Table of Contents](https://docs.gitlab.com/ee/user/markdown.html#table-of-contents)
53
- * [Admonitions](https://python-markdown.github.io/extensions/admonition/) (converted into *info*, *tip*, *note* and *warning* Confluence panels)
54
-
55
- ## Getting started
56
-
57
- In order to get started, you will need
58
-
59
- * your organization domain name (e.g. `instructure.atlassian.net`),
60
- * base path for Confluence wiki (typically `/wiki/` for managed Confluence, `/` for on-premise)
61
- * your Confluence username (e.g. `levente.hunyadi@instructure.com`) (only if required by your deployment),
62
- * a Confluence API token (a string of alphanumeric characters), and
63
- * the space key in Confluence (e.g. `DAP`) you are publishing content to.
64
-
65
- ### Obtaining an API token
66
-
67
- 1. Log in to <https://id.atlassian.com/manage/api-tokens>.
68
- 2. Click *Create API token*.
69
- 3. From the dialog that appears, enter a memorable and concise *Label* for your token and click *Create*.
70
- 4. Click *Copy to clipboard*, then paste the token to your script, or elsewhere to save.
71
-
72
- ### Setting up the environment
73
-
74
- Confluence organization domain, base path, username, API token and space key can be specified at runtime or set as Confluence environment variables (e.g. add to your `~/.profile` on Linux, or `~/.bash_profile` or `~/.zshenv` on MacOS):
75
-
76
- ```bash
77
- export CONFLUENCE_DOMAIN='instructure.atlassian.net'
78
- export CONFLUENCE_PATH='/wiki/'
79
- export CONFLUENCE_USER_NAME='levente.hunyadi@instructure.com'
80
- export CONFLUENCE_API_KEY='0123456789abcdef'
81
- export CONFLUENCE_SPACE_KEY='DAP'
82
- ```
83
-
84
- On Windows, these can be set via system properties.
85
-
86
- ### Permissions
87
-
88
- The tool requires appropriate permissions in Confluence in order to invoke endpoints.
89
-
90
- If a Confluence username is set, the tool uses HTTP *Basic* authentication to pass the username and the API key to Confluence REST API endpoints. If no username is provided, the tool authenticates with HTTP *Bearer*, and passes the API key as the bearer token.
91
-
92
- If you lack appropriate permissions, you will get an *Unauthorized* response from Confluence. The tool will emit a message that looks as follows:
93
-
94
- ```
95
- 2023-06-30 23:59:59,000 - ERROR - <module> [80] - 401 Client Error: Unauthorized for url: ...
96
- ```
97
-
98
- ### Associating a Markdown file with a wiki page
99
-
100
- Each Markdown file is associated with a Confluence wiki page with a Markdown comment:
101
-
102
- ```markdown
103
- <!-- confluence-page-id: 85668266616 -->
104
- ```
105
-
106
- The above tells the tool to synchronize the Markdown file with the given Confluence page ID. This implies that the Confluence wiki page must exist such that it has an ID. The comment can be placed anywhere in the source file.
107
-
108
- ### Setting the Confluence space
109
-
110
- If you work in an environment where there are multiple Confluence spaces, and some Markdown pages may go into one space, whereas other pages may go into another, you can set the target space on a per-document basis:
111
-
112
- ```markdown
113
- <!-- confluence-space-key: DAP -->
114
- ```
115
-
116
- This overrides the default space set via command-line arguments or environment variables.
117
-
118
- ### Setting generated-by prompt text for wiki pages
119
-
120
- In order to ensure readers are not editing a generated document, the tool adds a warning message at the top of the Confluence page as an *info panel*. You can customize the text that appears. The text can contain markup as per the [Confluence Storage Format](https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html), and is emitted directly into the *info panel* macro.
121
-
122
- Provide generated-by prompt text in the Markdown file with a tag:
123
-
124
- ```markdown
125
- <!-- generated-by: Do not edit! Check out the <a href="https://example.com/project">original source</a>. -->
126
- ```
127
-
128
- Alternatively, use the `--generated-by GENERATED_BY` option. The tag takes precedence.
129
-
130
- ### Running the tool
131
-
132
- You execute the command-line tool `md2conf` to synchronize the Markdown file with Confluence:
133
-
134
- ```console
135
- $ python3 -m md2conf sample/example.md
136
- ```
137
-
138
- Use the `--help` switch to get a full list of supported command-line options:
139
-
140
- ```console
141
- $ python3 -m md2conf --help
142
- usage: md2conf [-h] [-d DOMAIN] [-p PATH] [-u USERNAME] [-a APIKEY] [-s SPACE] [-l {debug,info,warning,error,critical}] [-r ROOT_PAGE] [--generated-by GENERATED_BY]
143
- [--no-generated-by] [--ignore-invalid-url] [--local]
144
- mdpath
145
-
146
- positional arguments:
147
- mdpath Path to Markdown file or directory to convert and publish.
148
-
149
- optional arguments:
150
- -h, --help show this help message and exit
151
- -d DOMAIN, --domain DOMAIN
152
- Confluence organization domain.
153
- -p PATH, --path PATH Base path for Confluence (default: '/wiki/').
154
- -u USERNAME, --username USERNAME
155
- Confluence user name.
156
- -a APIKEY, --apikey APIKEY
157
- Confluence API key. Refer to documentation how to obtain one.
158
- -s SPACE, --space SPACE
159
- Confluence space key for pages to be published. If omitted, will default to user space.
160
- -l {debug,info,warning,error,critical}, --loglevel {debug,info,warning,error,critical}
161
- Use this option to set the log verbosity.
162
- -r ROOT_PAGE Root Confluence page to create new pages. If omitted, will raise exception when creating new pages.
163
- --generated-by GENERATED_BY
164
- Add prompt to pages (default: 'This page has been generated with a tool.').
165
- --no-generated-by Do not add 'generated by a tool' prompt to pages.
166
- --ignore-invalid-url Emit a warning but otherwise ignore relative URLs that point to ill-specified locations.
167
- --local Write XHTML-based Confluence Storage Format files locally without invoking Confluence API.
168
- ```
1
+ Metadata-Version: 2.1
2
+ Name: markdown-to-confluence
3
+ Version: 0.1.13
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.8.7
26
+ Requires-Dist: markdown>=3.6
27
+ Requires-Dist: types-markdown>=3.6
28
+ Requires-Dist: pymdown-extensions>=10.9
29
+ Requires-Dist: requests>=2.32
30
+ Requires-Dist: types-requests>=2.32
31
+
32
+ # Publish Markdown files to Confluence wiki
33
+
34
+ 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.
35
+
36
+ Replicating documentation to Confluence by hand is tedious, and a lack of automated synchronization with the project repositories where the documents live leads to outdated documentation.
37
+
38
+ This Python package
39
+
40
+ * parses Markdown files,
41
+ * converts Markdown content into the Confluence Storage Format (XHTML),
42
+ * invokes Confluence API endpoints to upload images and content.
43
+
44
+ ## Features
45
+
46
+ * Sections and subsections
47
+ * Text with **bold**, *italic*, `monospace`, <ins>underline</ins> and ~~strikethrough~~
48
+ * Link to [external locations](http://example.com/)
49
+ * Ordered and unordered lists
50
+ * Code blocks (e.g. Python, JSON, XML)
51
+ * Image references (uploaded as Confluence page attachments)
52
+ * [Table of Contents](https://docs.gitlab.com/ee/user/markdown.html#table-of-contents)
53
+ * [Admonitions](https://python-markdown.github.io/extensions/admonition/) (converted into *info*, *tip*, *note* and *warning* Confluence panels)
54
+
55
+ ## Getting started
56
+
57
+ In order to get started, you will need
58
+
59
+ * your organization domain name (e.g. `instructure.atlassian.net`),
60
+ * base path for Confluence wiki (typically `/wiki/` for managed Confluence, `/` for on-premise)
61
+ * your Confluence username (e.g. `levente.hunyadi@instructure.com`) (only if required by your deployment),
62
+ * a Confluence API token (a string of alphanumeric characters), and
63
+ * the space key in Confluence (e.g. `DAP`) you are publishing content to.
64
+
65
+ ### Obtaining an API token
66
+
67
+ 1. Log in to <https://id.atlassian.com/manage/api-tokens>.
68
+ 2. Click *Create API token*.
69
+ 3. From the dialog that appears, enter a memorable and concise *Label* for your token and click *Create*.
70
+ 4. Click *Copy to clipboard*, then paste the token to your script, or elsewhere to save.
71
+
72
+ ### Setting up the environment
73
+
74
+ Confluence organization domain, base path, username, API token and space key can be specified at runtime or set as Confluence environment variables (e.g. add to your `~/.profile` on Linux, or `~/.bash_profile` or `~/.zshenv` on MacOS):
75
+
76
+ ```bash
77
+ export CONFLUENCE_DOMAIN='instructure.atlassian.net'
78
+ export CONFLUENCE_PATH='/wiki/'
79
+ export CONFLUENCE_USER_NAME='levente.hunyadi@instructure.com'
80
+ export CONFLUENCE_API_KEY='0123456789abcdef'
81
+ export CONFLUENCE_SPACE_KEY='DAP'
82
+ ```
83
+
84
+ On Windows, these can be set via system properties.
85
+
86
+ ### Permissions
87
+
88
+ The tool requires appropriate permissions in Confluence in order to invoke endpoints.
89
+
90
+ If a Confluence username is set, the tool uses HTTP *Basic* authentication to pass the username and the API key to Confluence REST API endpoints. If no username is provided, the tool authenticates with HTTP *Bearer*, and passes the API key as the bearer token.
91
+
92
+ If you lack appropriate permissions, you will get an *Unauthorized* response from Confluence. The tool will emit a message that looks as follows:
93
+
94
+ ```
95
+ 2023-06-30 23:59:59,000 - ERROR - <module> [80] - 401 Client Error: Unauthorized for url: ...
96
+ ```
97
+
98
+ ### Associating a Markdown file with a wiki page
99
+
100
+ Each Markdown file is associated with a Confluence wiki page with a Markdown comment:
101
+
102
+ ```markdown
103
+ <!-- confluence-page-id: 85668266616 -->
104
+ ```
105
+
106
+ The above tells the tool to synchronize the Markdown file with the given Confluence page ID. This implies that the Confluence wiki page must exist such that it has an ID. The comment can be placed anywhere in the source file.
107
+
108
+ ### Setting the Confluence space
109
+
110
+ If you work in an environment where there are multiple Confluence spaces, and some Markdown pages may go into one space, whereas other pages may go into another, you can set the target space on a per-document basis:
111
+
112
+ ```markdown
113
+ <!-- confluence-space-key: DAP -->
114
+ ```
115
+
116
+ This overrides the default space set via command-line arguments or environment variables.
117
+
118
+ ### Setting generated-by prompt text for wiki pages
119
+
120
+ In order to ensure readers are not editing a generated document, the tool adds a warning message at the top of the Confluence page as an *info panel*. You can customize the text that appears. The text can contain markup as per the [Confluence Storage Format](https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html), and is emitted directly into the *info panel* macro.
121
+
122
+ Provide generated-by prompt text in the Markdown file with a tag:
123
+
124
+ ```markdown
125
+ <!-- generated-by: Do not edit! Check out the <a href="https://example.com/project">original source</a>. -->
126
+ ```
127
+
128
+ Alternatively, use the `--generated-by GENERATED_BY` option. The tag takes precedence.
129
+
130
+ ### Running the tool
131
+
132
+ You execute the command-line tool `md2conf` to synchronize the Markdown file with Confluence:
133
+
134
+ ```console
135
+ $ python3 -m md2conf sample/example.md
136
+ ```
137
+
138
+ Use the `--help` switch to get a full list of supported command-line options:
139
+
140
+ ```console
141
+ $ python3 -m md2conf --help
142
+ usage: md2conf [-h] [-d DOMAIN] [-p PATH] [-u USERNAME] [-a APIKEY] [-s SPACE] [-l {debug,info,warning,error,critical}] [-r ROOT_PAGE] [--generated-by GENERATED_BY]
143
+ [--no-generated-by] [--ignore-invalid-url] [--local]
144
+ mdpath
145
+
146
+ positional arguments:
147
+ mdpath Path to Markdown file or directory to convert and publish.
148
+
149
+ optional arguments:
150
+ -h, --help show this help message and exit
151
+ -d DOMAIN, --domain DOMAIN
152
+ Confluence organization domain.
153
+ -p PATH, --path PATH Base path for Confluence (default: '/wiki/').
154
+ -u USERNAME, --username USERNAME
155
+ Confluence user name.
156
+ -a APIKEY, --apikey APIKEY
157
+ Confluence API key. Refer to documentation how to obtain one.
158
+ -s SPACE, --space SPACE
159
+ Confluence space key for pages to be published. If omitted, will default to user space.
160
+ -l {debug,info,warning,error,critical}, --loglevel {debug,info,warning,error,critical}
161
+ Use this option to set the log verbosity.
162
+ -r ROOT_PAGE Root Confluence page to create new pages. If omitted, will raise exception when creating new pages.
163
+ --generated-by GENERATED_BY
164
+ Add prompt to pages (default: 'This page has been generated with a tool.').
165
+ --no-generated-by Do not add 'generated by a tool' prompt to pages.
166
+ --ignore-invalid-url Emit a warning but otherwise ignore relative URLs that point to ill-specified locations.
167
+ --local Write XHTML-based Confluence Storage Format files locally without invoking Confluence API.
168
+ ```
@@ -0,0 +1,16 @@
1
+ md2conf/__init__.py,sha256=yAKxptdEAiSXE55X3TxhUYa2iMkbW9fo1CWVRX8FNUY,416
2
+ md2conf/__main__.py,sha256=-ZztZII6QYeuukxlOkVm8Mh9M1_ksA-5I2e2o5mvKLI,4353
3
+ md2conf/api.py,sha256=ghLdaQtltRJ2-SUjhOZNkohL-RJ0Y1h6SfT7RiLPPZM,15231
4
+ md2conf/application.py,sha256=BuIWLWrU8yaMbQhK0n3SUEPjxc7XJ0RIUdE3ALw9umE,5411
5
+ md2conf/converter.py,sha256=_wfhDG-8Q3iAtR28Hp_ja-jyRMeb4HOvjCBsg1YMSZM,18926
6
+ md2conf/entities.dtd,sha256=6and_fCiCHKhC7XXX0Fs-AaC0k_YN6csRQ7RiqbwyuM,30752
7
+ md2conf/processor.py,sha256=TRsDbrNswNUjkdP7vXEUPYZvC07P6QN92ddwTGXVljg,3175
8
+ md2conf/properties.py,sha256=zjtOQ73gQa5clPC6Ep4WHVjYIjTwPfrAtGDK7CUqbyc,1863
9
+ md2conf/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ markdown_to_confluence-0.1.13.dist-info/LICENSE,sha256=d0Kt_fnS_LlDYrLPPI5xUSDGXRWRZNv81uKvmHa3lZM,1098
11
+ markdown_to_confluence-0.1.13.dist-info/METADATA,sha256=NcsPNl4S4PsKF_lM8tbxNbOjdpf1Be3OFec9AmdJrSs,8035
12
+ markdown_to_confluence-0.1.13.dist-info/WHEEL,sha256=nCVcAvsfA9TDtwGwhYaRrlPhTLV9m-Ga6mdyDtuwK18,91
13
+ markdown_to_confluence-0.1.13.dist-info/entry_points.txt,sha256=F1zxa1wtEObtbHS-qp46330WVFLHdMnV2wQ-ZorRmX0,50
14
+ markdown_to_confluence-0.1.13.dist-info/top_level.txt,sha256=_FJfl_kHrHNidyjUOuS01ngu_jDsfc-ZjSocNRJnTzU,8
15
+ markdown_to_confluence-0.1.13.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
16
+ markdown_to_confluence-0.1.13.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.0)
2
+ Generator: setuptools (73.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
md2conf/__init__.py CHANGED
@@ -1,13 +1,13 @@
1
- """
2
- Publish Markdown files to Confluence wiki.
3
-
4
- Parses Markdown files, converts Markdown content into the Confluence Storage Format (XHTML), and invokes
5
- Confluence API endpoints to upload images and content.
6
- """
7
-
8
- __version__ = "0.1.12"
9
- __author__ = "Levente Hunyadi"
10
- __copyright__ = "Copyright 2022-2024, Levente Hunyadi"
11
- __license__ = "MIT"
12
- __maintainer__ = "Levente Hunyadi"
13
- __status__ = "Production"
1
+ """
2
+ Publish Markdown files to Confluence wiki.
3
+
4
+ Parses Markdown files, converts Markdown content into the Confluence Storage Format (XHTML), and invokes
5
+ Confluence API endpoints to upload images and content.
6
+ """
7
+
8
+ __version__ = "0.1.13"
9
+ __author__ = "Levente Hunyadi"
10
+ __copyright__ = "Copyright 2022-2024, Levente Hunyadi"
11
+ __license__ = "MIT"
12
+ __maintainer__ = "Levente Hunyadi"
13
+ __status__ = "Production"