shithub: rgbds

Download patch

ref: dbefdc923a5f2f6833d9c64645d8c3b2b061143a
parent: 37e45de9c105f32033e7562055581ec586ef1681
author: ISSOtm <eldredhabert0@gmail.com>
date: Tue Sep 15 14:30:40 EDT 2020

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

--- a/src/doc_postproc.awk
+++ b/src/doc_postproc.awk
@@ -38,48 +38,11 @@
 	}
 }
 
-/<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
-	gsub(/<code class="Fl">-<\/code><code class="Fl">/, "<code class=\"Fl\">-")
+	gsub(/<code class="Fl">-<\/code>\s*<code class="Fl">/, "<code class=\"Fl\">-")
 }
 
 {
 	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\"/>")
 }