diff --git a/hmml_to_html/hmml_to_html.c b/hmml_to_html/hmml_to_html.c index 00197dd..0acf16c 100644 --- a/hmml_to_html/hmml_to_html.c +++ b/hmml_to_html/hmml_to_html.c @@ -83,6 +83,20 @@ CopyStringToBuffer(char *Src, buffer *Dest) } } +int +StringsDiffer(char *A, char *B) +{ + while(*A && *B) + { + if(*A != *B) + { + return *A - *B; + } + ++A, ++B; + } + return *A - *B; +} + int main(int ArgC, char **Args) { @@ -139,9 +153,6 @@ main(int ArgC, char **Args) " \n" "
\n" " %s\n", HMML.metadata.title); - - Out.Ptr = Out.Location; - CopyBuffer(&Working, &Out); int AnnotationIndex = 0; @@ -151,11 +162,10 @@ main(int ArgC, char **Args) if(HMML.annotations[AnnotationIndex].reference_count) { sprintf(Working.Location, -"
\n" -" References ▼\n" -"
\n" -"
\n"); - +"
\n" +" References ▼\n" +"
\n" +"
\n"); CopyBuffer(&Working, &Out); while(AnnotationIndex < HMML.annotation_count) @@ -164,18 +174,18 @@ main(int ArgC, char **Args) { // NOTE(matt): Consider removing the ref_index class if it ain't needed sprintf(Working.Location, -" \n" -" \n" -"
%s
\n" -"
%s
\n" -"
\n" -// NOTE(matt): Fill the div class="ref_indices" with <= 3 span +"
\n" +" \n" +"
%s
\n" +"
%s
\n" +"
\n" +// TODO(matt): Fill the div class="ref_indices" with <= 3 span // class="ref_index" and ensure to put these <=3 spans on the same line without // a space between them -"
\n" -" [%d]%s\n" -"
\n" -"
\n", +"
\n" +" [%d]%s\n" +"
\n" +" \n", AnnotationIndex, HMML.annotations[AnnotationIndex].references[i].url, HMML.annotations[AnnotationIndex].references[i].site ? HMML.annotations[AnnotationIndex].references[i].site : HMML.annotations[AnnotationIndex].references[i].author, @@ -183,39 +193,60 @@ HMML.annotations[AnnotationIndex].references[i].page ? HMML.annotations[Annotati TimecodeToSeconds(HMML.annotations[AnnotationIndex].time), ReferenceIndex, HMML.annotations[AnnotationIndex].time); - CopyBuffer(&Working, &Out); + ++ReferenceIndex; } ++AnnotationIndex; } + sprintf(Working.Location, +"
\n" +"
\n"); + CopyBuffer(&Working, &Out); } ++AnnotationIndex; } sprintf(Working.Location, -"
\n" +" Annotator: %s\n" "
\n" -" Annotator: %s\n" -"
\n" -"
\n" -"
\n" +"
\n" +"
\n" "
\n", HMML.metadata.annotator, HMML.metadata.id); - CopyBuffer(&Working, &Out); int DataRef = 1; for(int AnnotationIndex = 0; AnnotationIndex < HMML.annotation_count; ++AnnotationIndex) { + sprintf(Working.Location, +"
\n", TimecodeToSeconds(HMML.annotations[AnnotationIndex].time), AnnotationIndex); + sprintf(Working.Location, " data-ref=\"%d\"", AnnotationIndex); + CopyBuffer(&Working, &Out); for(int RefLocalIndex = 0; RefLocalIndex < HMML.annotations[AnnotationIndex].reference_count; ++RefLocalIndex) { @@ -262,17 +293,12 @@ HMML.annotations[AnnotationIndex].time); } CopyStringToBuffer(InPtr, &Text); } - else - { - sprintf(Working.Location, -"
\n", TimecodeToSeconds(HMML.annotations[AnnotationIndex].time)); - CopyStringToBuffer(InPtr, &Text); - } + *Out.Ptr++ = '>'; + *Out.Ptr++ = '\n'; + CopyStringToBuffer(InPtr, &Text); *Text.Ptr = '\0'; - CopyBuffer(&Working, &Out); - sprintf(Working.Location, "
%s%s
\n" "
\n" @@ -288,10 +314,9 @@ HMML.annotations[AnnotationIndex].time); Text.Location, HMML.annotations[AnnotationIndex].time, Text.Location); + CopyBuffer(&Working, &Out); ClaimedMemory -= Text.Size; - - CopyBuffer(&Working, &Out); } sprintf(Working.Location, @@ -364,11 +389,8 @@ HMML.annotations[AnnotationIndex].time); " \n" " \n" "\n"); - CopyBuffer(&Working, &Out); - hmml_free(&HMML); - FILE *OutFile; //char *OutFilename; //sprintf(OutFilename, "%s.html", Args[FileIndex]); @@ -381,6 +403,11 @@ HMML.annotations[AnnotationIndex].time); fwrite(Out.Location, Out.Ptr - Out.Location, 1, OutFile); fclose(OutFile); } + else + { + fprintf(stderr, "%s:%d: %s\n", Args[FileIndex], HMML.error.line, HMML.error.message); + } + hmml_free(&HMML); } free(MemoryArena); } diff --git a/hmml_to_html/out.html b/hmml_to_html/out.html index 5987a9f..578edcc 100644 --- a/hmml_to_html/out.html +++ b/hmml_to_html/out.html @@ -9,70 +9,70 @@
Studying the Machine Interrupt Registers - -
-
+
+
0:06Recap and set the stage for the day
@@ -83,7 +83,7 @@
0:06Recap and set the stage for the day
-
+
0:51Intuition on two's complement
0:51Intuition on two's complement
@@ -92,7 +92,7 @@
0:51Intuition on two's complement
-
+
4:10We are counting with zeroes
4:10We are counting with zeroes
@@ -110,7 +110,7 @@
9:03Revisit instructions.scala1 and research register-transfer level2
-
+
15:55Come to understand how to specify that rs1 represents an immediate or a register, thanks to the reply to the "Confusion Regarding Freedom E SDK inline asm" forum thread3
15:55Come to understand how to specify that rs1 represents an immediate or a register, thanks to the reply to the "Confusion Regarding Freedom E SDK inline asm" forum thread3
@@ -119,7 +119,7 @@
15:55Come to understand how to specify that rs1 represents an immediate or a register, thanks to the reply to the "Confusion Regarding Freedom E SDK inline asm" forum thread3
-
+
18:25Read clear_csr() to put csrrc into perspective with our new understanding of pseudo-instructions and the i vs r hints
18:25Read clear_csr() to put csrrc into perspective with our new understanding of pseudo-instructions and the i vs r hints
@@ -146,7 +146,7 @@
23:05Walk through clear_csr() again
-
+
28:53GNU Assembly Syntax: Constraints and Syntax5
28:53GNU Assembly Syntax: Constraints and Syntax5
diff --git a/hmml_to_html/style.css b/hmml_to_html/style.css index 20a390b..53a896b 100644 --- a/hmml_to_html/style.css +++ b/hmml_to_html/style.css @@ -40,6 +40,38 @@ color: black; } +/* Blackboard */ +.marker:hover.blackboard > .content { + background-color: #FFF8E7; + background-size: 12px 12px; + background-image: linear-gradient(to right, rgba(51, 153, 255, .16) 1px, transparent 1px), linear-gradient(to bottom, rgba(51, 153, 255, .16) 1px, transparent 1px); +} + +.marker:hover.blackboard .faded .content { + background-color: rgba(42, 49, 114, 0.7); + background-size: 12px 12px; + background-image: linear-gradient(to right, rgba(0, 0, 0, .16) 1px, transparent 1px), linear-gradient(to bottom, rgba(0, 0, 0, .16) 1px, transparent 1px); + color: #FFFFFF; +} + +.marker.blackboard > .content { + background-color: #FFFFFF; + background-size: 12px 12px; + background-image: linear-gradient(to right, rgba(51, 153, 255, .16) 1px, transparent 1px), linear-gradient(to bottom, rgba(51, 153, 255, .16) 1px, transparent 1px); + color: black; +} + +.marker.blackboard.current > .content { + color: #2A3172; +} + +.marker.blackboard .progress .content { + background-color: #2A3172; + background-size: 12px 12px; + background-image: linear-gradient(to right, rgba(255, 255, 255, .16) 1px, transparent 1px), linear-gradient(to bottom, rgba(255, 255, 255, .16) 1px, transparent 1px); + color: #FFFFFF; +} + /* MANDATORY */ .player_container {