Skip to content

Commit da3c3bd

Browse files
Eric Friedemonty
authored andcommitted
image: autogenerate docs
$namespace = openstack.image.v{1|2} The subcommand documents for $namespace were hardcoded and thus prone to drift over time. This commit removes the hardcoded content and uses the autoprogram-cliff directive to generate them automatically from the subcommand configuration classes. Some reorganization happened here. The `image` subcommand name is shared by image v1 and v2. Previously the hardcoded document had them combined and interleaved. Attempting to preserve this with autoprogram-cliff would have required significant additional infrastructure. However, since most readers care completely about one and not at all about the other, we instead split the v1 and v2 versions of these commands into separate pages. In case links to the old pages exist in the wild, they are preserved, but moved (with redirects) to a hidden directory, and populated simply with links to the new version-specific generated documents. Change-Id: I24dc6dc10671c7f1267c27002542f61f8a3c18ae
1 parent 26878e7 commit da3c3bd

6 files changed

Lines changed: 30 additions & 652 deletions

File tree

doc/source/_extra/.htaccess

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ redirectmatch 301 ^/python-openstackclient/([^/]+)/specs/([^/.]+).html$ /python-
99

1010
redirectmatch 301 ^/python-openstackclient/([^/]+)/(command-(beta|errors|logs|options|wrappers)|developing|humaninterfaceguide|plugins).html$ /python-openstackclient/$1/contributor/$2.html
1111
redirectmatch 301 ^/python-openstackclient/([^/]+)/cli/plugin-commands.html$ /python-openstackclient/$1/cli/plugin-commands/index.html
12-
# Identity pages were split into -v2 and -v3 for common subcommand names.
12+
# For common subcommand names:
13+
# - identity pages were split into -v2 and -v3
14+
# - image pages were split into -v1 and -v2
1315
# The unversioned page is hidden but contains links to the versioned pages so links in the wild redirect somewhere sane.
14-
redirectmatch 301 ^/python-openstackclient/([^/]+)/cli/command-objects/(ec2-credentials|endpoint|project|role|service|token|user).html$ /python-openstackclient/$1/cli/_hidden/$2.html
16+
redirectmatch 301 ^/python-openstackclient/([^/]+)/cli/command-objects/(ec2-credentials|endpoint|image|project|role|service|token|user).html$ /python-openstackclient/$1/cli/_hidden/$2.html

doc/source/cli/_hidden/image.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=====
2+
image
3+
=====
4+
5+
.. NOTE(efried): This page is hidden from the main TOC; it's here so links in
6+
the wild redirect somewhere sane, because previously identity v2 and v3 were
7+
combined in a single page.
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
12+
../command-objects/image-v1
13+
../command-objects/image-v2
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
========
2+
image v1
3+
========
4+
5+
.. autoprogram-cliff:: openstack.image.v1
6+
:command: image *
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
========
2+
image v2
3+
========
4+
5+
.. autoprogram-cliff:: openstack.image.v2
6+
:command: image *

0 commit comments

Comments
 (0)