Commit Graph

595 Commits

Author SHA1 Message Date
Zuul 860e6fa0ca Merge "Updated nav links/texts" 2024-02-20 09:51:00 +00:00
Maksim Malchuk 73bb94525d Fix lack of the Yoga version in dropdown list
Since stable/yoga renamed to unmaintained/yoga the version is not
shown in the dropdown list of the available versions on the
https://docs.openstack.org in almost all projects. This change fixes
the issue.

Change-Id: I4f5f1bec04be3152c0f23ac17e450a1fd6fe91d4
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
2024-02-11 22:27:18 +03:00
Stephen Finucane ff0be4578e zuul: Add tips job
Change-Id: I302f468c6f7f18daf1c8d30577642c32e1a77823
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Depends-on: https://review.opendev.org/c/openstack/project-config/+/891679
2023-08-17 11:34:30 +01:00
Stephen Finucane 7e4e2b0c85 Sphinx 7.2.0 updates
Environment.srcdir is now a pathlib.Path object rather than string [1].

[1] https://github.com/sphinx-doc/sphinx/commit/49d8304670

Change-Id: Ifd26e2dd2fa36bbc9b0335db08e698db638de26d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-08-17 11:26:44 +01:00
Zuul f626d829dd Merge "Fix stylesheet setting in theme.conf files" 2023-08-09 18:12:34 +00:00
Dmitry Shachnev 9931511d9c Fix stylesheet setting in theme.conf files
The intention here was probably to include basic.css from Sphinx'
basic theme, but the correct way to reference it is just "basic.css".
This is what sphinx/themes/basic/theme.conf in Sphinx itself does.

Using "css/basic.css" caused the file to be not copied, and the
reference was 404.

Change-Id: Ifd6a78cb2dce42027f404829e1865fdb90acdb4f
2023-08-05 21:11:46 +03:00
Dmitry Shachnev 03e2c9b45e Stop including Sphinx' standard JS files in script_footer.html
Now that we inherit from basic/layout.html, these files are included
automatically in scripts block, so no need to repeat them in footer.

Also, underscore.js is not shipped anymore in Sphinx ≥ 6, so including
it caused a broken reference.

Change-Id: If0ffae7ced13d68380570a7eee949ac6e06c1743
2023-08-05 21:08:42 +03:00
Stephen Finucane b301ee75bf Remove 'type' attribute of <script> element
This is obsolete.

Change-Id: I9fd6771f11297f35a868be00e0abedf449cc4aa2
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 12:22:34 +01:00
Stephen Finucane 88b610f002 Remove invalid attributes
The 'href' attribute is not valid for a <button> element, while the
'aria-labelledby' attribute must point to a valid element. It does not.

While we're here, we also fix indentation.

Change-Id: I3e15062b0f0306fbdc2ef82376a07e2b6943aeda
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 12:19:00 +01:00
Stephen Finucane 7a6d3e8ebc Remove errant character
Erroneously introduced in commit 403c9bca.

Change-Id: I3bb4bf55c4a4f7d220e2d09cdaee146fac5a9da5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 12:14:45 +01:00
Stephen Finucane 65fb860eee Remove nested 'li'
A <li> HTML element "must be contained in a parent element: an ordered
list (<ol>), an unordered list (<ul>), or a menu (<menu>)." [1]

[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li

Change-Id: I9920b63d7dda2051ecfd4865cab4187533f70c07
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 12:13:10 +01:00
Stephen Finucane 9bfd0a43ba Replace ampersand with HTML characters
This is currently invalid HTML.

Change-Id: I5120549758f4e5cd619a0cf8f461996ede3a724d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-09 16:12:00 +01:00
Stephen Finucane 20bf587d68 Only hide top-level duplicated title
In change I48b923a67010c92945c46ab00de0b090ba7cd465, way back in 2016,
we started hiding duplicate titles caused by us including the first h1
title we found at the top of the page. Unfortunately, the fix for this
was to hide *all* h1 titles found in the main docs body. Sphinx doesn't
insist on only a single h1 title (in fact, the sphinx-quickstart tool
produces an index.rst with two h1 titles) which means we were hiding a
lot of information unwittingly. Fix this by only hiding the first title,
as originally intended.

Also replace deprecated whitelist_externals by allowlist_externals
in tox.ini.

Change-Id: Ic8fc5e1256b4ab8925401fe6781210729a68d2aa
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-02-23 21:29:53 +01:00
Jeremy Stanley 11ae49c4fa Update included page footers to use current URLs
The footers haven't been refreshed in a while. Preferred links for
some things have changed, particularly since the foundation's
rename. Some of the old links in here have stopped working entirely.
Brush up everything to be more consistent with what's on the
foundation-maintained www.openstack.org site.

Change-Id: Iadc7642adb5d7e614ac022bd370bf46386a595e0
2022-09-12 13:21:22 +00:00
Zuul dd04d50dcb Merge "Fix broken link for Marketplace in header" 2022-06-03 10:04:35 +00:00
Hervé Beraud 84049acec2 Drop python3.6/3.7 support in testing runtime
In Zed cycle testing runtime, we are targetting to drop the
python 3.6/3.7 support, project started adding python 3.8 as minimum,
example nova:
- 56b5aed08c/setup.cfg (L13)

Also indicates that we support python 3.9.

Change-Id: I55076ba0d27c5725e7bfe1db94758098598133d6
2022-05-05 16:19:19 +02:00
Peter Matulis 5f71db161b Fix broken link for Marketplace in header
The top level MARKETPLACE link in many projects is broken.
It currently shows as: https://www.openstack.orgmarketplace/
This PR adds the missing forward slash.

Change-Id: I9da6ecf8c18546a9314b62b49058399f63de343a
2022-04-22 11:23:25 -04:00
smarcet 91e4870557 Updated nav links/texts
changed links/texts to avoid sending people to the old Summit site

Signed-off-by: smarcet <smarcet@gmail.com>
Change-Id: I4fd61417093a1e452fbe3baf50d523e430e81142
2022-04-11 14:48:56 -03:00
Michael Johnson b270f4aef0 Fix OpenStack project "Search" pages
The OpenStack project documentations pages that implement the "Search"
capability (:ref: 'search') are not working after the recent update to
sphinx 3.4.x. The search will never end and the browser will report a
Uncaught ReferenceError: Stemmer is not defined error.
This patch updates the openstackdocstheme to fix the search capability
by including the language_data.js that now provides the "Stemmer" function.

Closes-Bug: #1957717
Change-Id: If54b3b253ed7585f6f8b20f1e0f945101ef283a3
2022-01-13 00:51:31 +00:00
Zuul b11504f3e7 Merge "Updated Nav Menu" 2022-01-04 16:47:07 +00:00
Artem Goncharov 4c6d655316 Page header fix with Sphinx4
Previous commits addrressed some of the changes of Sphinx4 producting
different structure. The same is valid for the page heading where
instead of `<div class="section">` it produces `<section>`. This leads
to the css fix not to be appled and as such page heading present 2
times. Copy previous css fix with new path.

Change-Id: Ia9ab413280c2f98d041e0f5ae5c1df22c5a4a3f5
2021-06-30 15:43:40 +02:00
Stephen Finucane 08461c5311 Inherit from base "basic" template
Sphinx 4.x changed how it includes some JavaScript files. Instead of
including them via the template, they are now injected using the
'add_js_file' function [1]. This relies on a custom Jinja2 function,
'js_tag' to generate the correct element with necessary attributes set.
Failure to use this results in missing attributes for some tags.

Rather than simply reworking our template to use this new function,
change how we use our 'layout.html' to instead override the 'basic'
template that Sphinx provides. This means we should get these kinds of
changes "for free" in the future, rather than having to worry about
them.

[1] https://github.com/sphinx-doc/sphinx/commit/a957d6f710

Change-Id: Idc0e6c1d38407fdadc29ea710069e74243c5c89a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-05-31 16:45:40 +01:00
Stephen Finucane 9602f39783 sphinx 4.0: Handle HTML 5 changes
Sphinx 4.0 includes a newer version of docutils, which makes some
changes to the HTML 5 writer. Among these is the change in HTML
generated for the 'ObjectDescription' directive, which is used to
generate definition-list style output for things like oslo.config.
Previously, the title of each entry would be styled like so:

  <dt id="DEFAULT.internal_service_availability_zone">
    <code class="sig-name descname">
      <span class="pre">internal_service_availability_zone</span>
    </code>
  </dt>

Now the improper use of the 'code' element is dropped, in favour of a
'span', like so:

  <dt class="sig sig-object oslo.config" id="DEFAULT.internal_service_availability_zone">
    <span class="sig-name descname">
      <span class="pre">internal_service_availability_zone</span>
    </span>
    ...
  </dt>

Change-Id: I9fb9fbce6299600c3085bea1b8f17ad796bec4f8
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-05-31 16:45:40 +01:00
Stephen Finucane 6cfaeb438e sphinx 4.0: Fix sphinx.ext.extlinks.make_link_role call
Commit 93cf1a57d [1] added a new parameter, 'name', to this function.
Include that when we detect Sphinx 4.x in use.

[1] https://github.com/sphinx-doc/sphinx/commit/93cf1a57d

Change-Id: I3b05df39f701280052d8a0d4f261e8749669ca11
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-05-31 16:45:40 +01:00
Stephen Finucane e2d40fa030 tox: Toggle 'usedevelop'
I want the latest changes picked up always.

Change-Id: I03c5b549730dd2ad79a314fc17d013322768fa8e
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-05-31 16:45:40 +01:00
Stephen Finucane 0b012dc62c trivial: Fix indentation
Use 2 spaces consistently.

Change-Id: I4905cf1838d2a878c0663fca55061e6668302ca9
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-05-31 15:20:01 +01:00
Andreas Jaeger 765f2cab59 Change to OFTC
The "Report a bug" section mentioned Freenode, use OFTC now.

Change-Id: Id097f1f2d7fa921228306eef9ba10177e712230a
2021-05-26 19:19:23 +02:00
YuehuiLei 2a569b84f0 setup.cfg: Replace dashes with underscores
Setuptools v54.1.0 introduces a warning that the use of dash-separated
options in 'setup.cfg' will not be supported in a future version [1].
Get ahead of the issue by replacing the dashes with underscores. Without
this, we see 'UserWarning' messages like the following on new enough
versions of setuptools:

  UserWarning: Usage of dash-separated 'description-file' will not be
  supported in future versions. Please use the underscore name
  'description_file' instead

[1] https://github.com/pypa/setuptools/commit/a2e9ae4cb

Change-Id: I37ca13f2f2f0f5a063e64d389a30f3b61e6c25f0
2021-05-05 10:07:56 +08:00
Daniel Bengtsson f0da3d3345 Move flake8 as a pre-commit local target.
The goal here is to avoid conflicts between flake8 and hacking version each
2 days.

Inspired from nova's approach[1].

The flake8 version to install will be determined by hacking and
requirements[2] will stay aligned instead of relying on different versions.

[1] https://opendev.org/openstack/nova/src/branch/master/.pre-commit-config.yaml#L26-L35
[2] https://opendev.org/openstack/hacking/src/branch/master/requirements.txt#L1

Change-Id: Idb4a784a1a1296168ffd024a424dbbc9f4b9c123
2021-03-23 13:14:42 +01:00
smarcet 3547151908 Updated Nav Menu
Updated Nav Menu to match https://www.openstack.org/ nav Menu

Signed-off-by: smarcet <smarcet@gmail.com>
Change-Id: Ib4e13a7964d548ed6bd9da683c4b755188ae7d6a
2021-01-06 10:54:27 -03:00
Zuul a1156110c9 Merge "Use TOX_CONSTRAINTS_FILE" 2020-12-03 14:48:27 +00:00
Hervé Beraud 3020abdfb8 Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://review.opendev.org/#/c/722814/
[2] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file

Change-Id: I1e1e39f39c6b0bb957d48d0f9a6cf7753a8d1258
2020-11-04 10:54:32 +01:00
Stone c7f7eec234 Added styling for rST rubric directive.
StarlingX is using the rST rubric directive to style headings such as
'Prerequisites', 'Procedure', and 'Results' in tasks without having them
appear in the TOC. There is currently no support for rubrics in the
StarlingX theme. This file appears to be the correct place to add it.
Testing to see if merge is picked up by StarlingX tox builds.

Change-Id: Ia339ad02522891c2b0b593dc782b67220565b87f
Signed-off-by: Stone <ronald.stone@windriver.com>
2020-10-29 13:35:33 -04:00
Zuul 369e8f99f5 Merge "trivial: Address some indentation nits" 2020-10-22 14:21:49 +00:00
Zuul a293b1ba50 Merge "js: Don't attempt to set bug, PDF links without configuration" 2020-10-22 14:19:35 +00:00
Zuul 1fb18cc99b Merge "Store empty string for release" 2020-10-22 14:18:24 +00:00
Zuul 080839551e Merge "js: Set 'LINK_SUFFIX'" 2020-10-22 14:16:44 +00:00
Andreas Jaeger d3cdb8689b Change name of OpenStack Foundation
OpenStack Foundation got renamed to Open Infrastructure Foundation,
follow the rename and update links as well.

Remove no longer working links.

Change-Id: Iee3bb16fb6554ad80a3263f4f364976bcb8c88e1
2020-10-22 09:51:36 +02:00
Zuul 31d4da362a Merge "Adding pre-commit" 2020-09-22 11:44:54 +00:00
Stephen Finucane cf6a68a0c3 trivial: Address some indentation nits
This makes things a little easier to grok.

Change-Id: I94c3c34d8b8630237bf8969840cc077e04563b8c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-09-22 12:10:41 +01:00
Stephen Finucane 8e6b9c5244 js: Don't attempt to set bug, PDF links without configuration
Generating both the bug link and PDF download link requires some
configuration in 'conf.py': specifically, the 'openstack_bug_project'
and 'openstack_pdf_link' config options must be set. If these are not
present, the template doesn't include the relevant tags, which means
attempts to look these up via 'getElementById' will return 'null',
causing ugly tracebacks like so in the console.

  Uncaught ReferenceError: bugProject is not defined
    <anonymous> http://localhost:8000/search.html?q=usage:395

Simply surround these blocks with the same conditionals as the template,
avoiding the issue entirely.

Change-Id: I08ef0fc6c7ebd2c0e7ba89bc42cc92176fec8ab8
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1896607
2020-09-22 12:10:37 +01:00
Stephen Finucane 6876b7276b Store empty string for release
If we're unable to extract the project version from the package, we
leave things unversioned. Unfortunately, that means setting the
'version' and 'release' config options to 'None'. These should be
strings and setting them to 'None' results in the following errors:

  WARNING: The config value `release' has type `NoneType', defaults to `str'.
  ...

  Exception occurred:
    File ".../sphinx/builders/html/__init__.py", line 475, in prepare_writing
      'release': return_codes_re.sub('', self.config.release),
  TypeError: expected string or bytes-like object

Simply set an empty string instead.

Change-Id: I6df4a90b04f3ed89c69fb7669027feda6c5ffe79
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1896609
2020-09-22 12:08:22 +01:00
Stephen Finucane 9efc192021 js: Set 'LINK_SUFFIX'
Sphinx 3.0.0 changed the behavior of JavaScript-based search utility,
changing the configuration option used to determine the suffix for
search results from 'html_file_suffix' to 'html_link_suffix' [1]. We
were manually overriding 'DOCUMENTATION_OPTIONS' and were not setting
the 'LINK_SUFFIX' attribute, which maps to this config option, meaning
our resulting URLs looked like 'fooundefined', where 'foo' is the name
of the file.

Add 'LINK_SUFFIX', resolving this issue.

[1] https://github.com/sphinx-doc/sphinx/commit/a717ffec78

Change-Id: I06488225cf0431e601f16e0f1047a6088a11d5bd
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-bug: #1880331
2020-09-22 12:02:53 +01:00
Hervé Beraud ff156664e6 Adding pre-commit
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.

Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.

pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker (check-byte-order-marker);
- Checks that non-binary executables have a proper
  shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
  calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)

For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks

Change-Id: I9b979afcd45e6a51252ccccb686b01beeb9157f8
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-15 14:46:10 +02:00
Andreas Jaeger 94b3ecb547 Remove ask.o.o
ask.openstack.org is dead, remove links to it.

Change-Id: I7221066ae231ff901cb8a044c312feecb1da9f82
2020-09-14 09:02:34 +02:00
MCamp859 0ef4eb20b4 Add version dropdown on docs.starlingx.io
This patch adds the version dropdown from the openstackdocstheme to the
starlingxdocstheme. Change will allow users to view different versions
of StarlingX documentation.

Change-Id: I44b797e00be065e36cb3e7b447c83f8ab5fd69b5
Signed-off-by: MCamp859 <maryx.camp@intel.com>
2020-07-08 13:39:59 -04:00
Ildiko Vancsa f65a973978 Changing the scope of the search bar on docs.starlingx.io
This patch adds the search related files from openstackdocstheme to
starlingxdocs to modify the scope of the the search to the StarlingX
documentation.

Change-Id: Iaa8d3066221eca603876c6266f8f211aef033bfd
Signed-off-by: Ildiko Vancsa <ildiko.vancsa@gmail.com>
2020-06-03 21:25:30 +02:00
zhangboye d50612c0d0 Add py38 package metadata
Change-Id: I3afaa107d005022cd2bb351f35d02c66fa4e13b4
2020-06-01 16:06:38 +08:00
Zuul ed119f6828 Merge "Fix hacking min version to 3.0.1" 2020-05-28 09:50:41 +00:00
Zuul 67e29f996b Merge "Ignore 'last_updated' for auto-generated pages" 2020-05-27 13:44:05 +00:00