mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 11:12:07 +00:00
Clean up doc post-processor
Description blurb is already inline from new stylesheet `Xr` links are already handled by `mandoc` now Handle spaces between both dashes in long options Remove `<head>` modifications, as fragments are generated instead
This commit is contained in:
@@ -38,48 +38,11 @@ BEGIN {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/<div class="Nd">/ {
|
|
||||||
# Make the description blurb inline, as with terminal output
|
|
||||||
gsub(/div/, "span")
|
|
||||||
}
|
|
||||||
|
|
||||||
BEGIN {
|
|
||||||
pages["gbz80", 7] = 1
|
|
||||||
pages["rgbds", 5] = 1
|
|
||||||
pages["rgbds", 7] = 1
|
|
||||||
pages["rgbasm", 1] = 1
|
|
||||||
pages["rgbasm", 5] = 1
|
|
||||||
pages["rgblink",1] = 1
|
|
||||||
pages["rgblink",5] = 1
|
|
||||||
pages["rgbfix", 1] = 1
|
|
||||||
pages["rgbgfx", 1] = 1
|
|
||||||
}
|
|
||||||
/<a class="Xr">/ {
|
|
||||||
# Link to other pages in the doc
|
|
||||||
for (i in pages) {
|
|
||||||
split(i, page, SUBSEP)
|
|
||||||
name = page[1]
|
|
||||||
section = page[2]
|
|
||||||
gsub(sprintf("<a class=\"Xr\">%s\\(%d\\)", name, section),
|
|
||||||
sprintf("<a class=\"Xr\" href=\"%s.%d.html\">%s(%d)", name, section, name, section))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
# Make long opts (defined using `Fl Fl`) into a single tag
|
# Make long opts (defined using `Fl Fl`) into a single tag
|
||||||
gsub(/<code class="Fl">-<\/code><code class="Fl">/, "<code class=\"Fl\">-")
|
gsub(/<code class="Fl">-<\/code>\s*<code class="Fl">/, "<code class=\"Fl\">-")
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
print
|
print
|
||||||
}
|
}
|
||||||
|
|
||||||
/<head>/ {
|
|
||||||
# Add viewport size <meta> tag for mobile users
|
|
||||||
print " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"
|
|
||||||
}
|
|
||||||
|
|
||||||
/<link/ {
|
|
||||||
# Inject our own style overrides
|
|
||||||
print(" <link rel=\"stylesheet\" href=\"rgbds.css\" type=\"text/css\" media=\"all\"/>")
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user