j1-template 2022.5.1.rc1 → 2022.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/procedures/layouts/module_writer.proc +1 -1
- data/assets/data/banner.html +2 -2
- data/assets/data/panel.html +4 -4
- data/assets/themes/j1/adapter/js/attic.js +19 -2
- data/assets/themes/j1/adapter/js/rtable.js +68 -5
- data/assets/themes/j1/adapter/js/scroller.js +7 -0
- data/assets/themes/j1/core/css/vendor.css +5 -6
- data/assets/themes/j1/core/css/vendor.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +2 -1
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/jquery/js/extensions/hasClass.js +20 -0
- data/assets/themes/j1/modules/jquery/js/extensions/removeClass.js +24 -0
- data/assets/themes/j1/modules/rtable/js/rtable.js +22 -16
- data/assets/themes/j1/modules/rtable/js/rtable.min.js +1 -1
- data/assets/themes/j1/modules/themeSwitcher/LICENSE +21 -21
- data/assets/themes/j1/modules/themeSwitcher/README.md +166 -166
- data/lib/j1/commands/app.rb +36 -0
- data/lib/j1/commands/generate.rb +1 -1
- data/lib/j1/commands/patch.rb +1 -1
- data/lib/j1/commands/rebuild.rb +1 -1
- data/lib/j1/commands/reset.rb +1 -1
- data/lib/j1/commands/setup.rb +1 -1
- data/lib/j1/commands/site.rb +1 -1
- data/lib/j1/version.rb +1 -1
- data/lib/j1_app.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/asciidoc2pdf/images/cover/readme +39 -0
- data/lib/starter_web/_data/asciidoc2pdf/themes/base-theme.yml +113 -117
- data/lib/starter_web/_data/asciidoc2pdf/themes/default-for-print-theme.yml +25 -24
- data/lib/starter_web/_data/asciidoc2pdf/themes/default-for-print-with-fallback-font-theme.yml +1 -0
- data/lib/starter_web/_data/asciidoc2pdf/themes/default-theme.yml +215 -212
- data/lib/starter_web/_data/asciidoc2pdf/themes/default-with-fallback-font-theme.yml +9 -5
- data/lib/starter_web/_data/asciidoc2pdf/themes/j1-theme.yml +24 -5
- data/lib/starter_web/_data/blocks/banner.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/rtable.yml +12 -1
- data/lib/starter_web/_data/puma/config.rb +3 -0
- data/lib/starter_web/_data/resources.yml +4 -2
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/assets/images/banner/1280x600/lunr.jpg +0 -0
- data/lib/starter_web/assets/images/{modules/attics/banner/library-1920x800-bw.jpg → banner/1920x800/library.jpg} +0 -0
- data/lib/starter_web/assets/images/banner/scalable/readme +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/{ev.jpg → _ev.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/_guillaume-bolduc.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/crawford-jolly.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/josh-liu.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/kristopher-roller.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/moritz-kindler.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/nasa.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/{alexander-redl.jpg → _alexander-redl.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{alexander-shatov-1920x1280.jpg → _alexander-shatov-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{annie-spratt-1920x1280.jpg → _annie-spratt-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{antonino-visalli-1920x1280.jpg → _antonino-visalli-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{christa-dodoo-1920x1280.jpg → _christa-dodoo-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{guillaume-bolduc-1920x1280.jpg → _guillaume-bolduc-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{harpal-singh.jpg → _harpal-singh.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{humble-lamb-1920x1280.jpg → _humble-lamb-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{john-schnobrich-2-1920x1280.jpg → _john-schnobrich-2-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{kirklai-1920x1280.jpg → _kirklai-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{romain-vignes-1920x1280.jpg → _romain-vignes-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{runner-1920x1200.jpg → _runner-1920x1200.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{spacex-1920x1280.jpg → _spacex-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/_vladislav-klapin-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/{wrongtog-1920x1280.jpg → _wrongtog-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/{building-blocks-1920x1280-bw.jpg → building-blocks-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/lunr-1280x800.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/{shubham-dhage-2-1920x1280.jpg → shubham-dhage-1920x1280.jpg} +0 -0
- data/lib/starter_web/assets/images/modules/attics/vladislav-klapin-1920x1280.jpg +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/2022-02-01-about-j1.adoc +2 -2
- data/lib/starter_web/index.html +23 -18
- data/lib/starter_web/package.json +5 -4
- data/lib/starter_web/pages/public/about/features.adoc +9 -4
- data/lib/starter_web/pages/public/about/reporting_issues.adoc +9 -5
- data/lib/starter_web/pages/public/about/site.adoc +8 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/000_intro.adoc +5 -3
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +3 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +3 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/attributes.asciidoc +2 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/{100_converter/000_basic_example.asciidoc → 000_examples/basic_example.asciidoc} +1 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/111_about_the_converter.asciidoc +20 -11
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/112_getting_started.asciidoc +76 -24
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/211_language_overview.asciidoc +33 -29
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/212_values.asciidoc +67 -88
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/213_fonts.asciidoc +40 -39
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/images/readme +1 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/tables/math_expressions.asciidoc +19 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/tables/measurement_units.asciidoc +22 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +20 -5
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/100_chapter.asciidoc +5 -325
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/200_chapter.asciidoc +3 -134
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/images/readme +1 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/build_command_options.asciidoc +72 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/files_and_folders.asciidoc +66 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/global_configuration_options.asciidoc +63 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/global_variables.asciidoc +26 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/page_variables.asciidoc +54 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/serve_command_options.asciidoc +45 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/tables/site_variables.asciidoc +59 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +21 -7
- data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +124 -122
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +3 -3
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +3 -3
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +3 -3
- data/lib/starter_web/pages/public/blog/navigator/archive.html +3 -3
- data/lib/starter_web/pages/public/blog/navigator/index.html +3 -3
- data/lib/starter_web/pages/public/features/general.adoc +4 -4
- data/lib/starter_web/pages/public/features/template.adoc +1 -2
- data/lib/starter_web/pages/public/learn/quickstart.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/{400_asciidoc_extensions.adoc → asciidoc_extensions.adoc} +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/{410_bs_modals_extentions.adoc → bs_modals_extentions.adoc} +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/{300_icon_fonts.adoc → icon_fonts.adoc} +1 -2
- data/lib/starter_web/pages/public/learn/roundtrip/{100_present_images.adoc → present_images.adoc} +10 -10
- data/lib/starter_web/pages/public/learn/roundtrip/{100_present_videos.adoc → present_videos.adoc} +0 -0
- data/lib/starter_web/pages/public/learn/roundtrip/{600_quicksearch.adoc → quicksearch.adoc} +6 -7
- data/lib/starter_web/pages/public/learn/roundtrip/{420_responsive_tables_extensions.adoc → responsive_tables_extensions.adoc} +86 -73
- data/lib/starter_web/pages/public/learn/roundtrip/{500_themes.adoc → themes.adoc} +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/{200_typography.adoc → typography.adoc} +6 -6
- data/lib/starter_web/pages/public/learn/where_to_go.adoc +2 -2
- data/lib/starter_web/pages/public/legal/de/100_copyright.adoc +3 -2
- data/lib/starter_web/pages/public/legal/de/100_impress.adoc +3 -2
- data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +3 -2
- data/lib/starter_web/pages/public/legal/de/400_comment_policy.adoc +3 -2
- data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +3 -2
- data/lib/starter_web/pages/public/legal/en/200_impress.adoc +3 -2
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +3 -2
- data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +3 -2
- data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +2 -2
- data/lib/starter_web/pages/public/plans/plans.adoc +2 -2
- data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +5 -5
- data/lib/starter_web/pages/public/se/se-fake.adoc +2 -2
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +58 -40
- data/lib/starter_web/assets/images/modules/attics/1920x1280/ben-kolde.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/braden-collum.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/firmbee-com.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/1920x1280/max-harlynking.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/admin-dashboard-bootstrap-1280x800-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/lunr-banner-1280x800.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/franck-1920x12800.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/vladislav-klapin-2-1920x1280.jpg +0 -0
@@ -33,29 +33,29 @@ The theme file must be named _<name>-theme.yml_, where `<name>` is the name
|
|
33
33
|
of the theme. Here's an example of a basic theme file:
|
34
34
|
|
35
35
|
.basic-theme.yml
|
36
|
-
[source,yaml]
|
36
|
+
[source, yaml]
|
37
37
|
----
|
38
38
|
page:
|
39
|
-
layout:
|
40
|
-
margin:
|
41
|
-
size:
|
39
|
+
layout: portrait
|
40
|
+
margin: [0.75in, 1in, 0.75in, 1in]
|
41
|
+
size: Letter
|
42
42
|
base:
|
43
|
-
font_color:
|
44
|
-
font_family:
|
45
|
-
font_size:
|
43
|
+
font_color: '#333333'
|
44
|
+
font_family: Times-Roman
|
45
|
+
font_size: 12
|
46
46
|
line_height_length: 17
|
47
|
-
line_height:
|
48
|
-
vertical_spacing:
|
47
|
+
line_height: $base_line_height_length / $base_font_size
|
48
|
+
vertical_spacing: $base_line_height_length
|
49
49
|
heading:
|
50
|
-
font_color:
|
51
|
-
font_size:
|
52
|
-
font_style:
|
53
|
-
line_height:
|
54
|
-
margin_bottom:
|
50
|
+
font_color: '#262626'
|
51
|
+
font_size: 17
|
52
|
+
font_style: bold
|
53
|
+
line_height: 1.2
|
54
|
+
margin_bottom: $vertical_spacing
|
55
55
|
link:
|
56
|
-
font_color:
|
56
|
+
font_color: '#002FA7'
|
57
57
|
outline_list:
|
58
|
-
indent:
|
58
|
+
indent: $base_font_size * 1.5
|
59
59
|
----
|
60
60
|
|
61
61
|
When creating a new theme, you only have to define the keys you want to
|
@@ -73,8 +73,12 @@ start hacking on it.
|
|
73
73
|
Alternatively, you can snag the file from your local installation using the
|
74
74
|
following command:
|
75
75
|
|
76
|
-
|
76
|
+
[source, sh]
|
77
|
+
----
|
78
|
+
ASCIIDOCTOR_PDF_DIR=`gem contents asciidoctor-pdf --show-install-dir`; \
|
77
79
|
cp "$ASCIIDOCTOR_PDF_DIR/data/themes/default-theme.yml" custom-theme.yml
|
80
|
+
----
|
81
|
+
|
78
82
|
====
|
79
83
|
|
80
84
|
Keys may be nested to an arbitrary depth to eliminate redundant prefixes (an
|
@@ -89,33 +93,33 @@ name (e.g., `font_color`) into a single, qualified key (e.g., `link_font_color`)
|
|
89
93
|
For example, let's assume we want to set the base (i.e., global) font size
|
90
94
|
and color. These keys may be written longhand:
|
91
95
|
|
92
|
-
[source,yaml]
|
96
|
+
[source, yaml]
|
93
97
|
----
|
94
|
-
base_font_color:
|
95
|
-
base_font_family:
|
96
|
-
base_font_size:
|
98
|
+
base_font_color: '#333333'
|
99
|
+
base_font_family: Times-Roman
|
100
|
+
base_font_size: 12
|
97
101
|
----
|
98
102
|
|
99
103
|
Or, to avoid having to type the prefix `base_` multiple times, the keys may
|
100
104
|
be written hierarchically:
|
101
105
|
|
102
|
-
[source,yaml]
|
106
|
+
[source, yaml]
|
103
107
|
----
|
104
108
|
base:
|
105
|
-
font_color:
|
106
|
-
font_family:
|
107
|
-
font_size:
|
109
|
+
font_color: '#333333'
|
110
|
+
font_family: Times-Roman
|
111
|
+
font_size: 12
|
108
112
|
----
|
109
113
|
|
110
114
|
Or even:
|
111
115
|
|
112
|
-
[source,yaml]
|
116
|
+
[source, yaml]
|
113
117
|
----
|
114
118
|
base:
|
115
119
|
font:
|
116
|
-
color:
|
117
|
-
family:
|
118
|
-
size:
|
120
|
+
color: '#333333'
|
121
|
+
family: Times-Roman
|
122
|
+
size: 12
|
119
123
|
----
|
120
124
|
|
121
125
|
Each level of nesting must be indented by two more spaces of indentation than
|
@@ -10,17 +10,22 @@ The value of a key may be one of the following types:
|
|
10
10
|
- Image path
|
11
11
|
- Enumerated type (where specified)
|
12
12
|
- Text content (where specified)
|
13
|
+
|
13
14
|
* Null (clears any previously assigned value)
|
14
15
|
- _empty_ (i.e., no value specified)
|
15
16
|
- null
|
16
17
|
- ~
|
18
|
+
|
17
19
|
* Number (integer or float) with optional units (default unit is points)
|
20
|
+
|
18
21
|
* Array
|
19
22
|
- Color as RGB array (e.g., [51, 51, 51])
|
20
23
|
- Color CMYK array (e.g., [50, 100, 0, 0])
|
21
24
|
- Margin (e.g., [1in, 1in, 1in, 1in])
|
22
25
|
- Padding (e.g., [1in, 1in, 1in, 1in])
|
23
|
-
|
26
|
+
|
27
|
+
* Variable reference (e.g. `$base_font_color`)
|
28
|
+
|
24
29
|
* Math expression
|
25
30
|
|
26
31
|
Note that keys almost always require a value of a specific type, as documented
|
@@ -42,7 +47,7 @@ The following keys are inherited:
|
|
42
47
|
* font_style
|
43
48
|
* text_transform
|
44
49
|
* line_height (currently some exceptions)
|
45
|
-
* margin_bottom (if not specified, defaults to
|
50
|
+
* margin_bottom (if not specified, defaults to `$vertical_spacing`)
|
46
51
|
|
47
52
|
==== Heading Inheritance
|
48
53
|
|
@@ -51,7 +56,6 @@ Headings inherit starting from a specific heading level (e.g.,
|
|
51
56
|
`heading_font_size`), then directly to the base value (e.g., `base_font_size`).
|
52
57
|
Any setting from an enclosing context, such as a sidebar, is skipped.
|
53
58
|
|
54
|
-
|
55
59
|
=== Variables
|
56
60
|
|
57
61
|
To save you from having to type the same value in your theme over and over, or
|
@@ -67,10 +71,10 @@ the path the variable refers to must be *above* the usage of that variable.
|
|
67
71
|
|
68
72
|
For example, once the following line is processed,
|
69
73
|
|
70
|
-
[source,yaml]
|
74
|
+
[source, yaml]
|
71
75
|
----
|
72
76
|
base:
|
73
|
-
font_color:
|
77
|
+
font_color: '#333333'
|
74
78
|
----
|
75
79
|
|
76
80
|
the variable `$base_font_color` will be available for use in subsequent lines
|
@@ -78,25 +82,25 @@ and will resolve to `#333333`. Let's say you want to make the font color of the
|
|
78
82
|
sidebar title the same as the heading font color. Just assign the value
|
79
83
|
`$heading_font_color` to the `$sidebar_title_font_color`.
|
80
84
|
|
81
|
-
[source,yaml]
|
85
|
+
[source, yaml]
|
82
86
|
----
|
83
87
|
heading:
|
84
|
-
font_color:
|
88
|
+
font_color: '#191919'
|
85
89
|
sidebar:
|
86
90
|
title:
|
87
|
-
font_color:
|
91
|
+
font_color: $heading_font_color
|
88
92
|
----
|
89
93
|
|
90
94
|
You can also use variables in math expressions to use one value to build
|
91
95
|
another. This is commonly done to set font sizes proportionally.It also makes
|
92
96
|
it easy to test different values very quickly.
|
93
97
|
|
94
|
-
[source,yaml]
|
98
|
+
[source, yaml]
|
95
99
|
----
|
96
100
|
base:
|
97
|
-
font_size:
|
98
|
-
font_size_large:
|
99
|
-
font_size_small:
|
101
|
+
font_size: 12
|
102
|
+
font_size_large: $base_font_size * 1.25
|
103
|
+
font_size_small: $base_font_size * 0.85
|
100
104
|
----
|
101
105
|
|
102
106
|
We'll cover more about math expressions later.
|
@@ -113,9 +117,9 @@ For instance, here's how you can define your brand colors:
|
|
113
117
|
[source,yaml,subs=attributes+]
|
114
118
|
----
|
115
119
|
brand:
|
116
|
-
primary:
|
117
|
-
secondary:
|
118
|
-
alert:
|
120
|
+
primary: '#E0162B' <1>
|
121
|
+
secondary: '#FFFFFF' <2>
|
122
|
+
alert: '0052A5' <3>
|
119
123
|
----
|
120
124
|
<1> To align with CSS, you may add a `+#+` in front of the hex color value.
|
121
125
|
A YAML preprocessor is used to ensure the value is not treated as a comment
|
@@ -130,13 +134,13 @@ recommend that you always use either a leading `+#+` or surrounding quotes
|
|
130
134
|
|
131
135
|
You can now use these custom variables later in the theme file:
|
132
136
|
|
133
|
-
[source,yaml]
|
137
|
+
[source, yaml]
|
134
138
|
----
|
135
139
|
base:
|
136
|
-
font_color:
|
140
|
+
font_color: $brand_primary
|
137
141
|
----
|
138
142
|
|
139
|
-
=== Math Expressions
|
143
|
+
=== Math Expressions
|
140
144
|
|
141
145
|
The theme language supports basic math operations to support calculated values.
|
142
146
|
Like programming languages, multiple and divide take precedence over add and
|
@@ -145,42 +149,26 @@ subtract.
|
|
145
149
|
The following table lists the supported operations and the corresponding
|
146
150
|
operator for each.
|
147
151
|
|
148
|
-
[
|
149
|
-
|===
|
150
|
-
|Operation |Operator
|
151
|
-
|
152
|
-
|multiply
|
153
|
-
|*
|
154
|
-
|
155
|
-
|divide
|
156
|
-
|/
|
157
|
-
|
158
|
-
|add
|
159
|
-
|+
|
160
|
-
|
161
|
-
|subtract
|
162
|
-
|-
|
163
|
-
|
164
|
-
|===
|
152
|
+
include::../../tables/math_expressions.asciidoc[]
|
165
153
|
|
166
154
|
IMPORTANT: Operators must always be surrounded by a space on either side
|
167
155
|
(e.g., 2 + 2, not 2+2).
|
168
156
|
|
169
157
|
Here's an example of a math expression with fixed values.
|
170
158
|
|
171
|
-
[source,yaml]
|
159
|
+
[source, yaml]
|
172
160
|
----
|
173
161
|
conum:
|
174
|
-
line_height:
|
162
|
+
line_height: 4 / 3
|
175
163
|
----
|
176
164
|
|
177
165
|
Variables may be used in place of numbers anywhere in the expression:
|
178
166
|
|
179
|
-
[source,yaml]
|
167
|
+
[source, yaml]
|
180
168
|
----
|
181
169
|
base:
|
182
|
-
font_size:
|
183
|
-
font_size_large:
|
170
|
+
font_size: 12
|
171
|
+
font_size_large: $base_font_size * 1.25
|
184
172
|
----
|
185
173
|
|
186
174
|
Values used in a math expression are automatically coerced to a float value
|
@@ -201,11 +189,11 @@ ceil(...):: Rounds the number down the previous integer.
|
|
201
189
|
You might use these functions in font size calculations so that you get more
|
202
190
|
exact values.
|
203
191
|
|
204
|
-
[source,yaml]
|
192
|
+
[source, yaml]
|
205
193
|
----
|
206
194
|
base:
|
207
|
-
font_size:
|
208
|
-
font_size_large:
|
195
|
+
font_size: 12.5
|
196
|
+
font_size_large: ceil($base_font_size * 1.25)
|
209
197
|
----
|
210
198
|
|
211
199
|
=== Measurement Units
|
@@ -220,25 +208,7 @@ conversion for you automatically by adding a unit notation next to any number.
|
|
220
208
|
|
221
209
|
The following units are supported:
|
222
210
|
|
223
|
-
[
|
224
|
-
|===
|
225
|
-
|Unit |Suffix
|
226
|
-
|
227
|
-
|Centimeter
|
228
|
-
|cm
|
229
|
-
|
230
|
-
|Inches
|
231
|
-
|in
|
232
|
-
|
233
|
-
|Millimeter
|
234
|
-
|mm
|
235
|
-
|
236
|
-
|Percentage^[1]^
|
237
|
-
|%, vw, or vh
|
238
|
-
|
239
|
-
|Points
|
240
|
-
|pt (default)
|
241
|
-
|===
|
211
|
+
include::../../tables/measurement_units.asciidoc[]
|
242
212
|
|
243
213
|
A percentage with the % unit is calculated relative to the width or height
|
244
214
|
of the content area. Viewport-relative percentages (vw or vh units) are
|
@@ -253,10 +223,10 @@ could cause the converter to crash.
|
|
253
223
|
|
254
224
|
Here's an example of how you can use inches to define the page margins:
|
255
225
|
|
256
|
-
[source,yaml]
|
226
|
+
[source, yaml]
|
257
227
|
----
|
258
228
|
page:
|
259
|
-
margin:
|
229
|
+
margin: [0.75in, 1in, 0.75in, 1in]
|
260
230
|
----
|
261
231
|
|
262
232
|
The order of elements in a measurement array is the same as it is in CSS:
|
@@ -317,11 +287,18 @@ to transform contains characters beyond the Basic Latin character set (e.g.,
|
|
317
287
|
an accented character), you must install either the `activesupport` or the
|
318
288
|
`unicode` gem in order for those characters to be transformed.
|
319
289
|
|
320
|
-
|
290
|
+
[source, sh]
|
291
|
+
----
|
292
|
+
gem install activesupport
|
293
|
+
----
|
321
294
|
|
322
295
|
or
|
323
296
|
|
324
|
-
|
297
|
+
[source, sh]
|
298
|
+
----
|
299
|
+
gem install unicode
|
300
|
+
----
|
301
|
+
|
325
302
|
====
|
326
303
|
|
327
304
|
// Additional transforms, such as capitalize, may be added in the future.
|
@@ -352,26 +329,28 @@ value is entirely optional.
|
|
352
329
|
Regardless, we recommend that you always use either a leading `+#+` or
|
353
330
|
surrounding quotes (or both) to prevent YAML from mangling the value.
|
354
331
|
|
355
|
-
The following are all equivalent values for the color red
|
332
|
+
The following are all *equivalent* values for the color *red*:
|
356
333
|
|
357
|
-
[cols="8
|
334
|
+
[cols="8*.^"]
|
358
335
|
|===
|
336
|
+
|
359
337
|
|#ff0000
|
360
338
|
|#FF0000
|
361
|
-
|
|
362
|
-
|
|
339
|
+
|ff0000
|
340
|
+
|FF0000
|
363
341
|
|#f00
|
364
342
|
|#F00
|
365
|
-
|
|
366
|
-
|
|
343
|
+
|f00
|
344
|
+
|F00
|
345
|
+
|
367
346
|
|===
|
368
347
|
|
369
348
|
Here's how a hex color value appears in the theme file:
|
370
349
|
|
371
|
-
[source,yaml]
|
350
|
+
[source, yaml]
|
372
351
|
----
|
373
352
|
base:
|
374
|
-
font_color:
|
353
|
+
font_color: '#ff0000'
|
375
354
|
----
|
376
355
|
|
377
356
|
==== RGB
|
@@ -388,10 +367,10 @@ Here's how to specify the color red in RGB:
|
|
388
367
|
|
389
368
|
Here's how a RGB color value appears in the theme file:
|
390
369
|
|
391
|
-
[source,yaml]
|
370
|
+
[source, yaml]
|
392
371
|
----
|
393
372
|
base:
|
394
|
-
font_color:
|
373
|
+
font_color: [255, 0, 0]
|
395
374
|
----
|
396
375
|
|
397
376
|
==== CMYK
|
@@ -411,10 +390,10 @@ Here's how to specify the color red in CMYK:
|
|
411
390
|
|
412
391
|
Here's how a CMYK color value appears in the theme file:
|
413
392
|
|
414
|
-
[source,yaml]
|
393
|
+
[source, yaml]
|
415
394
|
----
|
416
395
|
base:
|
417
|
-
font_color:
|
396
|
+
font_color: [0, 0.99, 1, 0]
|
418
397
|
----
|
419
398
|
|
420
399
|
==== Transparent
|
@@ -422,10 +401,10 @@ base:
|
|
422
401
|
It's possible to specify no color by assigning the special value
|
423
402
|
`transparent`, as shown here:
|
424
403
|
|
425
|
-
[source,yaml]
|
404
|
+
[source, yaml]
|
426
405
|
----
|
427
406
|
base:
|
428
|
-
background_color:
|
407
|
+
background_color: transparent
|
429
408
|
----
|
430
409
|
|
431
410
|
=== Images
|
@@ -444,27 +423,27 @@ CAUTION: The GIF format (.gif) is not supported.
|
|
444
423
|
|
445
424
|
Here's how an image is specified in the theme file as a bare image path:
|
446
425
|
|
447
|
-
[source,yaml]
|
426
|
+
[source, yaml]
|
448
427
|
----
|
449
428
|
title_page:
|
450
|
-
background_image:
|
429
|
+
background_image: title-cover.png
|
451
430
|
----
|
452
431
|
|
453
432
|
Here's how the image is specified using the inline image macro:
|
454
433
|
|
455
|
-
[source,yaml]
|
434
|
+
[source, yaml]
|
456
435
|
----
|
457
436
|
title_page:
|
458
|
-
background_image:
|
437
|
+
background_image: 'image:title-cover.png[]'
|
459
438
|
----
|
460
439
|
|
461
440
|
Like in the AsciiDoc syntax, the inline image macro allows you to supply
|
462
441
|
set the width of the image and the alignment:
|
463
442
|
|
464
|
-
[source,yaml]
|
443
|
+
[source, yaml]
|
465
444
|
----
|
466
445
|
title_page:
|
467
|
-
logo_image:
|
446
|
+
logo_image: 'image:logo.png[width=250,align=center]'
|
468
447
|
----
|
469
448
|
|
470
449
|
=== Quoted String
|
@@ -488,9 +467,9 @@ element.
|
|
488
467
|
|
489
468
|
Here's an example of using formatting in the content of the menu caret:
|
490
469
|
|
491
|
-
[source,yaml]
|
470
|
+
[source, yaml]
|
492
471
|
----
|
493
|
-
menu_caret_content:
|
472
|
+
menu_caret_content: '<font size=\"1.15em\"><color rgb=\"#b12146\">\u203a</color></font>'
|
494
473
|
----
|
495
474
|
|
496
475
|
NOTE: The string must be double quoted in order to use a Unicode escape
|
@@ -15,7 +15,8 @@ work with extended characters without the right fonts in play.
|
|
15
15
|
|
16
16
|
The names of the built-in fonts (for general-purpose text) are as follows:
|
17
17
|
|
18
|
-
|
18
|
+
.Built-In Fonts
|
19
|
+
[cols="6a,6a", width="100%", options="header", role="rtable mt-4"]
|
19
20
|
|===
|
20
21
|
|Font Name |Font Family
|
21
22
|
|
@@ -34,10 +35,10 @@ Using a built-in font requires no additional files. You can use the key
|
|
34
35
|
anywhere a `font_family` property is accepted in the theme file.
|
35
36
|
For example:
|
36
37
|
|
37
|
-
[source,yaml]
|
38
|
+
[source, yaml]
|
38
39
|
----
|
39
40
|
base:
|
40
|
-
font_family:
|
41
|
+
font_family: Times-Roman
|
41
42
|
----
|
42
43
|
|
43
44
|
However, when you use a built-in font, the characters you can use in your
|
@@ -124,25 +125,25 @@ Name the files as follows:
|
|
124
125
|
Next, declare the font under the `font_catalog` key at the top of your theme
|
125
126
|
file, giving it a unique key (e.g., `Roboto`).
|
126
127
|
|
127
|
-
[source,yaml]
|
128
|
+
[source, yaml]
|
128
129
|
----
|
129
130
|
font:
|
130
131
|
catalog:
|
131
132
|
Roboto:
|
132
|
-
normal:
|
133
|
-
italic:
|
134
|
-
bold:
|
135
|
-
bold_italic:
|
133
|
+
normal: roboto-normal.ttf
|
134
|
+
italic: roboto-italic.ttf
|
135
|
+
bold: roboto-bold.ttf
|
136
|
+
bold_italic: roboto-bold_italic.ttf
|
136
137
|
----
|
137
138
|
|
138
139
|
You can use the key that you assign to the font in the font catalog anywhere
|
139
140
|
the `font_family` property is accepted in the theme file. For instance, to use
|
140
141
|
the Roboto font for all headings, you'd use:
|
141
142
|
|
142
|
-
[source,yaml]
|
143
|
+
[source, yaml]
|
143
144
|
----
|
144
145
|
heading:
|
145
|
-
font_family:
|
146
|
+
font_family: Roboto
|
146
147
|
----
|
147
148
|
|
148
149
|
When you execute *Asciidoctor PDF*, you need to specify the directory where the
|
@@ -163,20 +164,20 @@ storage. This is simply a personal preference.
|
|
163
164
|
You can add any number of fonts to the catalog. Each font must be assigned
|
164
165
|
a unique key, as shown here:
|
165
166
|
|
166
|
-
[source,yaml]
|
167
|
+
[source, yaml]
|
167
168
|
----
|
168
169
|
font:
|
169
170
|
catalog:
|
170
171
|
Roboto:
|
171
|
-
normal:
|
172
|
-
italic:
|
173
|
-
bold:
|
174
|
-
bold_italic:
|
172
|
+
normal: roboto-normal.ttf
|
173
|
+
italic: roboto-italic.ttf
|
174
|
+
bold: roboto-bold.ttf
|
175
|
+
bold_italic: roboto-bold_italic.ttf
|
175
176
|
Roboto Light:
|
176
|
-
normal:
|
177
|
-
italic:
|
178
|
-
bold:
|
179
|
-
bold_italic:
|
177
|
+
normal: roboto-light-normal.ttf
|
178
|
+
italic: roboto-light-italic.ttf
|
179
|
+
bold: roboto-light-bold.ttf
|
180
|
+
bold_italic: roboto-light-bold_italic.ttf
|
180
181
|
----
|
181
182
|
|
182
183
|
TIP: Text in SVGs will use the font catalog from your theme. We recommend
|
@@ -206,20 +207,20 @@ Let's choose {uri-font-droid-sans-fallback-ttf}[Droid Sans Fallback, {browser-wi
|
|
206
207
|
You can map all the styles to a single font file (since bold and italic don't
|
207
208
|
usually make sense for symbols).
|
208
209
|
|
209
|
-
[source,yaml]
|
210
|
+
[source, yaml]
|
210
211
|
----
|
211
212
|
font:
|
212
213
|
catalog:
|
213
214
|
Roboto:
|
214
|
-
normal:
|
215
|
-
italic:
|
216
|
-
bold:
|
217
|
-
bold_italic:
|
215
|
+
normal: roboto-normal.ttf
|
216
|
+
italic: roboto-italic.ttf
|
217
|
+
bold: roboto-bold.ttf
|
218
|
+
bold_italic: roboto-bold_italic.ttf
|
218
219
|
DroidSansFallback:
|
219
|
-
normal:
|
220
|
-
italic:
|
221
|
-
bold:
|
222
|
-
bold_italic:
|
220
|
+
normal: droid-sans-fallback.ttf
|
221
|
+
italic: droid-sans-fallback.ttf
|
222
|
+
bold: droid-sans-fallback.ttf
|
223
|
+
bold_italic: droid-sans-fallback.ttf
|
223
224
|
----
|
224
225
|
|
225
226
|
Next, add the key name to the `fallbacks` key under the `font_catalog` key.
|
@@ -227,20 +228,20 @@ The `fallbacks` key accepts an array of values, meaning you can specify more
|
|
227
228
|
than one fallback font. However, we recommend using a single fallback font,
|
228
229
|
if possible, as shown here:
|
229
230
|
|
230
|
-
[source,yaml]
|
231
|
+
[source, yaml]
|
231
232
|
----
|
232
233
|
font:
|
233
234
|
catalog:
|
234
235
|
Roboto:
|
235
|
-
normal:
|
236
|
-
italic:
|
237
|
-
bold:
|
238
|
-
bold_italic:
|
236
|
+
normal: roboto-normal.ttf
|
237
|
+
italic: roboto-italic.ttf
|
238
|
+
bold: roboto-bold.ttf
|
239
|
+
bold_italic: roboto-bold_italic.ttf
|
239
240
|
DroidSansFallback:
|
240
|
-
normal:
|
241
|
-
italic:
|
242
|
-
bold:
|
243
|
-
bold_italic:
|
241
|
+
normal: droid-sans-fallback.ttf
|
242
|
+
italic: droid-sans-fallback.ttf
|
243
|
+
bold: droid-sans-fallback.ttf
|
244
|
+
bold_italic: droid-sans-fallback.ttf
|
244
245
|
fallbacks:
|
245
246
|
- DroidSansFallback
|
246
247
|
----
|
@@ -250,10 +251,10 @@ to the `fallbacks` key.
|
|
250
251
|
|
251
252
|
Of course, make sure you've configured your theme to use your custom font:
|
252
253
|
|
253
|
-
[source,yaml]
|
254
|
+
[source, yaml]
|
254
255
|
----
|
255
256
|
base:
|
256
|
-
font_family:
|
257
|
+
font_family: Roboto
|
257
258
|
----
|
258
259
|
|
259
260
|
That's it! Now you're covered. If your custom font is missing a glyph,
|
@@ -0,0 +1 @@
|
|
1
|
+
Contains images to be includes from local include/images folder
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
.Measurement Units
|
3
|
+
[cols="6a,6a", width="100%", options="header", role="rtable mt-4"]
|
4
|
+
|===
|
5
|
+
|Unit |Suffix
|
6
|
+
|
7
|
+
|Centimeter
|
8
|
+
|cm
|
9
|
+
|
10
|
+
|Inches
|
11
|
+
|in
|
12
|
+
|
13
|
+
|Millimeter
|
14
|
+
|mm
|
15
|
+
|
16
|
+
|Percentage^[1]^
|
17
|
+
|%, vw, or vh
|
18
|
+
|
19
|
+
|Points
|
20
|
+
|pt (default)
|
21
|
+
|
22
|
+
|===
|