summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkleines Filmröllchen <malu.bertsch@gmail.com>2022-01-10 22:28:43 +0100
committerLinus Groh <mail@linusgroh.de>2022-01-11 00:24:57 +0100
commit9e471353dda33cf9de5584287b4a18ed0085c7df (patch)
tree0da5183c5aaf780812f5b0225b91d718d1373820
parent98c0c5e9e65c1ef42f6a3a1da2726950ac79c560 (diff)
downloadserenity-9e471353dda33cf9de5584287b4a18ed0085c7df.zip
Meta: Convert new help page link styles for the man page website
The special URL links (help://man) and the application opening links now work on the man page website. While the page links are translated correctly, the application launch can't be implemented. For this reason, an explanatory error page is shown instead.
-rw-r--r--Meta/Websites/man.serenityos.org/cant-run-application.md5
-rwxr-xr-xMeta/build-manpages-website.sh5
-rw-r--r--Meta/convert-markdown-links.lua3
-rw-r--r--Userland/Utilities/markdown-check.cpp1
4 files changed, 13 insertions, 1 deletions
diff --git a/Meta/Websites/man.serenityos.org/cant-run-application.md b/Meta/Websites/man.serenityos.org/cant-run-application.md
new file mode 100644
index 0000000000..f54d80aae8
--- /dev/null
+++ b/Meta/Websites/man.serenityos.org/cant-run-application.md
@@ -0,0 +1,5 @@
+# Sorry :^(
+
+This is a link to open the application directly, but that only works in SerenityOS.
+
+[Go back to main page](index.html)
diff --git a/Meta/build-manpages-website.sh b/Meta/build-manpages-website.sh
index b7dd56209f..4ea9d97eb4 100755
--- a/Meta/build-manpages-website.sh
+++ b/Meta/build-manpages-website.sh
@@ -97,6 +97,11 @@ pandoc -f gfm -t html5 -s \
--metadata title="SerenityOS man pages" \
-o output/index.html \
Meta/Websites/man.serenityos.org/index.md
+pandoc -f gfm -t html5 -s \
+ -B Meta/Websites/man.serenityos.org/banner-preamble.inc \
+ --metadata title="Can't run applications" \
+ -o output/cant-run-application.html \
+ Meta/Websites/man.serenityos.org/cant-run-application.md
# Copy pre-made files
cp Meta/Websites/man.serenityos.org/banner.png output/
diff --git a/Meta/convert-markdown-links.lua b/Meta/convert-markdown-links.lua
index 0a1800b23d..30ed1059fe 100644
--- a/Meta/convert-markdown-links.lua
+++ b/Meta/convert-markdown-links.lua
@@ -1,4 +1,5 @@
function Link(el)
- el.target = string.gsub(el.target, "%.md", ".html") -- change .md to .html links
+ el.target = string.gsub(el.target, "file:///bin/.*", "../cant-run-application.html")
+ el.target = string.gsub(el.target, "help://man/([^/]*)/(.*)", "../man%1/%2.html")
return el
end
diff --git a/Userland/Utilities/markdown-check.cpp b/Userland/Utilities/markdown-check.cpp
index 633c555ff6..de56d88376 100644
--- a/Userland/Utilities/markdown-check.cpp
+++ b/Userland/Utilities/markdown-check.cpp
@@ -47,6 +47,7 @@ static bool is_missing_file_acceptable(String const& filename)
"/man6/index.html",
"/man7/index.html",
"/man8/index.html",
+ "index.html",
};
for (auto const& suffix : acceptable_missing_files) {
if (filename.ends_with(suffix))