md2confluence 1.1.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.
@@ -0,0 +1,216 @@
1
+ Metadata-Version: 2.4
2
+ Name: md2confluence
3
+ Version: 1.1.1
4
+ Summary: Sync Markdown documentation to Confluence Cloud
5
+ License: MIT
6
+ Project-URL: Repository, https://pypi.org/project/md2confluence/
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: requests>=2.32.0
11
+ Dynamic: license-file
12
+
13
+ # md2confluence
14
+
15
+ <p align="center">
16
+ <img src="img/MD2C.png" alt="md2confluence" width="400">
17
+ </p>
18
+
19
+ [![Python](https://img.shields.io/badge/Python-3.9+-blue?style=flat-square&logo=python)](https://www.python.org/)
20
+ [![PyPI](https://img.shields.io/pypi/v/md2confluence?style=flat-square&logo=pypi)](https://pypi.org/project/md2confluence/)
21
+ [![Version](https://img.shields.io/badge/version-1.1.1-green?style=flat-square)](https://pypi.org/project/md2confluence/)
22
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
23
+
24
+ A Python tool to sync Markdown documentation to Confluence Cloud.
25
+
26
+ ## Features
27
+
28
+ - **Markdown to Confluence conversion** - Headers, lists, tables, code blocks, info panels, task lists, and more
29
+ - **Front-matter support** - Per-document settings via YAML/JSON front-matter
30
+ - **Emoji shortcodes** - `:smile:` → 😄, `:rocket:` → 🚀
31
+ - **Subscript/superscript** - `H~2~O` → H₂O, `x^2^` → x²
32
+ - **Page labels** - Set Confluence labels via front-matter tags
33
+ - **Image handling** - Automatically uploads local images as attachments
34
+ - **Local output mode** - Generate Confluence Storage Format files without API calls
35
+ - **Config-driven** - Define document mappings in a simple config file
36
+ - **Dry-run mode** - Preview changes before syncing
37
+ - **Retry logic** - Exponential backoff for transient failures
38
+ - **Rate limiting** - Avoid API throttling
39
+
40
+ ## Installation
41
+
42
+ ```bash
43
+ # From PyPI (recommended)
44
+ pip install md2confluence
45
+
46
+ # For development
47
+ git clone <repository-url>
48
+ cd md2confluence
49
+ pip install -e .
50
+ ```
51
+
52
+ ## Dependencies
53
+
54
+ - Python 3.9+
55
+ - `requests` library (installed automatically)
56
+
57
+ ## Quick Start
58
+
59
+ 1. **Create an API token** (see [Authentication](#authentication) below)
60
+
61
+ 2. **Set environment variables:**
62
+
63
+ ```bash
64
+ export CONFLUENCE_API_TOKEN="your-api-token"
65
+ export CONFLUENCE_USER_EMAIL="your-email@example.com"
66
+ ```
67
+
68
+ 3. **Create a config file** (`.confluence-sync.conf`):
69
+
70
+ ```bash
71
+ CONFLUENCE_BASE_URL="https://your-domain.atlassian.net/wiki"
72
+ CONFLUENCE_SPACE_KEY="DOCS"
73
+ CONFLUENCE_TECH_PARENT_ID="123456789"
74
+
75
+ # Document mappings: "Title|path/to/file.md|parent_page_id"
76
+ CONFLUENCE_DOC_README="README|README.md|${CONFLUENCE_TECH_PARENT_ID}"
77
+ ```
78
+
79
+ 4. **Run the sync:**
80
+
81
+ ```bash
82
+ md2confluence
83
+ ```
84
+
85
+ ## Usage
86
+
87
+ ```bash
88
+ # Sync all configured documents
89
+ md2confluence
90
+
91
+ # Dry-run (preview without changes)
92
+ md2confluence --dry-run
93
+
94
+ # List configured documents
95
+ md2confluence --list
96
+
97
+ # Verify config and connectivity
98
+ md2confluence --verify
99
+
100
+ # Sync a single document
101
+ md2confluence --single "Page Title" path/to/doc.md parent_page_id
102
+
103
+ # Convert markdown to Confluence format (stdout)
104
+ echo "# Hello" | md2confluence --stdin
105
+
106
+ # Local output (generate .csf files without API calls)
107
+ md2confluence --local ./output
108
+ ```
109
+
110
+ ## Authentication
111
+
112
+ ### Creating an API Token
113
+
114
+ 1. Go to [Atlassian API Tokens](https://id.atlassian.com/manage-profile/security/api-tokens)
115
+ 2. Click **Create API token**
116
+ 3. Enter a label (e.g., "md2confluence") and click **Create**
117
+ 4. Copy the token immediately (you won't see it again)
118
+
119
+ ### Required Permissions
120
+
121
+ The user account associated with the API token needs:
122
+
123
+ - **Space permissions:**
124
+ - View space
125
+ - Add pages
126
+ - Update pages
127
+ - Add attachments
128
+
129
+ - **Page permissions:**
130
+ - View, Edit on target pages/parent pages
131
+
132
+ For organization-managed accounts, ensure the user has appropriate Confluence access in your Atlassian admin settings.
133
+
134
+ ### Auth Modes
135
+
136
+ | Mode | Variables Required | Use Case |
137
+ | ------ | ------------------------------------------------ | ------------------------------ |
138
+ | Basic | `CONFLUENCE_USER_EMAIL` + `CONFLUENCE_API_TOKEN` | Standard Atlassian Cloud |
139
+ | Bearer | `CONFLUENCE_API_TOKEN` only | OAuth tokens, service accounts |
140
+
141
+ Auth mode is auto-detected based on whether `CONFLUENCE_USER_EMAIL` is set.
142
+
143
+ ## Configuration
144
+
145
+ See `confluence-sync.conf.example` for all available options.
146
+
147
+ ### Document Mappings
148
+
149
+ Define documents to sync using `CONFLUENCE_DOC_*` variables:
150
+
151
+ ```bash
152
+ CONFLUENCE_DOC_MYPAGE="Page Title|path/to/file.md|parent_page_id"
153
+ ```
154
+
155
+ ### Edge Case Handling
156
+
157
+ | Option | Values | Default |
158
+ | ---------------------------------- | ------------------------ | ----------- |
159
+ | `CONFLUENCE_MISSING_FILE_BEHAVIOR` | skip, fail | skip |
160
+ | `CONFLUENCE_IMAGE_FAILURE_BEHAVIOR`| placeholder, skip, fail | placeholder |
161
+ | `CONFLUENCE_TITLE_SPECIAL_CHARS` | sanitize, encode, fail | sanitize |
162
+
163
+ ## Front-Matter
164
+
165
+ Documents can include YAML or JSON front-matter to override settings:
166
+
167
+ ```yaml
168
+ ---
169
+ title: Custom Page Title
170
+ tags: [documentation, api, v2]
171
+ space: DOCS
172
+ parent_id: "123456789"
173
+ add_disclaimer: false
174
+ max_image_width: 600
175
+ synchronized: true
176
+ ---
177
+
178
+ # Document content starts here
179
+ ```
180
+
181
+ ### Supported Front-Matter Fields
182
+
183
+ | Field | Type | Description |
184
+ | ------------------------ | ------- | ------------------------------ |
185
+ | `title` | string | Override page title |
186
+ | `tags` / `labels` | array | Confluence page labels |
187
+ | `space` / `space_key` | string | Target Confluence space |
188
+ | `parent_id` / `parent` | string | Parent page ID |
189
+ | `add_disclaimer` | boolean | Add auto-generated notice |
190
+ | `max_image_width` | integer | Image width constraint (px) |
191
+ | `image_failure_behavior` | string | Override error handling |
192
+ | `title_special_chars` | string | Override title sanitization |
193
+ | `synchronized` / `sync` | boolean | Set `false` to skip document |
194
+
195
+ Front-matter settings take precedence over config file and environment variables.
196
+
197
+ ## Markdown Support
198
+
199
+ - Headers (h1-h6)
200
+ - Bold, italic, strikethrough
201
+ - Subscript (`~text~`) and superscript (`^text^`)
202
+ - Ordered and unordered lists
203
+ - Nested lists
204
+ - Task lists (checkboxes)
205
+ - Tables
206
+ - Fenced code blocks with syntax highlighting
207
+ - Inline code
208
+ - Links (inline and reference-style)
209
+ - Images (uploaded as attachments)
210
+ - Blockquotes → Confluence panels (Note/Warning/Tip/Info)
211
+ - Horizontal rules
212
+ - Emoji shortcodes (`:smile:`, `:rocket:`, `:thumbsup:`, etc.)
213
+
214
+ ## License
215
+
216
+ MIT
@@ -0,0 +1,7 @@
1
+ md2confluence.py,sha256=GRFMjipDVQdvaRFR8O5dRlRNXpDbucJ2q7K3w43ilUI,71263
2
+ md2confluence-1.1.1.dist-info/licenses/LICENSE,sha256=KT0oY-DP5eupdY4_dK2abw4fig4GX4KNtNwx_I1NvvY,1117
3
+ md2confluence-1.1.1.dist-info/METADATA,sha256=WGfwIBVGx7XG4oh703OsamSwz_4k0Rbsz2srzGnJ3Qc,6664
4
+ md2confluence-1.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
5
+ md2confluence-1.1.1.dist-info/entry_points.txt,sha256=PCZ3g9f6QyfiSwW2-YQtP6YRWg3keo--PjhvB6lDa74,53
6
+ md2confluence-1.1.1.dist-info/top_level.txt,sha256=N6pqie-mz5bhsFju6C_sQUa3DZymrMBevSkpDleH1zo,14
7
+ md2confluence-1.1.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ md2confluence = md2confluence:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Cody Lusk <cody.lusk@bibliocommons.com>, BiblioCommons Corp.
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.
@@ -0,0 +1 @@
1
+ md2confluence