From 9e471353dda33cf9de5584287b4a18ed0085c7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Mon, 10 Jan 2022 22:28:43 +0100 Subject: [PATCH] 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. --- Meta/Websites/man.serenityos.org/cant-run-application.md | 5 +++++ Meta/build-manpages-website.sh | 5 +++++ Meta/convert-markdown-links.lua | 3 ++- Userland/Utilities/markdown-check.cpp | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 Meta/Websites/man.serenityos.org/cant-run-application.md 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))