From a0c4aa2fa2c2249c398633791264fdeefee40c0b Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Tue, 17 Dec 2019 13:03:15 -0800 Subject: [PATCH] 4.1.0 day 1 site ship --- custom/4coder_doc_commands.cpp | 6 ++++-- site/4ed_site_render_main.cpp | 29 ++++++++++++++++++++++------- site/{ => static}/docs/styles.css | 4 ++++ site/static/home.html | 8 ++++++++ 4 files changed, 38 insertions(+), 9 deletions(-) rename site/{ => static}/docs/styles.css (98%) diff --git a/custom/4coder_doc_commands.cpp b/custom/4coder_doc_commands.cpp index aea241d4..92c2f6f8 100644 --- a/custom/4coder_doc_commands.cpp +++ b/custom/4coder_doc_commands.cpp @@ -26,7 +26,8 @@ doc_commands(Arena *arena){ function Doc_Cluster* doc_default_bindings(Arena *arena, Mapping *mapping, i64 global_id, i64 file_id, i64 code_id){ Doc_Cluster *cluster = new_doc_cluster(arena, "Bindings", "bindings"); - Doc_Page *page = new_doc_page(arena, cluster, "Default", "default"); + + Doc_Page *page = new_doc_page(arena, cluster, "Default Bindings", "default_bindings"); for (Command_Map *map = mapping->first_map; map != 0; map = map->next){ @@ -43,7 +44,6 @@ doc_default_bindings(Arena *arena, Mapping *mapping, i64 global_id, i64 file_id, Doc_Block *block = new_doc_block(arena, page, map_name); Doc_Paragraph *par = new_doc_par_table(arena, block); - (void)par; struct Bind_Node{ Bind_Node *next; @@ -161,6 +161,8 @@ doc_default_bindings(Arena *arena, Mapping *mapping, i64 global_id, i64 file_id, content->page_link = SCu8(bnode->binding.name); } + par->table.dim = table_dims; + par->table.vals = vals; } return(cluster); diff --git a/site/4ed_site_render_main.cpp b/site/4ed_site_render_main.cpp index 14aaf257..6de7c8ff 100644 --- a/site/4ed_site_render_main.cpp +++ b/site/4ed_site_render_main.cpp @@ -45,7 +45,7 @@ char html_header[] = R"HTMLFOO( - + %.*s @@ -62,9 +62,7 @@ char html_footer[] = R"HTMLFOO( )HTMLFOO"; function void -render_doc_page_to_html__content(Arena *scratch, Doc_Content_List *list, FILE *out){ - fprintf(out, "
"); - +render_doc_page_to_html__content_list(Arena *scratch, Doc_Content_List *list, FILE *out){ for (Doc_Content *content = list->first; content != 0; content = content->next){ @@ -93,7 +91,7 @@ render_doc_page_to_html__content(Arena *scratch, Doc_Content_List *list, FILE *o { fprintf(out, "
");
             }break;
-            }
+        }
         
         b32 close_link = false;
         if (content->page_link.size > 0){
@@ -131,7 +129,12 @@ render_doc_page_to_html__content(Arena *scratch, Doc_Content_List *list, FILE *o
         }
         fprintf(out, " ");
     }
-    
+}
+
+function void
+render_doc_page_to_html__content(Arena *scratch, Doc_Content_List *list, FILE *out){
+    fprintf(out, "
"); + render_doc_page_to_html__content_list(scratch, list, out); fprintf(out, "
\n"); } @@ -154,7 +157,19 @@ render_doc_page_to_html__code(Arena *scratch, Doc_Code_Sample_List *code, FILE * function void render_doc_page_to_html__table(Arena *scratch, Vec2_i32 dim, Doc_Content_List *vals, FILE *out){ - + fprintf(out, ""); + for (i32 y = 0; y < dim.y; y += 1){ + fprintf(out, ""); + Doc_Content_List *line = &vals[y*dim.x]; + for (i32 x = 0; x < dim.x; x += 1){ + Doc_Content_List *cont = &line[x]; + fprintf(out, ""); + } + fprintf(out, ""); + } + fprintf(out, "
"); + render_doc_page_to_html__content_list(scratch, cont, out); + fprintf(out, "
"); } function void diff --git a/site/docs/styles.css b/site/static/docs/styles.css similarity index 98% rename from site/docs/styles.css rename to site/static/docs/styles.css index e5c7c979..2c2a3037 100644 --- a/site/docs/styles.css +++ b/site/static/docs/styles.css @@ -67,6 +67,10 @@ pre { text-align: justify; } +table.normal td { + padding-right: 1em; +} + .normal li { text-align: left; } diff --git a/site/static/home.html b/site/static/home.html index 2bd950e6..d3a95103 100644 --- a/site/static/home.html +++ b/site/static/home.html @@ -36,6 +36,10 @@ li.firstli { margin-top: 0px; } +table.normal tr { + +} + .normal a:link, a:link { color: #D08F20; } @@ -127,6 +131,10 @@ li.firstli {
+ + +
+

Demo Clips for 4coder 4.1.0