Push sphinx docs to confluence using sphinxcontrib-confluencebuilder
Asked by Achraf Daabek:

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:  
# <https://www.sphinx-doc.org/en/master/usage/configuration.html>

# -- Project information -----------------------------------------------------  
# <https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information>  
import os  
import sys

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

# -- General configuration ---------------------------------------------------  
# <https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration>

# extensions = \['sphinxcontrib.confluencebuilder'\]

# confluencebuilder_config = {  
# 'url': '<https://mcsim.atlassian.net/wiki/>',  
# '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'\]

<br />

<br />

# -- Options for HTML output -------------------------------------------------  
# <https://www.sphinx-doc.org/en/master/usage/configuration.html#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)  
---


Answers:
author: Achraf Daabek
body: we need just to change this confluence_publish_token with  
confluence_server_pass


Tags: cloud

confluence-cloud