4.1.0 day 1 site ship

This commit is contained in:
Allen Webster 2019-12-17 13:03:15 -08:00
parent d0e9665d6e
commit a0c4aa2fa2
4 changed files with 38 additions and 9 deletions

View File

@ -26,7 +26,8 @@ doc_commands(Arena *arena){
function Doc_Cluster* function Doc_Cluster*
doc_default_bindings(Arena *arena, Mapping *mapping, i64 global_id, i64 file_id, i64 code_id){ 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_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; for (Command_Map *map = mapping->first_map;
map != 0; map != 0;
map = map->next){ 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_Block *block = new_doc_block(arena, page, map_name);
Doc_Paragraph *par = new_doc_par_table(arena, block); Doc_Paragraph *par = new_doc_par_table(arena, block);
(void)par;
struct Bind_Node{ struct Bind_Node{
Bind_Node *next; 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); content->page_link = SCu8(bnode->binding.name);
} }
par->table.dim = table_dims;
par->table.vals = vals;
} }
return(cluster); return(cluster);

View File

@ -45,7 +45,7 @@ char html_header[] = R"HTMLFOO(
<html lang="en-US"> <html lang="en-US">
<head> <head>
<link rel='shortcut icon' type='image/x-icon' href='4coder_icon.ico' /> <link rel='shortcut icon' type='image/x-icon' href='https://4coder.net/4coder_icon.ico' />
<link href="https://fonts.googleapis.com/css?family=Inconsolata:700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Inconsolata:700&display=swap" rel="stylesheet">
<script src="search.js"></script> <script src="search.js"></script>
<title>%.*s</title> <title>%.*s</title>
@ -62,9 +62,7 @@ char html_footer[] = R"HTMLFOO(
)HTMLFOO"; )HTMLFOO";
function void function void
render_doc_page_to_html__content(Arena *scratch, Doc_Content_List *list, FILE *out){ render_doc_page_to_html__content_list(Arena *scratch, Doc_Content_List *list, FILE *out){
fprintf(out, "<div class=\"normal\">");
for (Doc_Content *content = list->first; for (Doc_Content *content = list->first;
content != 0; content != 0;
content = content->next){ content = content->next){
@ -93,7 +91,7 @@ render_doc_page_to_html__content(Arena *scratch, Doc_Content_List *list, FILE *o
{ {
fprintf(out, "<code><pre>"); fprintf(out, "<code><pre>");
}break; }break;
} }
b32 close_link = false; b32 close_link = false;
if (content->page_link.size > 0){ 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, " "); fprintf(out, " ");
} }
}
function void
render_doc_page_to_html__content(Arena *scratch, Doc_Content_List *list, FILE *out){
fprintf(out, "<div class=\"normal\">");
render_doc_page_to_html__content_list(scratch, list, out);
fprintf(out, "</div>\n"); fprintf(out, "</div>\n");
} }
@ -154,7 +157,19 @@ render_doc_page_to_html__code(Arena *scratch, Doc_Code_Sample_List *code, FILE *
function void function void
render_doc_page_to_html__table(Arena *scratch, Vec2_i32 dim, Doc_Content_List *vals, FILE *out){ render_doc_page_to_html__table(Arena *scratch, Vec2_i32 dim, Doc_Content_List *vals, FILE *out){
fprintf(out, "<table class=\"normal\">");
for (i32 y = 0; y < dim.y; y += 1){
fprintf(out, "<tr>");
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, "<td>");
render_doc_page_to_html__content_list(scratch, cont, out);
fprintf(out, "</td>");
}
fprintf(out, "</tr>");
}
fprintf(out, "</table>");
} }
function void function void

View File

@ -67,6 +67,10 @@ pre {
text-align: justify; text-align: justify;
} }
table.normal td {
padding-right: 1em;
}
.normal li { .normal li {
text-align: left; text-align: left;
} }

View File

@ -36,6 +36,10 @@ li.firstli {
margin-top: 0px; margin-top: 0px;
} }
table.normal tr {
}
.normal a:link, a:link { .normal a:link, a:link {
color: #D08F20; color: #D08F20;
} }
@ -127,6 +131,10 @@ li.firstli {
<div class="spacer"></div> <div class="spacer"></div>
<div class="comment"><a href="docs/bindings.html">Built in Bindings</a></div>
<div class="spacer"></div>
<div class="center"> <div class="center">
<h2>Demo Clips for 4coder 4.1.0</h2> <h2>Demo Clips for 4coder 4.1.0</h2>
<iframe width="560" height="315" src="https://www.youtube.com/embed/OdYvIGMTBBA" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> <iframe width="560" height="315" src="https://www.youtube.com/embed/OdYvIGMTBBA" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>