add a flag to indicate which projects have guides
Some of the projects publish documentation but not using the project guide structure. Instead of requiring all projects listed to have a default guide, add a flag that defaults to True and that can be changed in the project data file(s). Also add a default field to the URLSettings structure. Change-Id: Ie2b6abafde5d4be85941fd977762bcbdf891d440 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
8ab11c1126
commit
4e01540b9b
@ -176,53 +176,62 @@ def _check_url(args):
|
||||
# a file list generated by the web server.
|
||||
URLSettings = collections.namedtuple(
|
||||
'URLSettings',
|
||||
['flag_name', 'types', 'template'],
|
||||
['flag_name', 'types', 'template', 'default'],
|
||||
)
|
||||
_URLS = [
|
||||
URLSettings(
|
||||
flag_name=None,
|
||||
flag_name='has_project_guide',
|
||||
types=[],
|
||||
template='https://docs.openstack.org/{name}/{series}/index.html',
|
||||
default=True,
|
||||
),
|
||||
URLSettings(
|
||||
flag_name='has_install_guide',
|
||||
types=['service'],
|
||||
template='https://docs.openstack.org/{name}/{series}/install/index.html', # noqa
|
||||
default=False,
|
||||
),
|
||||
URLSettings(
|
||||
flag_name='has_admin_guide',
|
||||
types=['service'],
|
||||
template='https://docs.openstack.org/{name}/{series}/admin/index.html',
|
||||
default=False,
|
||||
),
|
||||
URLSettings(
|
||||
flag_name='has_config_ref',
|
||||
types=['service', 'library'],
|
||||
template='https://docs.openstack.org/{name}/{series}/configuration/index.html', # noqa
|
||||
default=False,
|
||||
),
|
||||
URLSettings(
|
||||
flag_name='has_in_tree_api_docs',
|
||||
types=['service'],
|
||||
template='https://docs.openstack.org/{name}/{series}/api/index.html',
|
||||
default=False,
|
||||
),
|
||||
URLSettings(
|
||||
flag_name='has_user_guide',
|
||||
types=['service'],
|
||||
template='https://docs.openstack.org/{name}/{series}/user/index.html',
|
||||
default=False,
|
||||
),
|
||||
URLSettings(
|
||||
flag_name='has_api_ref',
|
||||
types=['service'],
|
||||
template='https://developer.openstack.org/api-ref/{service_type}/index.html', # noqa
|
||||
default=False,
|
||||
),
|
||||
URLSettings(
|
||||
flag_name='has_api_guide',
|
||||
types=['service'],
|
||||
template='https://developer.openstack.org/api-guide/{service_type}/index.html', # noqa
|
||||
default=False,
|
||||
),
|
||||
URLSettings(
|
||||
flag_name='has_deployment_guide',
|
||||
types=['deployment'],
|
||||
template='https://docs.openstack.org/project-deploy-guide/{name}/{series}/index.html', # noqa
|
||||
default=False,
|
||||
),
|
||||
]
|
||||
|
||||
@ -330,10 +339,8 @@ def load_project_data(source_directory,
|
||||
)
|
||||
if check_links_this_project and not skip_links:
|
||||
for url_info in _URLS:
|
||||
if url_info.flag_name is None:
|
||||
flag_val = True
|
||||
else:
|
||||
flag_val = project.get(url_info.flag_name, False)
|
||||
flag_val = project.get(url_info.flag_name,
|
||||
url_info.default)
|
||||
if ((not flag_val) and
|
||||
url_info.types and
|
||||
project_type not in url_info.types):
|
||||
|
@ -48,3 +48,5 @@ items:
|
||||
type: boolean
|
||||
has_deployment_guide:
|
||||
type: boolean
|
||||
has_project_guide:
|
||||
type: boolean
|
||||
|
Loading…
Reference in New Issue
Block a user