Skip to content

Commit 8093092

Browse files
author
Corey White
committed
Fixed special doc cases
1 parent 66d42b3 commit 8093092

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

doc/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ include $(MODULE_TOPDIR)/include/Make/Other.make
55
FILES := $(wildcard *.html)
66
# So far, we disntinguished user and contributor documentation here by
77
# extension. This is no longer possible with Markdown.
8+
# These are currently maunally added to mam/mkdocs/scripts/hook_list_scripts.py
9+
# to generate the correct links to edit on GitHub.
810
MDFILES := grass_database.md projectionintro.md
911

1012
default: $(patsubst %,$(HTMLDIR)/%,$(FILES)) $(patsubst %,$(MDDIR)/source/%,$(MDFILES))

man/mkdocs/scripts/hook_list_scripts.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,21 @@ def github_path(toolname, scripts_tools):
2020
"vector",
2121
]
2222

23-
print(f"Searching for: {toolname}")
23+
# Special cases for documentation pages that don't match the pattern matching scheme
24+
special_docs = [
25+
{"name": "projectionintro", "path": "doc"},
26+
{"name": "grass_database", "path": "doc"},
27+
{"name": "databaseintro", "path": "db"},
28+
]
2429

2530
# Exit early if toolname is empty
2631
if not toolname:
2732
return None
2833

34+
# Handle special cases
35+
if toolname in [x["name"] for x in special_docs]:
36+
return next((x["path"] for x in special_docs if x["name"] == toolname), None)
37+
2938
# Convert filter() results to a list
3039
tool_matches = list(filter(lambda x: toolname in x, scripts_tools))
3140

0 commit comments

Comments
 (0)