mkdocs-confluence-plugin 1.27.11__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.
@@ -0,0 +1,413 @@
1
+ Metadata-Version: 2.4
2
+ Name: mkdocs_confluence_plugin
3
+ Version: 1.27.11
4
+ Summary: MkDocs plugin to export to Confluence
5
+ Author-email: Your Name <surjit.bains@gmail.com>
6
+ Requires-Python: >=3.7
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: pytest==8.0.0
9
+ Requires-Dist: pytest-mock==3.12.0
10
+ Requires-Dist: coverage==7.5
11
+ Requires-Dist: requests
12
+ Requires-Dist: pyyaml<7.0,>=6.0
13
+ Requires-Dist: mistune
14
+ Requires-Dist: md2cf
15
+ Requires-Dist: mime
16
+ Requires-Dist: pre-commit
17
+ Requires-Dist: mkdocs
18
+ Requires-Dist: atlassian-python-api
19
+ Requires-Dist: Cython
20
+ Provides-Extra: dev
21
+ Requires-Dist: mkdocs; extra == "dev"
22
+ Requires-Dist: pytest; extra == "dev"
23
+ Requires-Dist: coverage; extra == "dev"
24
+ Requires-Dist: md2cf; extra == "dev"
25
+ Requires-Dist: atlassian-python-api; extra == "dev"
26
+ Requires-Dist: black; extra == "dev"
27
+
28
+ # MkDocs Confluence Plugin
29
+
30
+ **Version:** 1.26.0
31
+ **Python:** >=3.7
32
+
33
+ A MkDocs plugin that automatically publishes your documentation to Confluence, with advanced navigation matching and semantic page resolution.
34
+
35
+ ## Features
36
+
37
+ - **Automatic publishing** - Seamlessly export your MkDocs documentation to Confluence
38
+ - **Navigation matching** - Matching between MkDocs navigation and documentation pages, including:
39
+ - Support for complex nested navigation structures
40
+ - Context-aware matching for pages in subdirectories
41
+ - Semantic matching with abbreviation expansion (e.g., "ADRs" → "Architecture Design Records")
42
+ - Fuzzy matching as fallback for edge cases
43
+ - YAML front matter title recognition
44
+ - **Flexible configuration** - Extensive configuration options for Confluence integration
45
+ - **Dry-run mode** - Test your configuration without publishing
46
+ - **Debug mode** - Detailed logging for troubleshooting
47
+ - **Footer support** - Optional GitHub edit links and auto-generation notices
48
+ - **Folder structure preservation** - Maintains your documentation hierarchy in Confluence
49
+
50
+ ## Installation
51
+
52
+ ### Install from Source
53
+
54
+ ```shell
55
+ pip install .
56
+ ```
57
+
58
+ ### Development Installation
59
+
60
+ For development with optional dependencies:
61
+
62
+ ```shell
63
+ pip install -e ".[dev]"
64
+ ```
65
+
66
+ ### Build from Source
67
+
68
+ Using modern Python build tools:
69
+
70
+ ```shell
71
+ python -m build
72
+ pip install dist/mkdocs_confluence_plugin-*.whl
73
+ ```
74
+
75
+ ### Additional MkDocs Plugins (Optional)
76
+
77
+ Install additional MkDocs plugins as needed for your documentation:
78
+
79
+ ```shell
80
+ # Popular MkDocs plugins for enhanced documentation
81
+ pip install mkdocs-material mkdocs-awesome-nav
82
+ pip install mkdocs-build-plantuml-plugin mkdocs-git-revision-date-localized-plugin
83
+ ```
84
+
85
+ ## Python Requirements
86
+
87
+ - **Python:** >=3.7
88
+ - **Build System:** setuptools>=61, wheel, build
89
+
90
+ ## Dependencies
91
+
92
+ ### Core Dependencies (from pyproject.toml)
93
+ - **mkdocs** - The static site generator this plugin extends
94
+ - **atlassian-python-api** - Confluence API client
95
+ - **md2cf** - Markdown to Confluence markup converter
96
+ - **mistune** - Markdown parser
97
+ - **requests** - HTTP library for API calls
98
+ - **pyyaml==6.0** - YAML parsing library
99
+ - **mime** - MIME type detection
100
+
101
+ ### Testing Dependencies
102
+ - **pytest==8.0.0** - Testing framework
103
+ - **pytest-mock==3.12.0** - Mocking utilities for tests
104
+ - **coverage==7.5** - Code coverage analysis
105
+ - **pre-commit** - Git hook management
106
+
107
+ ### Development Dependencies (Optional)
108
+ Install with: `pip install -e ".[dev]"`
109
+ - **black** - Code formatting
110
+ - **mkdocs** - For local testing
111
+ - **pytest** - Testing framework
112
+ - **coverage** - Coverage reporting
113
+ - **md2cf** - Markdown conversion
114
+ - **atlassian-python-api** - Confluence integration
115
+
116
+ ### Recommended MkDocs Plugins
117
+ These plugins work well with the Confluence plugin but are installed separately:
118
+ - **mkdocs-awesome-nav** - Advanced navigation management with `.nav.yml` files
119
+ - **mkdocs-material** - Modern Material Design theme
120
+ - **mkdocs-build-plantuml-plugin** - PlantUML diagram support
121
+ - **mkdocs-git-revision-date-localized-plugin** - Git-based page timestamps
122
+
123
+ ## Configuration
124
+
125
+ The plugin is automatically registered as a MkDocs plugin via the entry point:
126
+ ```
127
+ confluence = "mkdocs_confluence_plugin.plugin:ConfluencePlugin"
128
+ ```
129
+
130
+ Add the plugin to your `mkdocs.yml` configuration:
131
+
132
+ ```yaml
133
+ plugins:
134
+ - awesome-nav:
135
+ filename: ".nav.yml"
136
+ - confluence:
137
+ host_url: https://your-domain.atlassian.net/wiki/rest/api/content
138
+ space: YOUR_SPACE_KEY
139
+ parent_page_name: 'Documentation Root'
140
+ github_base_url: "https://github.com/your-org/your-repo/blob/main"
141
+ enable_footer: true
142
+ enabled_if_env: MKDOCS_TO_CONFLUENCE
143
+ dryrun: false
144
+ debug: true
145
+ verbose: true
146
+ ```
147
+
148
+ ### Configuration Options
149
+
150
+ | Option | Description | Default | Required |
151
+ |--------|-------------|---------|----------|
152
+ | `host_url` | Confluence API endpoint URL | | ✅ |
153
+ | `space` | Confluence space key | | ✅ |
154
+ | `parent_page_name` | Parent page name in Confluence | | ✅ |
155
+ | `github_base_url` | Base URL for GitHub edit links | | |
156
+ | `enable_footer` | Add footer with edit links | `false` | |
157
+ | `enabled_if_env` | Environment variable to enable plugin | | |
158
+ | `dryrun` | Test mode without publishing | `false` | |
159
+ | `debug` | Enable debug logging | `false` | |
160
+ | `verbose` | Enable verbose output | `false` | |
161
+
162
+ ## Usage
163
+
164
+ ### Basic Usage
165
+
166
+ 1. Configure the plugin in your `mkdocs.yml`
167
+ 2. Set up environment variables for Confluence authentication:
168
+ ```bash
169
+ export CONFLUENCE_USERNAME=your-email@domain.com
170
+ export CONFLUENCE_PASSWORD=your-api-token
171
+ export MKDOCS_TO_CONFLUENCE=1
172
+ ```
173
+ 3. Build and publish your documentation:
174
+ ```bash
175
+ mkdocs build
176
+ ```
177
+
178
+ ### Using with mkdocs-awesome-nav
179
+
180
+ For complex navigation structures, use `mkdocs-awesome-nav` with a `.nav.yml` file:
181
+
182
+ ```yaml
183
+ # docs/.nav.yml
184
+ nav:
185
+ - Index: index.md
186
+
187
+ - Support:
188
+ - support/*.md
189
+ - support/**/*.md
190
+
191
+ - Technical-Practices:
192
+ - Architecture Design Records:
193
+ - technical-practices/architecture_design_records/*.md
194
+ - technical-practices/architecture_design_records/**/*.md
195
+ - Code-Maintainability:
196
+ - technical-practices/code-maintainability/*.md
197
+ - technical-practices/code-maintainability/**/*.md
198
+ - Continuous-Delivery:
199
+ - technical-practices/continuous-delivery/*.md
200
+ - technical-practices/continuous-delivery/**/*.md
201
+ - Monitoring-Observability:
202
+ - technical-practices/monitoring-observability/*.md
203
+ - technical-practices/monitoring-observability/**/*.md
204
+
205
+ - Template Files:
206
+ - template_files/*.md
207
+ - template_files/**/*.md
208
+ ```
209
+
210
+ ### Environment Setup
211
+
212
+ Set up the required environment variables for Confluence authentication and plugin configuration:
213
+
214
+ ```bash
215
+ # Required for Confluence authentication
216
+ export CONFLUENCE_USERNAME="your-email@domain.com"
217
+ export CONFLUENCE_PASSWORD="your-confluence-api-token"
218
+
219
+ # Plugin enablement
220
+ export MKDOCS_TO_CONFLUENCE=1
221
+
222
+ # Optional: Override configuration via environment variables
223
+ export host_url="https://your-domain.atlassian.net/rest/api/content"
224
+ export space_key="YOUR_SPACE_KEY"
225
+ export parent_page_name="Documentation Root"
226
+ export enable_footer="true"
227
+ export dryrun="false"
228
+ export debug="true"
229
+ export verbose="true"
230
+ ```
231
+
232
+ **Required Environment Variables:**
233
+ - `CONFLUENCE_USERNAME` - Your Confluence/Atlassian email
234
+ - `CONFLUENCE_PASSWORD` - Your Confluence API token (not your login password)
235
+ - `MKDOCS_TO_CONFLUENCE` - Set to `1` or `true` to enable the plugin
236
+
237
+ ### Dry Run Mode
238
+
239
+ Test your configuration without publishing to Confluence:
240
+
241
+ ```yaml
242
+ plugins:
243
+ - confluence:
244
+ # ... other config ...
245
+ dryrun: true
246
+ debug: true
247
+ verbose: true
248
+ ```
249
+
250
+ ## Testing
251
+
252
+ ### Run All Tests
253
+
254
+ Tests are configured via pyproject.toml with optimized settings:
255
+
256
+ ```shell
257
+ # Run tests with project settings (maxfail=1, no warnings, quiet)
258
+ python -m pytest tests/
259
+
260
+ # Or run with verbose output
261
+ python -m pytest tests/ -v
262
+ ```
263
+
264
+ **Test Configuration (from pyproject.toml):**
265
+ - Test directory: `tests/`
266
+ - Max failures: 1 (stops after first failure)
267
+ - Warnings disabled for cleaner output
268
+ - Quiet mode by default
269
+
270
+ ### Run Specific Test Categories
271
+
272
+ ```shell
273
+ # Navigation matching tests
274
+ python -m pytest tests/test_navigation_matching.py -v
275
+
276
+ # Similarity and semantic matching tests
277
+ python -m pytest tests/test_similarity.py -v
278
+
279
+ # Title-based matching tests
280
+ python -m pytest tests/test_title_based_matching.py -v
281
+
282
+ # Folder structure tests
283
+ python -m pytest tests/test_folder_titles.py -v
284
+
285
+ # Nested navigation tests
286
+ python -m pytest tests/test_nested_matching.py -v
287
+ ```
288
+
289
+ ### Coverage Report
290
+
291
+ The project is configured for comprehensive coverage reporting with a minimum threshold:
292
+
293
+ ```shell
294
+ # Generate coverage report (configured in pyproject.toml)
295
+ coverage run --source=src -m pytest -vv tests/
296
+ coverage report # Shows missing lines, fails if under 30% coverage
297
+ coverage html # Generate HTML report
298
+ ```
299
+
300
+ **Coverage Settings (from pyproject.toml):**
301
+ - Branch coverage enabled
302
+ - Source directory: `src`
303
+ - Minimum coverage: 30%
304
+ - Shows missing lines in reports
305
+
306
+ ### Debug Scripts
307
+
308
+ The project includes debug scripts for troubleshooting navigation matching:
309
+
310
+ ```shell
311
+ # Debug navigation matching step-by-step
312
+ python debug_step.py
313
+
314
+ # Debug word extraction and similarity
315
+ python debug_words.py
316
+
317
+ # Debug page collection logic
318
+ python debug_collect.py
319
+
320
+ # Debug navigation flattening
321
+ python debug_flatten.py
322
+ ```
323
+
324
+ ## Code Quality
325
+
326
+ ### Code Formatting
327
+
328
+ We use [Black](https://black.readthedocs.io/) for consistent code formatting:
329
+
330
+ ```shell
331
+ black .
332
+ ```
333
+
334
+ ### Linting
335
+
336
+ We use [ruff](https://docs.astral.sh/ruff/) for fast, comprehensive linting:
337
+
338
+ ```shell
339
+ ruff check .
340
+ ```
341
+
342
+ ### Pre-commit Hooks
343
+
344
+ Install pre-commit hooks for automatic code quality checks:
345
+
346
+ ```shell
347
+ pre-commit install
348
+ ```
349
+
350
+ ## Development
351
+
352
+ ### Local Development Setup
353
+
354
+ 1. Clone the repository
355
+ 2. Install the package with development dependencies: `pip install -e ".[dev]"`
356
+ 3. Install additional MkDocs plugins if needed: `pip install mkdocs-material mkdocs-awesome-nav`
357
+ 4. Set up environment variables:
358
+ ```bash
359
+ export CONFLUENCE_USERNAME=your-email@domain.com
360
+ export CONFLUENCE_PASSWORD=your-api-token
361
+ export MKDOCS_TO_CONFLUENCE=1
362
+ ```
363
+ 5. Run tests: `python -m pytest tests/`
364
+
365
+ ### Build System
366
+
367
+ The project uses modern Python packaging with `pyproject.toml`:
368
+
369
+ ```shell
370
+ # Build distribution packages
371
+ python -m build
372
+
373
+ # Install built package
374
+ pip install dist/mkdocs_confluence_plugin-*.whl
375
+ ```
376
+
377
+ **Build Configuration:**
378
+ - Build system: setuptools>=61, wheel, build
379
+ - Package discovery: automatic from `src/` directory
380
+ - Entry point: `confluence = "mkdocs_confluence_plugin.plugin:ConfluencePlugin"`
381
+
382
+ ### Versioning
383
+
384
+ The project uses semantic versioning with automated releases:
385
+ - Version managed in `pyproject.toml`
386
+ - Semantic release configured for automated version bumps
387
+ - Current version: 1.26.0
388
+
389
+ ### Testing Your Changes
390
+
391
+ 1. Run the full test suite: `python -m pytest tests/ -v`
392
+ 2. Test with a real MkDocs build: `mkdocs build -f mkdocs-test.yml`
393
+ 3. Use dry-run mode to test Confluence integration without publishing
394
+
395
+ ### Contributing
396
+
397
+ 1. Ensure all tests pass
398
+ 2. Format code with Black: `black .`
399
+ 3. Check linting with ruff: `ruff check .`
400
+ 4. Add tests for new functionality
401
+ 5. Update documentation as needed
402
+
403
+ ## Architecture
404
+
405
+ The plugin provides sophisticated navigation matching through:
406
+
407
+ - **Semantic word extraction** - Extracts meaningful words from navigation entries and page paths
408
+ - **Abbreviation expansion** - Recognizes and expands common abbreviations (e.g., "ADRs" → "Architecture Design Records")
409
+ - **Context-aware matching** - Uses folder context and parent page information for better matching
410
+ - **Multi-stage matching** - Title-based, semantic, and fuzzy matching with configurable thresholds
411
+ - **Robust error handling** - Graceful degradation and comprehensive logging
412
+
413
+