A Python library that builds DocC Documentation archive files for Swift Packages, Xcode projects, or XCFrameworks, and uploads internal library documentation to Confluence.
Coleton Gorecke, cgorecke@firstorion.com
This library helps sync the README.md, Changelog.md, and .doccarchive files for internal libraries with their respective page in Confluence.
Python 3.5 or greater
If building documentation for a Swift Package or Framework, you must make sure Apple's DocC library is added as a dependency.
- pathlib: introduced in Python 3.4
- typing: introduced in Python 3.5
- requests: version 2.0.0+
- markdown: version 3.0.0+
- Create an API Key Manage Confluence API Keys
- Determine SpaceID for the space to update via Space Admin.
- Install any dependencies using:
pip install <dependency>
- CD to the directory where the script is located and use:
python3 <repo_file_path> <repo_name>
This library requires some setup from Confluence and should be configured in the ConfluenceUploader/config.py.
# Example: 'https://yoursite.net/wiki/api/v2'
CONFLUENCE_BASE_URL = 'your-base-url'
# Example: 'cgorecke@firstorion.com'
CONFLUENCE_EMAIL = 'your-email'
# Example: 'ATATT....'
CONFLUENCE_API_KEY = 'your-api-key'
# Example: This is the mobile eng space id: '800260186'.
CONFLUENCE_SPACE_KEY = 'confluence-space-key'
# Example: your-base-url/wiki/spaces/Space_name/pages/parent-page-id/Page_Name
CONFLUENCE_PARENT_PAGE_ID = 'parent-page-id'
# Example: your-base-url/wiki/spaces/Space_name/pages/changelog-id/Page_Name
CONFLUENCE_CHANGELOG_PAGE_ID = 'changelog-id'
To build and sync documentation, use the following examples depending on the doc_type
:
In general, you can use the script like so:
python3 DocumentationSync.py doc_type repo_file_path project_name
However, when building a xcodeproj you must also specify the --scheme_name like so:
python3 DocumentationSync.py doc_type repo_file_path project_name --scheme_name MyScheme
This library currently supports building a single DocumentationArchive for either:
- Package
- xcodeproj
- xcframework
python3 DocumentationSync.py Package /path/to/Package.swift MyPackageTarget
python3 DocumentationSync.py xcodeproj /path/to/project.xcodeproj MyProjectTarget --scheme_name MyScheme
python3 DocumentationSync.py xcframework /path/to/project.xcframework MyFrameworkTarget