mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
Improve style of man page HTML renders
See individual comments within `rgbds.css` for more info Not too fond of having to modify `mandoc.css`, but I did my best to modify as little as possible
This commit is contained in:
@@ -5,7 +5,10 @@
|
|||||||
|
|
||||||
/* Global defaults. */
|
/* Global defaults. */
|
||||||
|
|
||||||
html { max-width: 100ex; }
|
/* This is handled in `rgbds.css` instead
|
||||||
|
*
|
||||||
|
* html { max-width: 100ex; }
|
||||||
|
*/
|
||||||
body { font-family: Helvetica,Arial,sans-serif; }
|
body { font-family: Helvetica,Arial,sans-serif; }
|
||||||
table { margin-top: 0em;
|
table { margin-top: 0em;
|
||||||
margin-bottom: 0em; }
|
margin-bottom: 0em; }
|
||||||
|
|||||||
52
docs/rgbds.css
Normal file
52
docs/rgbds.css
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/* Overrides to default mandoc styling for HTML renders of RGBDS man pages */
|
||||||
|
|
||||||
|
html {
|
||||||
|
/* Reduce contrast */
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
color: #222;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
/* Improve readability */
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1.4;
|
||||||
|
text-align: justify;
|
||||||
|
|
||||||
|
/* Center body horizontally (requires <html> to span full width) */
|
||||||
|
margin: 10px auto;
|
||||||
|
/* `mandoc.css`'s default, but it's applied to <html> there */
|
||||||
|
max-width: 100ex;
|
||||||
|
}
|
||||||
|
@media print {
|
||||||
|
body {
|
||||||
|
/* Max width doesn't make sense for print */
|
||||||
|
max-width: none;
|
||||||
|
/* Make font slightly smaller for printing */
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
code, pre {
|
||||||
|
font-size: smaller;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Separate lines in tables */
|
||||||
|
table.Bl-column {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
table.Bl-column tr:not(:first-child) > td,
|
||||||
|
table.Bl-column tr:not(:first-child) > th {
|
||||||
|
border-top: 1px solid #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.Bl-column th {
|
||||||
|
/* Apply `.Sy` style to table headers */
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.Bl-column td,
|
||||||
|
table.Bl-column th {
|
||||||
|
/* Add horizontal spacing between columns */
|
||||||
|
padding: 2px 7px 0;
|
||||||
|
}
|
||||||
@@ -1,5 +1,17 @@
|
|||||||
#!/usr/bin/awk -f
|
#!/usr/bin/awk -f
|
||||||
|
|
||||||
|
/<link/ {
|
||||||
|
# Inject our own style overrides
|
||||||
|
print(" <link rel=\"stylesheet\" href=\"rgbds.css\" type=\"text/css\" media=\"all\"/>")
|
||||||
|
}
|
||||||
|
|
||||||
|
/^\s+<td><b class="Sy">.+<\/b><\/td>$/ {
|
||||||
|
# Assuming that all cells whose contents are bold are heading cells,
|
||||||
|
# use the HTML tag for those
|
||||||
|
sub(/td><b class="Sy"/, "th");
|
||||||
|
sub(/b><\/td/, "th");
|
||||||
|
}
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
in_synopsis = 0
|
in_synopsis = 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user