streams: Confluence API wrapper for pull/publish from emacs/vim/cli
Download the Atlassian Confluence CLI at
https://bobswift.atlassian.net/wiki/download/attachments/16285777/confluence-cli-3.0.0-distribution.zip?api=v2
Unzip it in the streams/ directory so that ${ccli} finds it. Otherwise set ${ccli} accordingly.
The ATLASSIAN_PASSWORD does not have to be set, and you will be prompted for it.
If you using emacs/vim wrappers it’s not required.
Fetch all documents belonging to a project.
To checkout all documents in a project called “Operations” with the short name of “ops”
We simply
mkdir $docroot /ops
streams/streams fetch-all
Once all documents have been checked out, you can then push/pull
vim $docroot /$project /Some File in Confluence
ATLASSIAN_PASSWORD=" t00manys3crets" streams/streams push $docroot /$project /Some File in Confluence
Example of pulling latest
vim $docroot /$project /Some File in Confluence
ATLASSIAN_PASSWORD=" t00manys3crets" streams/streams pull $docroot /$project /Some File in Confluence
Cleaning up the XML to be human editable
When pulling docs from Confluence you may end up with a giant line of xml.
Tidy seems to handle the the xml fine without stripping unknown tags.
An example tidyrc is provided that should be copied to ${HOME}/.tidyrc to use.
tidy $docroot /$project /Some File in Confluence
To add new files to a Confluence Project just create the new file:
vim $docroot /$project /Some new file
ATLASSIAN_PASSWORD=" t00manys3crets" streams/streams push $docroot /$project /Some new file