#include <string.h>
#include <sys/stat.h> // For mkdir()
#include <sys/types.h>
-//#include <unistd.h>
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] = '_';
}
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];
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))
{
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;
{
// We hit the end of our keyword block, now do something
// about it... :-P
-// for(int i=0; i<level; i++)
-// printf("\t");
-
if (level == 0)
printf("\nPart %s: ", roman[part]);
else if (level == 1)
MakeFilename(temp);
sprintf(level1File, "_manual/%02d_%s", part, temp);
mkdir(level1File, 0777);
+
+ // Set up the "part" level of TOC link
+ sprintf(partFN, "%s", temp);
+ fprintf(toc, "<h2>Part %s: %s</h2>\n", roman[part], title);
+
// Make the file expected at this level...
sprintf(temp, "%s.html", level1File);
FILE * tfp = fopen(temp, "w");
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, " <p id=chapter>Ch. %d: <a href=\"/%s/%s/\">%s</a></p>\n", chapter, partFN, chapterFN, title);
+
// Make the file expected at this level...
sprintf(temp, "%s.html", level2File);
FILE * tfp = fopen(temp, "w");
if (newFile != NULL)
fclose(newFile);
+ // Make the link
+ sprintf(scLink, "/%s/%s/%s/", partFN, chapterFN, temp);
+ fprintf(toc, " <a id=subchapter href=\"%s\">%s</a><br />\n", scLink, title);
+
if (strlen(inclFile) > 0)
{
// Copy the include file to the appropriate spot...
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);
}
*/
-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;
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 {
}
}
+#chapter { padding-top: 1em; padding-left: 1em; }
+#subchapter { padding-left: 4em; }