Markdown to Confluence - upload any .md files to your Confluence cloud page
Project description
confluence.md
Push markdown files straight to a Confluence page.
What it does?
confluence.md
allows you to push any markdown file to Confluence. You can create
a new page (under given parent) or update an existing one.
How to install?
It's as easy as:
$ pip install confluence.md
# If the above doesn't work, your `pip` command points to different
# python than installation than `python` command. If so, run:
$ python -m pip install confluence.md
How to use it in command-line?
Markdown to Confluence
Example workflow:
1. Create page
Create a new page under --parent_id
:
$ confluence.md --user user@name.net \ # Atlassian username
--token 9a8dsadsh \ # API token or --password
--url https://your-domain.atlassian.net \ # Confluence instance URL
create \ # create or update
--file README.md \ # markdown file
--parent_id 182371 \ # parent page
--title "new title" # title for a new page
--add_meta # adds meta to source.md file
2. Verify markdown
The page is created and the file is decorated with metadata:
$ head -n 3 markdown.md
---
confluence-url: https://your-domain.atlassian.net/wiki/spaces/SP/pages/18237182/new+title
---
3. Update page
Performing an update does not require providing --page_id
and --url
:
$ confluence.md --user user@name.net --token 9a8dsadsh update --file README.md
Doing an update with --page_id
and --url
is still possible.
Consider adding useful --add_info
option.
To create Atlassian API Token go to api-tokens.
Command line arguments
Actions:
update
Updates page content based on givenpage_id
or metadata in Markdown filecreate
Creates new page under givenparent_id
positional arguments:
{update,create}
Action to run
optional arguments:
-h
,--help
show this help message and exit--file FILE
input markdown file to process--add_meta
adds metadata to .md file for easy editing--add_info
adds info panel automatic content do not edit on top of the page--add_label
ADD_LABEL
adds label to page--convert_jira
convert all Jira links to issue snippets (either short [KEY-ID] format or full URL) note: this options works only in Cloud instances with Secure Markdown installed-v
,--verbose
verbose mode-q
,--quiet
quiet mode
required auth parameters:
-u
USER
,--user
USER
Atlassian username/email-t
TOKEN
,--token
TOKEN
Atlassian API token-p
PWD
,--password
PWD
Atlassian password (used in on-prem instances)-l
URL
,--url
URL
Atlassian instance URL-n
,--no_verify_ssl
don't verify SSL cert (useful in on-prem instances)
create page parameters:
--parent_id
PARENT_ID
define parent page id while creating a new page--title
TITLE
define page title while creating a new page--overwrite
force overwrite if page with this title already exists
update page arguments:
--page_id
PAGE_ID
define (or override) page id while updating a page
How to use it in a Python script?
ConfluenceMD wasn't designed to be used this way, but it's fairly simple to embed it in a Python script. See this example:
from md2cf.utils.confluencemd import ConfluenceMD
conf_md = ConfluenceMD(username=user,
md_file=md_file,
token=token,
url=url,
convert_jira=convert_jira)
# create new page under parent_id
new_page_id = conf_md.create_new("parent_id", "title")
# update existing page with given page_id
page_id = conf_md.update_existing("page_id")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file confluence_md-0.4.8.tar.gz
.
File metadata
- Download URL: confluence_md-0.4.8.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96f709c0667003fa9f0d5969b8edab47b171bb45612b5a27e7e64d9ed24af9fa |
|
MD5 | 342e500c68abb87fb498df06f89ba166 |
|
BLAKE2b-256 | 060dab172c52d34f0bb7215d83ddebdbf93eb7d26a5147eb97b93a34940cb088 |
File details
Details for the file confluence.md-0.4.8-py3-none-any.whl
.
File metadata
- Download URL: confluence.md-0.4.8-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1a728ef49c4e3b5bccc30dd6cdc0ef1a515be34119b6869420694755755664a |
|
MD5 | 6e1bbb65bcda2c6d57a0640d091e0c6d |
|
BLAKE2b-256 | 9772e50059966e65ec779abbd05b183d28071f6614752529f12c77cbb20c07a5 |