From: Shamus Hammons Date: Tue, 10 Jan 2017 23:02:05 +0000 (-0600) Subject: Added automagically generated Table of Contents. X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=589e181c22b4ac3e6160143e465e45ba93ad3afd;p=ardour-manual-diverged Added automagically generated Table of Contents. --- diff --git a/munge b/munge index 1d43931..3a9d3f5 100755 Binary files a/munge and b/munge differ diff --git a/munge.cpp b/munge.cpp index 81bc38d..e8c095d 100644 --- a/munge.cpp +++ b/munge.cpp @@ -11,7 +11,6 @@ #include #include // For mkdir() #include -//#include void MakeFilename(char * fn) @@ -26,6 +25,8 @@ void MakeFilename(char * fn) fn[i] |= 0x20; else if (fn[i] >= 'a' && fn[i] <= 'z') ; + else if (fn[i] >= '0' && fn[i] <= '9') + ; else fn[i] = '_'; } @@ -40,13 +41,22 @@ int main(int argc, char * argv[]) if (master == NULL) { - printf("Could not open master doc file!\n"); + printf("Could not open master doc (master-doc.txt) file!\n"); + return -1; + } + + FILE * toc = fopen("_manual/00_toc.html", "w"); + + if (toc == NULL) + { + printf("Could not open TOC file!\n"); + fclose(master); return -1; } - // Remove contents of _manual before writing into it... -// remove("./_manual/*.html"); -// return 0; + fprintf(toc, "---\n"); + fprintf(toc, "title: Ardour Table of Contents\n"); + fprintf(toc, "---\n\n"); char buffer[1024000], keyword[1024], token[1024]; char title[1024], shortTitle[1024], inclFile[1024], style[1024]; @@ -56,6 +66,7 @@ int main(int argc, char * argv[]) bool first = true; FILE * newFile = NULL; char level1File[1024], level2File[1024], level3File[1024], temp[1024]; + char partFN[1024], chapterFN[1024], scLink[4096]; while (!feof(master)) { @@ -73,7 +84,7 @@ int main(int argc, char * argv[]) printf(" (%d lines)\n", sectionLineCount); } - // Reset the "short" title + // Reset the "short" title, include file & sytle shortTitle[0] = 0; inclFile[0] = 0; style[0] = 0; @@ -123,9 +134,6 @@ int main(int argc, char * argv[]) { // We hit the end of our keyword block, now do something // about it... :-P -// for(int i=0; iPart %s: %s\n", roman[part], title); + // Make the file expected at this level... sprintf(temp, "%s.html", level1File); FILE * tfp = fopen(temp, "w"); @@ -166,6 +179,11 @@ int main(int argc, char * argv[]) MakeFilename(temp); sprintf(level2File, "%s/%02d_%s", level1File, chapter, temp); mkdir(level2File, 0777); + + // Set up the "chapter" part of the TOC link + sprintf(chapterFN, "%s", temp); + fprintf(toc, "

Ch. %d:  %s

\n", chapter, partFN, chapterFN, title); + // Make the file expected at this level... sprintf(temp, "%s.html", level2File); FILE * tfp = fopen(temp, "w"); @@ -189,6 +207,10 @@ int main(int argc, char * argv[]) if (newFile != NULL) fclose(newFile); + // Make the link + sprintf(scLink, "/%s/%s/%s/", partFN, chapterFN, temp); + fprintf(toc, " %s
\n", scLink, title); + if (strlen(inclFile) > 0) { // Copy the include file to the appropriate spot... @@ -229,13 +251,14 @@ int main(int argc, char * argv[]) else { if ((level == 2) && (newFile != NULL)) - fprintf(newFile, "%s\n", buffer);//*/ + fprintf(newFile, "%s\n", buffer); } } printf("\n\nProcessed %i lines.\n", lineCount); fclose(master); + fclose(toc); if (newFile) fclose(newFile); diff --git a/source/css/app.css b/source/css/app.css index 114abf3..6fa18f9 100644 --- a/source/css/app.css +++ b/source/css/app.css @@ -322,7 +322,20 @@ kbd.mouse { } */ -kbd.menu,kbd.option,kbd.optoff { +kbd.optoff, kbd.option { + border:none; + background-color:transparent; +} + +kbd.optoff:after { + content:url('/images/checkbox-unchecked.png'); +} + +kbd.option:after { + content:url('/images/checkbox-checked.png'); +} + +kbd.menu { border:none; background-color:transparent; font-weight:bold; @@ -330,22 +343,10 @@ kbd.menu,kbd.option,kbd.optoff { white-space:normal; } -kbd.option:after,kbd.optoff:after { - font-family:mono; - font-weight:lighter; - text-align:center; - border:solid 1px black; - margin-left:0.3em; -} -kbd.option:after { - content:'X'; -} kbd.osc { } -kbd.optoff:after { - content:' '; -} + kbd.fader, kbd.knob, kbd.button { @@ -534,5 +535,7 @@ samp:after { } } +#chapter { padding-top: 1em; padding-left: 1em; } +#subchapter { padding-left: 4em; } diff --git a/source/index.html b/source/index.html index d961baa..5778a12 100644 --- a/source/index.html +++ b/source/index.html @@ -1,6 +1,6 @@ - +