Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Push sphinx docs to confluence using sphinxcontrib-confluencebuilder

Achraf Daabek
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 8, 2024

Hello Team,

Im trying sense two days to push my documentation that i create in my project to a space in my confuence space using this conf.py : 

# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:

# -- Project information -----------------------------------------------------
import os
import sys

project = 'mcview_microservices'
copyright = '2024, ACD'
author = 'ACD'
release = 'v1.0'

# -- General configuration ---------------------------------------------------

# extensions = ['sphinxcontrib.confluencebuilder']

# confluencebuilder_config = {
#     'username': os.environ.get('CONFLUENCE_USERNAME', 'default_username'),
#     'password': os.environ.get('CONFLUENCE_PASSWORD', 'default_password'),
#     'space_key': 'DLD',
#     'title_template': '{project}: {docname}',
#     'page_type': 'contentPage',
#     'default_format': 'storage'
# }

extensions = [
    'sphinxcontrib.confluencebuilder',
]
confluence_publish = True
confluence_space_key = 'DLD'
confluence_parent_page = 'Documentation'
confluence_server_url = 'https://mcsim.atlassian.net/wiki/'
confluence_server_user = os.environ.get('CONFLUENCE_USERNAME', 'default_username')
# confluence_server_pass  = os.environ.get('CONFLUENCE_PASSWORD', 'default_password')
confluence_ask_password = True
confluence_publish_token  = os.environ.get('CONFLUENCE_TOKEN', 'default_password')
confluence_publish_dryrun = True

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------

html_theme = 'alabaster'
html_static_path = ['_static']
and in my index.rst i have juste one simple txt : 
**Sphinx Confluence Builder Example**

This is an example of Sphinx documentation that can be published to Confluence using the Sphinx Confluence Builder extension.
The problem is when i run the command #sphinx-build -b confluence . _build/confluence -E -a 
It create a index.conf and not html inside the _build/confluence  and and also it giev this error and i odn't know how to make it : 

sphinxcontrib.confluencebuilder error:

---
Unable to authenticate with Confluence

Unable to authenticate with the Confluence instance. Ensure the
configured username and password are correct. If credentials appear to
be correct, the user may need to be unlocked be re-logging in with above
browser or asking an administrator of the Confluence instance for help.

(code: 401)
---

1 answer

0 votes
Achraf Daabek
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 9, 2024

we need just to change this confluence_publish_token with 

confluence_server_pass 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events