diff --git a/book/style.css b/book/style.css
index 02bcbc5..e417270 100644
--- a/book/style.css
+++ b/book/style.css
@@ -6,12 +6,15 @@
--fw-bold: 800;
--f-lh: 28px;
--c-black: #282828;
+ --c-black-background: #1c1819;
--fs-xxxl: 32px;
--fs-xxl: 26px;
--fs-xl: 24px;
--fs-l: 22px;
--fs-m: 16px;
--padding-hamburger: 5px;
+ --c-beige: #F3EDE6;
+ --border-radius: 7px;
}
@media (min-width: 1200px){
@@ -38,6 +41,7 @@ body{
font-family: var(--ff-sans);
font-weight: var(--fw-regular);
font-size: var(--fs-m);
+ color: var(--c-black);
}
@media screen and (min-width: 57rem) {
@@ -60,7 +64,6 @@ body{
/* ****************** */
main.main-content,main.titlepage,div.footnotes{
- padding:1rem;
}
.permalink {
@@ -144,7 +147,7 @@ nav.TOC a, nav.TOC a:visited{
body{
- background-color: var(--c-black);
+ background-color: var(--c-beige);
}
a {
@@ -174,6 +177,7 @@ figure.texsource, figure.shellcommand, figure.htmlsource, figure.luasource, figu
.main-content {
line-height: var(--f-lh);
+ margin-left: 30px;
}
div.footnotes {
@@ -229,6 +233,7 @@ figcaption.caption {
list-style: none;
margin: 0;
padding: 0;
+ width: 300px;
}
.menu-items .chapterToc, .menu-items .likechapterToc {
@@ -331,7 +336,7 @@ div.center {
margin-right: 0 !important;
}
-main.titlepage h2.chapterHead {
+main.main-content h2.chapterHead, main.main-content h2.likechapterHead {
margin-top: 0px;
}
@@ -379,3 +384,205 @@ h4 {
max-width: 100%;
margin-top: 1em;
}
+
+img[alt~="PIC"], iframe, a img {
+ border-radius: var(--border-radius);
+ border: 2px solid var(--c-black);
+}
+
+main.main-content, div.footnotes, main.titlepage {
+ background-color: var(--c-beige);
+}
+
+.main-content {
+ flex: 1;
+}
+
+.wrapper {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.header {
+ background-color: var(--c-black-background);
+ width: 100%;
+ height: 340px;
+ display: flex;
+ align-content: center;
+ justify-content: center;
+ align-items: center;
+ margin-bottom: 40px;
+}
+
+.header img {
+ border-radius: 0px;
+ border: none;
+ width: 710px;
+}
+
+body {
+ display: block;
+}
+
+.book-content {
+ display: flex;
+ padding: 0px 40px;
+ max-width: 1200px;
+}
+
+.TOC.menu {
+ width: 330px;
+}
+
+.main-content {
+ width: 100%;
+ margin-bottom: 40px;
+}
+
+nav.TOC, nav.TOC a, nav.TOC a:visited {
+ background-color: transparent;
+ color: var(--c-black);
+}
+
+.menu-group {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.menu-inner {
+ border: 2px solid var(--c-black);
+ border-radius: var(--border-radius);
+ width: 100%;
+}
+
+.menu-entry {
+ padding: 1px;
+ border-radius: var(--border-radius);
+}
+
+.menu-arrow {
+ width: 14px;
+ border: none;
+ border-radius: 0px;
+}
+
+nav.TOC span:hover, nav.TOC span:hover *, nav.TOC span.chapterToc.selected, nav.TOC span.chapterToc.selected a {
+ background-color: transparent;
+}
+
+.menu-entry:hover {
+ background-color: #c8c8c8;
+}
+
+p.flowchart-image-wrapper {
+ background: white;
+ padding: 20px;
+}
+
+.menu-items .menu-group:last-of-type .menu-arrow {
+ display: none;
+}
+
+blockquote {
+ margin-left: 0px;
+ margin-right: 0px;
+}
+
+.crosslinks-bottom {
+ margin-top: 1em;
+}
+
+.crosslinks-bottom a {
+ display: inline-block;
+ border-radius: var(--border-radius);
+ border: 2px solid var(--c-black);
+ color: var(--c-black);
+ padding: 4px;
+ font-weight: bold;
+ text-decoration: none;
+}
+.crosslinks-bottom a.prev {
+ margin-right: 7px;
+}
+
+.crosslinks-bottom a:hover {
+ color: #444;
+}
+
+.menu-group.selected .menu-inner {
+ background-color: #c8c8c8;
+}
+
+.TOC.menu {
+ margin-bottom: 40px;
+}
+
+.mobile-banner {
+ display: none;
+}
+
+@media (max-width: 768px) {
+ .header {
+ display: none;
+ }
+
+ .book-content {
+ padding: 0px;
+ display: flex;
+ width: 100%;
+ flex-direction: column;
+ }
+
+ .main-content {
+ width: 100%;
+ margin-left: 0px;
+ box-sizing: border-box;
+ padding: 0px 14px;
+ margin-top: 20px;
+ max-width: 100%;
+ }
+
+ .TOC.menu {
+ width: 100%;
+ max-width: 100%;
+ background: var(--c-black-background);
+ box-sizing: border-box;
+ }
+
+ nav.TOC, nav.TOC a, nav.TOC a:visited {
+ color: #fff;
+ }
+ .menu-arrow {
+ display: none;
+ }
+
+ .menu-inner {
+ border: none;
+ border-radius: 0px;
+ }
+
+ .menu-group.selected .menu-inner {
+ background: var(--c-black-background);
+ }
+
+ p.flowchart-image-wrapper {
+ padding: 0px;
+ }
+
+ .menu-entry:hover {
+ background-color: transparent;
+ }
+
+ .TOC.menu {
+ margin-bottom: 0px;
+ }
+
+ .mobile-banner {
+ display: block;
+ background-color: var(--c-black-background);
+ padding: 5px;
+ }
+}
diff --git a/website/assets/arrow.png b/website/assets/arrow.png
new file mode 100644
index 0000000..f816223
Binary files /dev/null and b/website/assets/arrow.png differ
diff --git a/website/assets/banner.png b/website/assets/banner.png
new file mode 100644
index 0000000..86c8eec
Binary files /dev/null and b/website/assets/banner.png differ
diff --git a/website/modify_build.rb b/website/modify_build.rb
index f212d66..bf0cd43 100644
--- a/website/modify_build.rb
+++ b/website/modify_build.rb
@@ -52,20 +52,26 @@ class ModifyBuild
text = fix_titles(text)
text = fix_menu(text)
text = fix_cover_page(text) if is_cover_page?(filename)
+ text = add_header_banner(text)
text = add_home_link_to_menu(text)
text = fix_anchor_hyperlinks_menu(text)
text = add_favicon(text)
text = add_meta_tags(text, filename)
text = remove_section_table_of_contents(text)
- text = mark_menu_as_selected_if_on_page(text, extract_file_from_path(filename))
text = add_canonical_for_duplicates(text, extract_file_from_path(filename))
text = include_javascript(text)
text = add_text_to_coverpage(text, extract_file_from_path(filename))
text = fix_js_dependency_link(text)
text = fix_list_of_tables_figures_duplicates(text)
text = add_anchors_to_headers(text)
- text = fix_https_links(text)
+ text = create_menu_groups(text)
+ text = fix_top_links(text)
+ text = fix_flowchart_background(text)
+ text = remove_empty_menu_links(text)
+ text = fix_bottom_cross_links(text)
+ text = insert_mobile_header_graphic(text)
text = add_anchors_to_glossary_items(text) if is_glossary_page?(filename)
+ text = mark_menu_as_selected_if_on_page(text, extract_file_from_path(filename))
text = fix_menus_list_figures_tables(text) if is_list_figures_tables?(filename)
text = fix_list_of_figures_tables_display(text) if is_list_figures_tables?(filename)
File.open(filename, "w:UTF-8") {|file| file.puts text }
@@ -152,6 +158,45 @@ class ModifyBuild
doc.to_html
end
+ def create_menu_groups(text)
+ doc = build_doc(text)
+ groups = build_groups(doc.css(".menu-items > span"))
+ menu_el = doc.css(".menu-items")[0]
+ html = ""
+ groups.each do |group|
+ out = ""
+ group.each do |g|
+ if g.to_html.length > 0
+ out += %Q{
}
+ end
+ end
+ html += %Q{}
+ end
+ menu_el.inner_html = html
+ doc.to_html
+ end
+
+ def build_groups(menu_items)
+ final_groups = []
+ tmp_groups = []
+ menu_items.each_with_index do |el, index|
+ # Get next item and check if it is a lower entry level in the menu.
+ next_item = menu_items[index + 1]
+ if next_item && next_item["class"].include?("chapterToc") || next_item.nil?
+ final_groups.push(tmp_groups.push(el))
+ tmp_groups = []
+ else
+ tmp_groups.push(el)
+ end
+ end
+ final_groups
+ end
+
# By default the titles look boring. This changes the titles of all the
# pages and adds the book name as appendix
def fix_titles(text)
@@ -237,7 +282,7 @@ class ModifyBuild
content = doc.css("body > .main-content")[0]
menu = doc.css("body > nav")[0]
content = %Q{
-
+
@@ -257,7 +302,7 @@ class ModifyBuild
menu = doc.css(".menu-items")[0]
return text if menu.nil?
- home_html = %Q{The Sourdough Framework}
+ home_html = %Q{🍞 The Sourdough Framework}
# Normally the flowcharts link should be automatically added, but there
# seems to be a problem in the generation. See:
# https://github.com/hendricius/the-sourdough-framework/pull/188 for more
@@ -268,12 +313,12 @@ class ModifyBuild
List of Flowcharts
-
+
-
+