diff options
author | Tobias Christiansen <tobyase@serenityos.org> | 2022-01-17 10:43:28 +0100 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-01-17 02:22:33 -0800 |
commit | 89c0f84a280778a877b89d1b5f3facf5020095fb (patch) | |
tree | e17bdc17c3ce24e0c04ab5abe8ff986d7f13a88a /Meta/convert-markdown-links.lua | |
parent | 76563c56dd49215b3c9045f47df9c06ef4ec432a (diff) | |
download | serenity-89c0f84a280778a877b89d1b5f3facf5020095fb.zip |
Meta: Add icons to online man pages
Previously all the added icons weren't available in the online version
of the man pages. This patch adds functionality to copy all the used
icons over when assembling the HTML version.
Diffstat (limited to 'Meta/convert-markdown-links.lua')
-rw-r--r-- | Meta/convert-markdown-links.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Meta/convert-markdown-links.lua b/Meta/convert-markdown-links.lua index 30ed1059fe..b94cfbb7ab 100644 --- a/Meta/convert-markdown-links.lua +++ b/Meta/convert-markdown-links.lua @@ -3,3 +3,14 @@ function Link(el) el.target = string.gsub(el.target, "help://man/([^/]*)/(.*)", "../man%1/%2.html") return el end + +function Image(el) + local pattern = "/res/icons/(.*)" + local image = string.gsub(el.src, pattern, "%1") + + el.src = "../icons/" .. image + file = io.open("icons.txt", "a+") + file:write(image .. "\n") + file:close() + return el +end |