combined all resource folders (lib/ & scripts/) into res/

This commit is contained in:
Abdullah Islam 2023-06-29 13:49:34 +06:00
parent 56baeefaf6
commit 46a84b5019
8 changed files with 22 additions and 21 deletions

View File

@ -25,9 +25,7 @@ BEGIN {
body = body sprintf("<h2 id='%s'>%s</h2>\n\
<a href='#%s'>Permalink</a><br/><br/>\n", \
headingTextAsID, \
headingText, \
headingTextAsID)
headingTextAsID, headingText, headingTextAsID)
next
}
@ -140,9 +138,7 @@ END {
gsub(/[ ]*$/, "", headingTextAsID)
gsub(" ", "_", headingTextAsID)
tocText = tocText sprintf("<li><a href='#%s'>%s</a></li>\n", \
headingTextAsID, \
subHeadings[i])
tocText = tocText sprintf("<li><a href='#%s'>%s</a></li>\n", headingTextAsID, subHeadings[i])
}
tocText = tocText "</ol> </details>\n"
@ -150,6 +146,11 @@ END {
navbarText = genNavbarHTML(FILENAME, "src/", "html/")
dirname = getDirname(FILENAME)
gsub(/(\.|\[|\]|\*)/, "\\&", sourcePath)
gsub(sourcePath, outputPath, dirname)
gsub(sourcePath, outputPath, filename)
printf "<!DOCTYPE html>\n\
<html>\n\
<head>\n\
@ -158,13 +159,7 @@ END {
<meta name='referrer' content='no-referrer' />\n\
<meta name='viewpoint' content='width=device-width,initial-scale=1.0' />\n\
\n\
<style>\n\
#content { max-width: 70ch; margin: auto; padding: 10px; }\n\
#navbar { max-width: 70ch; margin: auto; padding: 10px; background: teal; color: white; }\n\
#navbar a { color: white; }\n\
hr { max-width: 70ch; }\n\
.permalink { margin-left: 15px; }\n\
</style>\n\
<link ref='stylesheet' href='%s'>\n\
</head>\n\
<body>\n\
<header>\n\
@ -178,6 +173,7 @@ hr { max-width: 70ch; }\n\
</body>\n\
</html>", \
title, \
stylesheetPath, \
navbarText, \
tocText, \
body

View File

@ -1,13 +1,13 @@
function genNavbarHTML(filename, sourcePath, outputPath) {
if (filename == "-" || filename == "/dev/stdout/")
return ""
dirname = getDirname(filename)
gsub(/(\.|\[|\]|\*)/, "\\&", sourcePath)
gsub(sourcePath, outputPath, dirname)
gsub(sourcePath, outputPath, filename)
if (filename == "-" || filename == "/dev/stdout/" || filename == "-")
return ""
else
return sprintf("<nav id='navbar'>\n\
return sprintf("<nav id='navbar'>\n\
<a href='%s'>home</a> | \n\
<a href='%s'>sitemap</a> | \n\
<a href='%s'>feed</a> | \n\
@ -19,15 +19,15 @@ function genNavbarHTML(filename, sourcePath, outputPath) {
}
function genNavbarGMI(filename, sourcePath, outputPath) {
if (filename == "-" || filename == "/dev/stdout/")
return ""
dirname = getDirname(filename)
gsub(/(\.|\[|\]|\*)/, "\\&", sourcePath)
gsub(sourcePath, outputPath, dirname)
gsub(sourcePath, outputPath, filename)
if (filename == "-" || filename == "/dev/stdout/" || filename == "-")
return ""
else
return sprintf("Navigation:\n\
return sprintf("Navigation:\n\
=> %s home\n\
=> %s sitemap\n\
=> %s feed\n\

5
res/style.css Normal file
View File

@ -0,0 +1,5 @@
#content { max-width: 70ch; margin: auto; padding: 10px; }
#navbar { max-width: 70ch; margin: auto; padding: 10px; background: teal; color: white; }
#navbar a { color: white; }
hr { max-width: 70ch; }
.permalink { margin-left: 15px; }