Handle StoryBoard project groups

StoryBoard now display the project group in the URL and not anymore a
number. Allow setting the storyboard project group to the name now.
This implies setting a new variable to differentiate between Launchpad
and StoryBoard.

Change-Id: Ie6f8c48fffe04256ad07f22e95935f6f7257ea17
This commit is contained in:
Andreas Jaeger 2018-08-23 20:56:55 +02:00
parent f5051b4323
commit 038a8f712d
3 changed files with 26 additions and 5 deletions

View File

@ -51,13 +51,22 @@ Using the theme
``bug_project``
The project name or ID. For launchpad, it's a string like
``python-glanceclient``. If your project uses
``storyboard.openstack.org``, use the project number instead like
``901``. If unspecified, the "Report a bug" links are not shown.
``python-glanceclient``. If unspecified, the "Report a bug"
links are not shown.
If your project uses ``storyboard.openstack.org``, it's a
string like ``openstack-ci`` for the project group.
..note:: Previously StoryBoard showed numbers, and thus you set
this to a project number instead like ``901``. Set this to a
string instead and also use the ``use_storyboard`` variable.
``bug_tag``
Launchpad bug tag. If unspecified, no tag is set. The default is empty.
``use_storyboard``
Set to ``True`` if using StoryBoard.
One example for a project using launchpad::
# openstackdocstheme options
@ -65,11 +74,11 @@ Using the theme
bug_project = 'python-glanceclient'
bug_tag = ''
One example for a project using storyboard::
One example for a project using StoryBoard::
# openstackdocstheme options
repository_name = 'openstack-infra/infra-manual'
bug_project = '721'
bug_project = 'openstack-ci'
bug_tag = ''
#. Remove the options that will be automatically configured by the theme.

View File

@ -110,6 +110,11 @@ def _html_page_context(app, pagename, templatename, context, doctree):
bug_project = app.config.bug_project
if bug_project:
_html_context_data['bug_project'] = bug_project
use_storyboard = app.config.use_storyboard
if bug_project and use_storyboard:
_html_context_data['use_storyboard'] = use_storyboard
# Previously storyboard showed numbers that were used, keep
# for old conf.py files:
if bug_project and bug_project.isdigit():
_html_context_data['use_storyboard'] = True
bug_tag = app.config.bug_tag
@ -262,6 +267,7 @@ def setup(app):
app.add_config_value('bug_project', '', 'env')
app.add_config_value('bug_tag', '', 'env')
app.add_config_value('openstack_projects', [], 'env')
app.add_config_value('use_storyboard', '', 'env')
app.add_html_theme(
'openstackdocs',
os.path.abspath(os.path.dirname(__file__)) + '/theme/openstackdocs',

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Storyboard shows now instead of numbers the name of the project group.
Allow setting this as string. In this case the variable
``use_storyboard`` needs to be set.