From 261bdc7358630abb12b1423b68efbd4409bec9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0pa=C4=8Dek?= Date: Thu, 30 Jun 2022 11:48:16 +0200 Subject: [PATCH] Special-case zone in-view It is not really a zone type, so let's not generate "type in-view" anchor for it. --- doc/arm/_ext/iscconf.py | 7 +++++-- doc/arm/_ext/mergegrammar.py | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/arm/_ext/iscconf.py b/doc/arm/_ext/iscconf.py index d7f1e495de..809445ec50 100644 --- a/doc/arm/_ext/iscconf.py +++ b/doc/arm/_ext/iscconf.py @@ -145,8 +145,11 @@ def domain_factory(domainname, domainlabel, todolist, grammar): try: zone_idx = path.index("zone") zone_type_txt = path[zone_idx + 1] - assert zone_type_txt.startswith("type "), zone_type_txt - zone_types.add(zone_type_txt[len("type ") :]) + if zone_type_txt.startswith("type "): + zone_types.add(zone_type_txt[len("type ") :]) + else: + assert zone_type_txt == "in-view" + zone_types.add(zone_type_txt) except (ValueError, IndexError): nozone_paths.append(path) condensed_paths = nozone_paths[:] diff --git a/doc/arm/_ext/mergegrammar.py b/doc/arm/_ext/mergegrammar.py index 966d1c3bc9..b0500eb4b5 100644 --- a/doc/arm/_ext/mergegrammar.py +++ b/doc/arm/_ext/mergegrammar.py @@ -22,7 +22,11 @@ import parsegrammar def read_zone(): zone_grammars = {} for file in Path("../misc/").glob("*.zoneopt"): - zone_type = f"type {file.stem}" + # in-view is not really a zone type + if file.stem == "in-view": + zone_type = "in-view" + else: + zone_type = f"type {file.stem}" with file.open(encoding="ascii") as fp: zonegrammar = parsegrammar.parse_mapbody(fp)