From 9a1c840b36f2e283b01eb47e41c96e79b49ee853 Mon Sep 17 00:00:00 2001 From: wmat Date: Wed, 17 Apr 2024 09:57:09 -0400 Subject: [PATCH 1/9] Fix deprecated warnings. Commented out lines with deprecated variable references. Updated all variables to match theme in riscv-isa-manual repo. --- themes/riscv-pdf.yml | 77 ++++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/themes/riscv-pdf.yml b/themes/riscv-pdf.yml index 9a32790..499a68f 100644 --- a/themes/riscv-pdf.yml +++ b/themes/riscv-pdf.yml @@ -1,9 +1,8 @@ ---- extends: default font: catalog: merge: true -# sans-serif: GEM_FONTS_DIR/mplus1p-regular-fallback.ttf + sans-serif: GEM_FONTS_DIR/mplus1p-regular-fallback.ttf #Petrona body: normal: Petrona-Light.ttf @@ -76,19 +75,28 @@ codespan: #font_family: Droid Fallback font_family: M+ 1mn font_style: normal - font-size: 11.5 +# font-size: 11.5 menu_caret_content: ' ' heading: align: left - font_color: 3e058e + margin_bottom: $block_margin_bottom + #margin_top: 0.25in + margin_top: $block_margin_bottom + min_height_after: auto + #font_color: 3e058e + font_color: 000000 font_family: headings - font_style: light + font_style: bold h1_font_size: floor($base_font_size * 2.8) # h2 is used for chapter titles (book doctype only) - h2_font_size: floor($base_font_size * 2.15) - h3_font_size: round($base_font_size * 1.7) - h4_font_size: $base_font_size_large - h5_font_size: $base_font_size + # h2_font_size: floor($base_font_size * 2.15) + h2-font-size: 11.5 + #h3_font_size: round($base_font_size * 1.7) + h3-font-size: 11.5 + #h4_font_size: $base_font_size_large + h4-font-size: 11.5 + #h5_font_size: $base_font_size + h5-font-size: 11.5 h6_font_size: $base_font_size_small title_page: align: center @@ -104,6 +112,7 @@ title_page: font_family: headings font_style: light font_size: floor($base_font_size * 1.2) + margin-top: 25 authors: font_family: headings font_color: 3e058e @@ -151,7 +160,7 @@ sidebar-title: align: left admonition: font-style: italic - #column_rule_color: $base_border_color +# column_rule_color: $base_border_color column_rule_width: $base_border_width padding: [0, $horizontal_rhythm, 0, $horizontal_rhythm] icon: @@ -159,11 +168,13 @@ admonition: name: far-edit stroke_color: 6489b3 tip: - name: comments-o + # name: comments-o + name: far-comments stroke_color: 646b74 size: 24 important: - name: info + #name: info + name: fas-info-circle stroke_color: 5f8c8b warning: stroke_color: 9c4d4b @@ -184,17 +195,21 @@ admonition: # code is used for source blocks (perhaps change to source or listing?) code: # font_color: $base_font_color + font-color: 000000 font_family: $codespan_font_family #font_size: ceil($base_font_size) - font-size: 9 + font-size: 11 padding: $code_font_size line_height: 1.15 # line_gap is an experimental property to control how a background color is applied to an inline block element line_gap: 3.8 - background_color: f4f4fb - border_color: cccccc - border_radius: $base_border_radius - border_width: 0.2 + #background_color: f4f4fb + fackgroud_color: ffffff + #border_color: cccccc + #border_radius: $base_border_radius + #border_width: 0.2 + caption: + end: bottom conum: font_family: M+ 1mn font_color: $codespan_font_color @@ -209,6 +224,8 @@ example: padding: [$vertical_rhythm, $horizontal_rhythm, 0, $horizontal_rhythm] image: align: left + caption: + align: center prose: margin_top: $block_margin_top margin_bottom: $block_margin_bottom @@ -232,7 +249,7 @@ table: #head_background_color: #head_font_color: $base_font_color head_font_style: bold - font-size: 11.5 + font-size: 9 #body_background_color: body_stripe_background_color: d7d7d7 foot_background_color: f0f0f0 @@ -248,43 +265,33 @@ toc: indent: $horizontal_rhythm line_height: 1.4 dot_leader: - #content: ". " + content: " " font_color: a9a9a9 + font-style: bold #levels: 2 3 + h2-font-style: bold # NOTE in addition to footer, header is also supported header: font_size: $base_font_size_small - # NOTE if background_color is set, background and border will span width of page border_color: dddddd border_width: 0.35 height: $base_line_height_length * 2.6 line_height: 1 - padding: [$base_line_height_length / 1.3, 1, 0, 1] + padding: [$base_line_height_length / 1, 1, .5, 1] vertical_align: margin_inside - #image_vertical_align: or - # additional attributes for content: - # * {page-count} - # * {page-number} - # * {document-title} - # * {document-subtitle} - # * {chapter-title} - # * {section-title} - # * {section-or-chapter-title} recto: right: content: '{section-or-chapter-title} | Page {page-number}' verso: left: content: '{section-or-chapter-title} | Page {page-number}' - # left: 'Page {page-number} | {section-or-chapter-title}' footer: font_size: $base_font_size_small - # NOTE if background_color is set, background and border will span width of page border_color: dddddd - border_width: 0.25 - height: $base_line_height_length * 2.5 + border_width: 0.35 + height: $base_line_height_length * 2.6 line_height: 1 - padding: [$base_line_height_length / 2, 1, 0, 1] + padding: [$base_line_height_length / 1, 1, .5, 1] vertical_align: top #image_vertical_align: or # additional attributes for content: From db9f3007b87fd5b5c7053baffed8a68d28183595 Mon Sep 17 00:00:00 2001 From: wmat Date: Wed, 17 Apr 2024 10:40:05 -0400 Subject: [PATCH 2/9] Debugging yaml. Fixing yaml errors from linter. --- themes/riscv-pdf.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/riscv-pdf.yml b/themes/riscv-pdf.yml index 499a68f..69f7584 100644 --- a/themes/riscv-pdf.yml +++ b/themes/riscv-pdf.yml @@ -2,7 +2,7 @@ extends: default font: catalog: merge: true - sans-serif: GEM_FONTS_DIR/mplus1p-regular-fallback.ttf + sans-serif: GEM_FONTS_DIR/mplus1p-regular-fallback.ttf #Petrona body: normal: Petrona-Light.ttf @@ -170,8 +170,8 @@ admonition: tip: # name: comments-o name: far-comments - stroke_color: 646b74 - size: 24 + stroke_color: 646b74 + size: 24 important: #name: info name: fas-info-circle From 478dd823e42a5e993c5df4a1f649829fb7aa7ff4 Mon Sep 17 00:00:00 2001 From: wmat Date: Wed, 17 Apr 2024 10:44:06 -0400 Subject: [PATCH 3/9] More yaml linting fixes. Fixing yaml errors found by pre-commit. --- themes/riscv-pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/riscv-pdf.yml b/themes/riscv-pdf.yml index 69f7584..80aef4f 100644 --- a/themes/riscv-pdf.yml +++ b/themes/riscv-pdf.yml @@ -169,7 +169,7 @@ admonition: stroke_color: 6489b3 tip: # name: comments-o - name: far-comments + name: far-comments stroke_color: 646b74 size: 24 important: From 18d9f701ccfee46c66674a34f8b113f8ba15a4e6 Mon Sep 17 00:00:00 2001 From: wmat Date: Wed, 17 Apr 2024 10:47:05 -0400 Subject: [PATCH 4/9] Fixing more linting errors. Fixing errors found by pre-commit. --- themes/riscv-pdf.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/riscv-pdf.yml b/themes/riscv-pdf.yml index 80aef4f..334caa6 100644 --- a/themes/riscv-pdf.yml +++ b/themes/riscv-pdf.yml @@ -265,11 +265,11 @@ toc: indent: $horizontal_rhythm line_height: 1.4 dot_leader: - content: " " - font_color: a9a9a9 - font-style: bold + content: " " + font_color: a9a9a9 + font-style: bold #levels: 2 3 - h2-font-style: bold + h2-font-style: bold # NOTE in addition to footer, header is also supported header: font_size: $base_font_size_small From 6ffbbf1e123a39d1f8dc3e802c17ae54e3d927a8 Mon Sep 17 00:00:00 2001 From: wmat Date: Wed, 17 Apr 2024 10:51:54 -0400 Subject: [PATCH 5/9] Fixing more linting errors. Fixing more errors found by pre-commit. --- themes/riscv-pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/riscv-pdf.yml b/themes/riscv-pdf.yml index 334caa6..3cc496f 100644 --- a/themes/riscv-pdf.yml +++ b/themes/riscv-pdf.yml @@ -265,7 +265,7 @@ toc: indent: $horizontal_rhythm line_height: 1.4 dot_leader: - content: " " + content: ' ' font_color: a9a9a9 font-style: bold #levels: 2 3 From 26f54322eaf6180b4588c87cfb3b2eb4b40d7030 Mon Sep 17 00:00:00 2001 From: wmat Date: Wed, 17 Apr 2024 10:55:31 -0400 Subject: [PATCH 6/9] Fix toc-dot leader Fix toc-dot-leader --- themes/riscv-pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/riscv-pdf.yml b/themes/riscv-pdf.yml index 3cc496f..bbb1648 100644 --- a/themes/riscv-pdf.yml +++ b/themes/riscv-pdf.yml @@ -265,7 +265,7 @@ toc: indent: $horizontal_rhythm line_height: 1.4 dot_leader: - content: ' ' + content: ". " font_color: a9a9a9 font-style: bold #levels: 2 3 From e38c906b7df7d82eac41e06a0e84749354e2482d Mon Sep 17 00:00:00 2001 From: wmat Date: Wed, 17 Apr 2024 11:00:22 -0400 Subject: [PATCH 7/9] Trying to get dot-leader past pre-commit Trying to get dot-leader past pre-commit --- themes/riscv-pdf.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/riscv-pdf.yml b/themes/riscv-pdf.yml index bbb1648..9ab3043 100644 --- a/themes/riscv-pdf.yml +++ b/themes/riscv-pdf.yml @@ -264,8 +264,8 @@ table: toc: indent: $horizontal_rhythm line_height: 1.4 - dot_leader: - content: ". " + dot-leader: + content: ". " font_color: a9a9a9 font-style: bold #levels: 2 3 From f0e58c58ea9e20f28dc14811f1dfedcac81d9a01 Mon Sep 17 00:00:00 2001 From: wmat Date: Wed, 17 Apr 2024 11:15:18 -0400 Subject: [PATCH 8/9] Cleaning up yaml Clenaing up theme file yaml --- themes/riscv-pdf.yml | 107 ++++++++++++------------------------------- 1 file changed, 29 insertions(+), 78 deletions(-) diff --git a/themes/riscv-pdf.yml b/themes/riscv-pdf.yml index 9ab3043..a22d3ab 100644 --- a/themes/riscv-pdf.yml +++ b/themes/riscv-pdf.yml @@ -3,14 +3,12 @@ font: catalog: merge: true sans-serif: GEM_FONTS_DIR/mplus1p-regular-fallback.ttf - #Petrona body: normal: Petrona-Light.ttf bold: Petrona-Medium.ttf italic: Petrona-LightItalic.ttf bold_italic: Petrona-MediumItalic.ttf header_thin: Petrona-Thin.ttf - #Montserrat headings: normal: Montserrat-Regular.ttf italic: Montserrat-Italic.ttf @@ -21,7 +19,6 @@ font: bold: cmunbtl.ttf italic: cmunbto.ttf bold_italic: cmunbto.ttf - # M+ 1mn supports ASCII and the circled numbers used for conums M+ 1mn: normal: mplus-1mn-regular.ttf bold: mplus-1mn-bold.ttf @@ -37,8 +34,6 @@ font: italic: droid-sans-fallback.ttf bold: droid-sans-fallback.ttf bold_italic: droid-sans-fallback.ttf - # M+ 1p supports Latin, Latin-1 Supplement, Latin Extended, Greek, Cyrillic, Vietnamese, Japanese & an assortment of symbols - # It also provides arrows for ->, <-, => and <= replacements in case these glyphs are missing from font fallbacks: - M+ 1p Fallback - Droid Fallback @@ -47,8 +42,11 @@ font: page: background_color: ffffff layout: portrait - margin: [0.5in, 0.67in, 0.67in, 0.67in] - # margin_inner and margin_outer keys are used for recto/verso print margins when media=prepress + margin: + - 0.5in + - 0.67in + - 0.67in + - 0.67in margin_inner: 0.75in margin_outer: 0.59in size: A4 @@ -64,38 +62,26 @@ base: border_width: 0.25 vertical_rhythm: $base_line_height_length horizontal_rhythm: $base_line_height_length - # QUESTION should vertical_spacing be block_spacing instead? vertical_spacing: $vertical_rhythm link: font_color: 428bca - # codespan is currently used for inline monospaced in prose and table cells codespan: - font-color: 000000 - #font_family: code - #font_family: Droid Fallback + font-color: 0 font_family: M+ 1mn font_style: normal -# font-size: 11.5 menu_caret_content: ' ' heading: align: left margin_bottom: $block_margin_bottom - #margin_top: 0.25in margin_top: $block_margin_bottom min_height_after: auto - #font_color: 3e058e - font_color: 000000 + font_color: 0 font_family: headings font_style: bold h1_font_size: floor($base_font_size * 2.8) - # h2 is used for chapter titles (book doctype only) - # h2_font_size: floor($base_font_size * 2.15) h2-font-size: 11.5 - #h3_font_size: round($base_font_size * 1.7) h3-font-size: 11.5 - #h4_font_size: $base_font_size_large h4-font-size: 11.5 - #h5_font_size: $base_font_size h5-font-size: 11.5 h6_font_size: $base_font_size_small title_page: @@ -127,9 +113,7 @@ caption: align: left font_size: $base_font_size * 0.95 font_style: italic - # FIXME perhaps set line_height instead of / in addition to margins? margin_inside: $vertical_rhythm / 3 - #margin_inside: $vertical_rhythm / 4 margin_outside: 0 lead: font_size: $base_font_size_large @@ -160,20 +144,21 @@ sidebar-title: align: left admonition: font-style: italic -# column_rule_color: $base_border_color column_rule_width: $base_border_width - padding: [0, $horizontal_rhythm, 0, $horizontal_rhythm] + padding: + - 0 + - $horizontal_rhythm + - 0 + - $horizontal_rhythm icon: note: name: far-edit stroke_color: 6489b3 tip: - # name: comments-o name: far-comments stroke_color: 646b74 size: 24 important: - #name: info name: fas-info-circle stroke_color: 5f8c8b warning: @@ -183,31 +168,14 @@ admonition: label: text_transform: uppercase font_style: bold -#blockquote: -# font_color: $base_font_color -# font_size: $base_font_size_large -# border_color: $base_border_color -# border_width: 2 -# FIXME disable negative padding bottom once margin collapsing is implemented -# padding: [0, $horizontal_rhythm, $block_margin_bottom * -0.75, $horizontal_rhythm + $blockquote_border_width / 2] -# cite_font_size: $base_font_size_small -# cite_font_color: 51278d -# code is used for source blocks (perhaps change to source or listing?) code: -# font_color: $base_font_color - font-color: 000000 + font-color: 0 font_family: $codespan_font_family - #font_size: ceil($base_font_size) font-size: 11 padding: $code_font_size line_height: 1.15 - # line_gap is an experimental property to control how a background color is applied to an inline block element line_gap: 3.8 - #background_color: f4f4fb fackgroud_color: ffffff - #border_color: cccccc - #border_radius: $base_border_radius - #border_width: 0.2 caption: end: bottom conum: @@ -216,12 +184,14 @@ conum: font_size: $base_font_size line_height: 4 / 3 example: -# border_color: $base_border_color border_radius: $base_border_radius border_width: 0.2 background_color: ffffff - # FIXME reenable padding bottom once margin collapsing is implemented - padding: [$vertical_rhythm, $horizontal_rhythm, 0, $horizontal_rhythm] + padding: + - $vertical_rhythm + - $horizontal_rhythm + - 0 + - $horizontal_rhythm image: align: left caption: @@ -230,7 +200,6 @@ prose: margin_top: $block_margin_top margin_bottom: $block_margin_bottom thematic_break: -# border_color: $base_border_color border_style: solid border_width: $base_border_width margin_top: $vertical_rhythm * 0.5 @@ -241,16 +210,11 @@ description_list: description_indent: $horizontal_rhythm * 1.25 list: indent: $horizontal_rhythm * 1.5 - #marker_font_color: 404040 - # NOTE outline_list_item_spacing applies to list items that do not have complex content item_spacing: $vertical_rhythm / 2 table: background_color: $page_background_color - #head_background_color: - #head_font_color: $base_font_color head_font_style: bold font-size: 9 - #body_background_color: body_stripe_background_color: d7d7d7 foot_background_color: f0f0f0 border_color: dddddd @@ -265,19 +229,21 @@ toc: indent: $horizontal_rhythm line_height: 1.4 dot-leader: - content: ". " + content: '. ' font_color: a9a9a9 font-style: bold - #levels: 2 3 h2-font-style: bold -# NOTE in addition to footer, header is also supported header: font_size: $base_font_size_small border_color: dddddd border_width: 0.35 height: $base_line_height_length * 2.6 line_height: 1 - padding: [$base_line_height_length / 1, 1, .5, 1] + padding: + - $base_line_height_length / 1 + - 1 + - 0.5 + - 1 vertical_align: margin_inside recto: right: @@ -291,30 +257,15 @@ footer: border_width: 0.35 height: $base_line_height_length * 2.6 line_height: 1 - padding: [$base_line_height_length / 1, 1, .5, 1] + padding: + - $base_line_height_length / 1 + - 1 + - 0.5 + - 1 vertical_align: top - #image_vertical_align: or - # additional attributes for content: - # content: '{company}' - # * {page-count} - # * {page-number} - #center: - #content: '{document-title}' - # * {document-subtitle} - # * {chapter-title} - # * {section-title} - # * {section-or-chapter-title} recto: - #columns: "<50% =0% >50%" right: - #content: '{page-number}' content: '{document-title} | © RISC-V International' - #content: '{document-title} | © RISC-V' - #center: '{page-number}' - #content: '{revdate}' verso: - #columns: $footer_recto_columns left: content: $footer_recto_right_content - #center: '{page-number}' - #content: '{page-number}' From e7891a9d3ba1e4ba4ddec5187b6d29db62f92db2 Mon Sep 17 00:00:00 2001 From: wmat Date: Wed, 17 Apr 2024 11:40:30 -0400 Subject: [PATCH 9/9] Trying to fix pre-commit issue Pre-commit still errors on theme --- themes/riscv-pdf.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/riscv-pdf.yml b/themes/riscv-pdf.yml index a22d3ab..9a9705c 100644 --- a/themes/riscv-pdf.yml +++ b/themes/riscv-pdf.yml @@ -1,3 +1,4 @@ +--- extends: default font: catalog: