From 038a8f712dd8149dc754dd06e471e8e518c3bd52 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Thu, 23 Aug 2018 20:56:55 +0200 Subject: [PATCH] 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 --- doc/source/index.rst | 19 ++++++++++++++----- openstackdocstheme/ext.py | 6 ++++++ .../storyboard-string-643a47e957b64557.yaml | 6 ++++++ 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/storyboard-string-643a47e957b64557.yaml diff --git a/doc/source/index.rst b/doc/source/index.rst index ea9451a..24bcdaf 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -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. diff --git a/openstackdocstheme/ext.py b/openstackdocstheme/ext.py index 58dd015..556ae99 100644 --- a/openstackdocstheme/ext.py +++ b/openstackdocstheme/ext.py @@ -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', diff --git a/releasenotes/notes/storyboard-string-643a47e957b64557.yaml b/releasenotes/notes/storyboard-string-643a47e957b64557.yaml new file mode 100644 index 0000000..101b4f2 --- /dev/null +++ b/releasenotes/notes/storyboard-string-643a47e957b64557.yaml @@ -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.