j1-template 2021.1.28 → 2021.2.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/layouts/content_generator_news_panel_posts.html +6 -6
- data/_includes/themes/j1/layouts/content_generator_post.html +3 -0
- data/_includes/themes/j1/modules/navigator/generator.html +1 -1
- data/_includes/themes/j1/procedures/posts/collate_timeline.proc +5 -5
- data/_includes/themes/j1/procedures/posts/create_series_header.proc +6 -6
- data/_layouts/default.html +6 -2
- data/assets/data/mdil_icons.json +2417 -0
- data/assets/data/panel.html +10 -10
- data/assets/themes/j1/adapter/js/j1.js +8 -7
- data/assets/themes/j1/adapter/js/j1scroll.js +19 -1
- data/assets/themes/j1/adapter/js/navigator.js +11 -4
- data/assets/themes/j1/adapter/js/rtable.js +77 -24
- data/assets/themes/j1/core/css/icon-fonts/materialdesign-light.css +1222 -0
- data/assets/themes/j1/core/css/icon-fonts/materialdesign-light.min.css +1 -0
- data/assets/themes/j1/core/css/icon-fonts/materialdesign.css +1 -1
- data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.css +58 -109
- data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/css/themes/uno-light/bootstrap.css +28 -18
- data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/css/vendor.css +7 -20
- data/assets/themes/j1/core/css/vendor.min.css +1 -1
- data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/eot/materialdesignicons-light-webfont.eot +0 -0
- data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/materialdesignicons-light-webfont.woff +0 -0
- data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/materialdesignicons-light-webfont.woff2 +0 -0
- data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/svg/materialdesignicons-light-webfont.svg +801 -0
- data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/ttf/materialdesignicons-light-webfont.ttf +0 -0
- data/assets/themes/j1/core/js/template.js +4 -4
- data/assets/themes/j1/core/js/template.js.map +1 -1
- data/assets/themes/j1/core/js/template.min.js +4 -4
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/carousel/css/theme/uno.css +1 -1
- data/assets/themes/j1/modules/carousel/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/j1Scroll/js/j1scroll.js +11 -21
- data/assets/themes/j1/modules/j1Scroll/js/j1scroll.min.js +1 -1
- data/assets/themes/j1/modules/justifiedGallery/css/theme/uno.css +1 -1
- data/assets/themes/j1/modules/justifiedGallery/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/mdiPreviewer/css/previewer.css +1 -1
- data/assets/themes/j1/modules/mdiPreviewer/css/previewer.min.css +1 -1
- data/assets/themes/j1/modules/mdiPreviewer/js/previewer.js +5 -15
- data/assets/themes/j1/modules/mdiPreviewer/js/previewer.min.js +1 -1
- data/assets/themes/j1/modules/mdilPreviewer/css/previewer.css +97 -0
- data/assets/themes/j1/modules/mdilPreviewer/css/previewer.min.css +15 -0
- data/assets/themes/j1/modules/mdilPreviewer/js/previewer.js +125 -0
- data/assets/themes/j1/modules/mdilPreviewer/js/previewer.min.js +15 -0
- data/assets/themes/j1/modules/rtable/css/theme/uno/rtable.css +3 -3
- data/assets/themes/j1/modules/rtable/css/theme/uno/rtable.min.css +2 -174
- data/assets/themes/j1/modules/rtable/js/rtable.js +59 -25
- data/assets/themes/j1/modules/rtable/js/rtable.min.js +12 -683
- data/assets/themes/j1/modules/showOnScroll/js/showOnScroll.js +73 -73
- data/assets/themes/j1/modules/showOnScroll/js/showOnScroll.min.js +15 -15
- data/lib/j1/commands/generate.rb +5 -8
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +15 -51
- data/lib/starter_web/_data/blocks/banner.yml +4 -5
- data/lib/starter_web/_data/blocks/panel.yml +217 -183
- data/lib/starter_web/_data/layouts/home.yml +20 -16
- data/lib/starter_web/_data/modules/defaults/navigator.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/rtable.yml +34 -0
- data/lib/starter_web/_data/modules/j1scroll.yml +12 -2
- data/lib/starter_web/_data/modules/navigator_menu.yml +3 -3
- data/lib/starter_web/_data/modules/rtable.yml +34 -0
- data/lib/starter_web/_data/resources.yml +38 -16
- data/lib/starter_web/_includes/attributes.asciidoc +6 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/assets/images/modules/attics/annie-spratt-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/antonino-visalli-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/humble-lamb-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/library-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/romain-vignes-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/sigmund-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/{pages/videos → modules/attics}/szabo-viktor-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/pages/asciidoc_skeletons/example-pdf-screenshot.png +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/{2020-01-01-about-cookies.adoc → 2021-01-01-about-cookies.adoc} +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/{2021-03-01-site-generators.adoc → 2021-02-01-site-generators.adoc} +0 -0
- data/lib/starter_web/collections/posts/public/{wikipedia/_posts/2016-11-20-minneapolis.adoc → series/_posts/2020-01-01-post-wiki-series.adoc} +11 -10
- data/lib/starter_web/collections/posts/public/{wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc → series/_posts/2020-01-02-post-wiki-series.adoc} +15 -13
- data/lib/starter_web/collections/posts/public/{wikipedia/_posts/2016-11-26-columbia-river.adoc → series/_posts/2020-01-03-post-wiki-series.adoc} +28 -11
- data/lib/starter_web/collections/posts/public/{wikipedia → series}/_posts/_includes/attributes.asciidoc +0 -0
- data/lib/starter_web/collections/posts/public/{wikipedia → series}/_posts/_includes/documents/readme +0 -0
- data/lib/starter_web/collections/posts/public/{wikipedia → series}/_posts/_includes/tables/readme +0 -0
- data/lib/starter_web/index.html +2 -2
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/{book → documentation}/000_intro.adoc +5 -7
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +43 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +61 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/attributes.asciidoc +95 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/000_intro.asciidoc +54 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/000_basic_example.asciidoc +31 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/111_about_the_converter.asciidoc +111 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/112_getting_started.asciidoc +95 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/113_themes.asciidoc +39 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter.asciidoc +8 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/211_language_overview.asciidoc +122 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/212_values.asciidoc +502 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/213_fonts.asciidoc +261 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes.asciidoc +8 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/{book → documentation}/a2p.bat +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/{book → documentation}/a2p.sh +2 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/{book/book.a2p → documentation/documentation.a2p} +2 -8
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +86 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/100_chapter.asciidoc +848 -40
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/200_chapter.asciidoc +149 -38
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +2 -7
- data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +312 -119
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +5 -5
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +5 -5
- data/lib/starter_web/pages/public/blog/navigator/archive.html +5 -5
- data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +1 -1
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +51 -82
- data/assets/themes/j1/modules/rtable/js/tablesaw-init.js +0 -18
- data/assets/themes/j1/modules/rtable/js/tablesaw.stackonly.js +0 -2371
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-test-series.adoc +0 -128
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-test-series.adoc +0 -131
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-test-series.adoc +0 -131
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-04-post-test-series.adoc +0 -132
- data/lib/starter_web/pages/infinite-scroll-tester-5.adoc +0 -119
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/blindtext.asciidoc +0 -11
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/font_icons.asciidoc +0 -23
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/gallery.asciidoc +0 -5
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/lightbox.asciidoc +0 -7
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/documents/chapter_document.asciidoc +0 -9
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/documents/entry_document.asciidoc +0 -3
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/images/image.asciidoc +0 -6
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_2_column.asciidoc +0 -12
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_2_column_options.asciidoc +0 -30
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_3_column.asciidoc +0 -16
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_4_column.asciidoc +0 -25
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/100_chapter.adoc +0 -62
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/200_chapter.adoc +0 -64
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/900_references.adoc +0 -73
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/attributes.asciidoc +0 -74
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/000_intro.asciidoc +0 -33
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/100_chapter/100_chapter_document.asciidoc +0 -21
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/100_chapter/110_chapter_document.asciidoc +0 -36
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/100_chapter.asciidoc +0 -7
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/200_chapter/200_chapter_document.asciidoc +0 -53
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/200_chapter.asciidoc +0 -5
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/000_intro.asciidoc +0 -23
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/100_chapter_document.asciidoc +0 -33
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/200_chapter_document.asciidoc +0 -26
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/900_sources.asciidoc +0 -81
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references.asciidoc +0 -23
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/tables/110_material_design_icons.asciidoc +0 -102
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/book.adoc +0 -136
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/100_chapter.asciidoc +0 -60
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/200_chapter.asciidoc +0 -59
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/tables/110_material_design_icons.asciidoc +0 -102
- data/lib/starter_web/pages/public/previewer/_includes/attributes.asciidoc +0 -60
- data/lib/starter_web/pages/public/previewer/_includes/documents/licenses/mit.asciidoc +0 -19
- data/lib/starter_web/pages/public/previewer/_includes/documents/readme +0 -0
- data/lib/starter_web/pages/public/previewer/_includes/documents/rouge/100_language_examples.asciidoc +0 -119
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/100_absolute_sizes.asciidoc +0 -39
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/110_bs_grid_sizes.asciidoc +0 -47
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/120_relative_sizes.asciidoc +0 -47
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/200_rotate.asciidoc +0 -71
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/300_flip.asciidoc +0 -31
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/400_spin_pulsed.asciidoc +0 -39
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/500_bw_color_palette.asciidoc +0 -61
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/510_bs_color_palette.asciidoc +0 -55
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/600_md_color_palette.asciidoc +0 -95
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/601_md_color_palette_indigo.asciidoc +0 -95
- data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/602_md_color_palette_pink.asciidoc +0 -95
- data/lib/starter_web/pages/public/previewer/_includes/tables/rouge/200_rouge_attributes.asciidoc +0 -41
- data/lib/starter_web/pages/public/previewer/_includes/tables/rouge/300_supported_languages.asciidoc +0 -857
- data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/100_bs_sizes.asciidoc +0 -47
- data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/100_relative_sizes.asciidoc +0 -47
- data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/200_rotate.asciidoc +0 -71
- data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/300_flip.asciidoc +0 -30
- data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/400_spin_pulsed.asciidoc +0 -31
- data/lib/starter_web/pages/public/previewer/iframer.adoc +0 -93
- data/lib/starter_web/pages/public/previewer/justified_gallery.html +0 -41
- data/lib/starter_web/pages/public/previewer/md_color_palette.adoc +0 -574
- data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +0 -220
- data/lib/starter_web/pages/public/previewer/rouge.adoc +0 -133
- data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +0 -191
@@ -0,0 +1,502 @@
|
|
1
|
+
== Values
|
2
|
+
|
3
|
+
The value of a key may be one of the following types:
|
4
|
+
|
5
|
+
* String
|
6
|
+
- Font family name (e.g., Roboto)
|
7
|
+
- Font style (normal, bold, italic, bold_italic)
|
8
|
+
- Alignment (left, center, right, justify)
|
9
|
+
- Color as hex string (e.g., #ffffff)
|
10
|
+
- Image path
|
11
|
+
- Enumerated type (where specified)
|
12
|
+
- Text content (where specified)
|
13
|
+
* Null (clears any previously assigned value)
|
14
|
+
- _empty_ (i.e., no value specified)
|
15
|
+
- null
|
16
|
+
- ~
|
17
|
+
* Number (integer or float) with optional units (default unit is points)
|
18
|
+
* Array
|
19
|
+
- Color as RGB array (e.g., [51, 51, 51])
|
20
|
+
- Color CMYK array (e.g., [50, 100, 0, 0])
|
21
|
+
- Margin (e.g., [1in, 1in, 1in, 1in])
|
22
|
+
- Padding (e.g., [1in, 1in, 1in, 1in])
|
23
|
+
* Variable reference (e.g., $base_font_color)
|
24
|
+
* Math expression
|
25
|
+
|
26
|
+
Note that keys almost always require a value of a specific type, as documented
|
27
|
+
in section *Keys*.
|
28
|
+
|
29
|
+
=== Inheritance
|
30
|
+
|
31
|
+
Like CSS, inheritance is a principle feature in the *Asciidoctor PDF* theme
|
32
|
+
language. For many of the properties, if a key is not specified, the key
|
33
|
+
inherits the value applied to the parent content in the content hierarchy.
|
34
|
+
This behavior saves you from having to specify properties unless you want to
|
35
|
+
override the inherited value.
|
36
|
+
|
37
|
+
The following keys are inherited:
|
38
|
+
|
39
|
+
* font_family
|
40
|
+
* font_color
|
41
|
+
* font_size
|
42
|
+
* font_style
|
43
|
+
* text_transform
|
44
|
+
* line_height (currently some exceptions)
|
45
|
+
* margin_bottom (if not specified, defaults to $vertical_spacing)
|
46
|
+
|
47
|
+
==== Heading Inheritance
|
48
|
+
|
49
|
+
Headings inherit starting from a specific heading level (e.g.,
|
50
|
+
`heading_h2_font_size`), then to the heading category (e.g.,
|
51
|
+
`heading_font_size`), then directly to the base value (e.g., `base_font_size`).
|
52
|
+
Any setting from an enclosing context, such as a sidebar, is skipped.
|
53
|
+
|
54
|
+
|
55
|
+
=== Variables
|
56
|
+
|
57
|
+
To save you from having to type the same value in your theme over and over, or
|
58
|
+
to allow you to base one value on another, the theme language supports variables.
|
59
|
+
Variables consist of the key name preceded by a dollar sign (`$`) (e.g.,
|
60
|
+
`$base_font_size`). Any qualified key that has already been defined can be
|
61
|
+
referenced in the value of another key. (In order words, as soon as the key is
|
62
|
+
assigned, it's available to be used as a variable).
|
63
|
+
|
64
|
+
IMPORTANT: Variables are defined from top to bottom (i.e., in document order).
|
65
|
+
Therefore, a variable must be defined before it is referenced. In other words,
|
66
|
+
the path the variable refers to must be *above* the usage of that variable.
|
67
|
+
|
68
|
+
For example, once the following line is processed,
|
69
|
+
|
70
|
+
[source,yaml]
|
71
|
+
----
|
72
|
+
base:
|
73
|
+
font_color: #333333
|
74
|
+
----
|
75
|
+
|
76
|
+
the variable `$base_font_color` will be available for use in subsequent lines
|
77
|
+
and will resolve to `#333333`. Let's say you want to make the font color of the
|
78
|
+
sidebar title the same as the heading font color. Just assign the value
|
79
|
+
`$heading_font_color` to the `$sidebar_title_font_color`.
|
80
|
+
|
81
|
+
[source,yaml]
|
82
|
+
----
|
83
|
+
heading:
|
84
|
+
font_color: #191919
|
85
|
+
sidebar:
|
86
|
+
title:
|
87
|
+
font_color: $heading_font_color
|
88
|
+
----
|
89
|
+
|
90
|
+
You can also use variables in math expressions to use one value to build
|
91
|
+
another. This is commonly done to set font sizes proportionally.It also makes
|
92
|
+
it easy to test different values very quickly.
|
93
|
+
|
94
|
+
[source,yaml]
|
95
|
+
----
|
96
|
+
base:
|
97
|
+
font_size: 12
|
98
|
+
font_size_large: $base_font_size * 1.25
|
99
|
+
font_size_small: $base_font_size * 0.85
|
100
|
+
----
|
101
|
+
|
102
|
+
We'll cover more about math expressions later.
|
103
|
+
|
104
|
+
==== Custom Variables
|
105
|
+
|
106
|
+
You can define arbitrary key names to make custom variables. This is one way
|
107
|
+
to group reusable values at the top of your theme file. If you are going to
|
108
|
+
do this, it's recommended that you organize the keys under a custom namespace,
|
109
|
+
such as `brand`.
|
110
|
+
|
111
|
+
For instance, here's how you can define your brand colors:
|
112
|
+
|
113
|
+
[source,yaml,subs=attributes+]
|
114
|
+
----
|
115
|
+
brand:
|
116
|
+
primary: #E0162B <1>
|
117
|
+
secondary: '#FFFFFF' <2>
|
118
|
+
alert: '0052A5' <3>
|
119
|
+
----
|
120
|
+
<1> To align with CSS, you may add a `+#+` in front of the hex color value.
|
121
|
+
A YAML preprocessor is used to ensure the value is not treated as a comment
|
122
|
+
as it would normally be the case in YAML.
|
123
|
+
|
124
|
+
<2> You may put quotes around the CSS-style hex value to make it friendly
|
125
|
+
to a YAML editor or validation tool.
|
126
|
+
|
127
|
+
<3> The leading `+#+` on a hex value is entirely optional. However, we
|
128
|
+
recommend that you always use either a leading `+#+` or surrounding quotes
|
129
|
+
(or both) to prevent YAML from mangling the value.
|
130
|
+
|
131
|
+
You can now use these custom variables later in the theme file:
|
132
|
+
|
133
|
+
[source,yaml]
|
134
|
+
----
|
135
|
+
base:
|
136
|
+
font_color: $brand_primary
|
137
|
+
----
|
138
|
+
|
139
|
+
=== Math Expressions & Functions
|
140
|
+
|
141
|
+
The theme language supports basic math operations to support calculated values.
|
142
|
+
Like programming languages, multiple and divide take precedence over add and
|
143
|
+
subtract.
|
144
|
+
|
145
|
+
The following table lists the supported operations and the corresponding
|
146
|
+
operator for each.
|
147
|
+
|
148
|
+
[width="100%", cols="50%,50%", options="header", role="table-responsive mt-3"]
|
149
|
+
|===
|
150
|
+
|Operation |Operator
|
151
|
+
|
152
|
+
|multiply
|
153
|
+
|*
|
154
|
+
|
155
|
+
|divide
|
156
|
+
|/
|
157
|
+
|
158
|
+
|add
|
159
|
+
|+
|
160
|
+
|
161
|
+
|subtract
|
162
|
+
|-
|
163
|
+
|
164
|
+
|===
|
165
|
+
|
166
|
+
IMPORTANT: Operators must always be surrounded by a space on either side
|
167
|
+
(e.g., 2 + 2, not 2+2).
|
168
|
+
|
169
|
+
Here's an example of a math expression with fixed values.
|
170
|
+
|
171
|
+
[source,yaml]
|
172
|
+
----
|
173
|
+
conum:
|
174
|
+
line_height: 4 / 3
|
175
|
+
----
|
176
|
+
|
177
|
+
Variables may be used in place of numbers anywhere in the expression:
|
178
|
+
|
179
|
+
[source,yaml]
|
180
|
+
----
|
181
|
+
base:
|
182
|
+
font_size: 12
|
183
|
+
font_size_large: $base_font_size * 1.25
|
184
|
+
----
|
185
|
+
|
186
|
+
Values used in a math expression are automatically coerced to a float value
|
187
|
+
before the operation. If the result of the expression is an integer, the
|
188
|
+
value is coerced to an integer afterwards.
|
189
|
+
|
190
|
+
IMPORTANT: Numeric values less than 1 must have a 0 before the decimal
|
191
|
+
point (e.g., 0.85).
|
192
|
+
|
193
|
+
The theme language also supports several functions for rounding the result
|
194
|
+
of a math expression. The following functions may be used if they surround
|
195
|
+
the whole value or expression for a key.
|
196
|
+
|
197
|
+
round(...):: Rounds the number to the nearest half integer.
|
198
|
+
floor(...):: Rounds the number up to the next integer.
|
199
|
+
ceil(...):: Rounds the number down the previous integer.
|
200
|
+
|
201
|
+
You might use these functions in font size calculations so that you get more
|
202
|
+
exact values.
|
203
|
+
|
204
|
+
[source,yaml]
|
205
|
+
----
|
206
|
+
base:
|
207
|
+
font_size: 12.5
|
208
|
+
font_size_large: ceil($base_font_size * 1.25)
|
209
|
+
----
|
210
|
+
|
211
|
+
=== Measurement Units
|
212
|
+
|
213
|
+
Several of the keys require a value in points (pt), the unit of measure for
|
214
|
+
the PDF canvas. A point is defined as 1/72 of an inch. If you specify a number
|
215
|
+
without any units, the units defaults to pt.
|
216
|
+
|
217
|
+
However, us humans like to think in real world units like inches (in),
|
218
|
+
centimeters (cm), or millimeters (mm). You can let the theme do this
|
219
|
+
conversion for you automatically by adding a unit notation next to any number.
|
220
|
+
|
221
|
+
The following units are supported:
|
222
|
+
|
223
|
+
[width="100%", cols="50%,50%", options="header", role="table-responsive mt-3"]
|
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
|
+
|===
|
242
|
+
|
243
|
+
A percentage with the % unit is calculated relative to the width or height
|
244
|
+
of the content area. Viewport-relative percentages (vw or vh units) are
|
245
|
+
calculated as a percentage of the page width or height, respectively.
|
246
|
+
Currently, percentage units can only be used for placing elements on the
|
247
|
+
title page or for setting the width of a block image.
|
248
|
+
|
249
|
+
IMPORTANT: Numbers with more than two digits should be written as a float
|
250
|
+
(e.g., 100.0), a math expression (e.g, 1 * 100), or with a unit (e.g., 100pt).
|
251
|
+
Otherwise, the value may be misinterpreted as a hex color (e.g., '100') and
|
252
|
+
could cause the converter to crash.
|
253
|
+
|
254
|
+
Here's an example of how you can use inches to define the page margins:
|
255
|
+
|
256
|
+
[source,yaml]
|
257
|
+
----
|
258
|
+
page:
|
259
|
+
margin: [0.75in, 1in, 0.75in, 1in]
|
260
|
+
----
|
261
|
+
|
262
|
+
The order of elements in a measurement array is the same as it is in CSS:
|
263
|
+
|
264
|
+
. top
|
265
|
+
. right
|
266
|
+
. bottom
|
267
|
+
. left
|
268
|
+
|
269
|
+
=== Alignments
|
270
|
+
|
271
|
+
The align subkey is used to align text and images within the parent container.
|
272
|
+
|
273
|
+
==== Text Alignments
|
274
|
+
|
275
|
+
Text can be aligned as follows:
|
276
|
+
|
277
|
+
* left
|
278
|
+
* center
|
279
|
+
* right
|
280
|
+
* justify (stretched to each edge)
|
281
|
+
|
282
|
+
==== Image Alignments
|
283
|
+
|
284
|
+
Images can be aligned as follows:
|
285
|
+
|
286
|
+
* left
|
287
|
+
* center
|
288
|
+
* right
|
289
|
+
|
290
|
+
=== Font Styles
|
291
|
+
|
292
|
+
In most cases, whereever you can specify a custom font family, you can also
|
293
|
+
specify a font style. These two settings are combined to locate the font to #
|
294
|
+
use.
|
295
|
+
|
296
|
+
The following font styles are recognized:
|
297
|
+
|
298
|
+
* normal (no style)
|
299
|
+
* italic
|
300
|
+
* bold
|
301
|
+
* bold_italic
|
302
|
+
|
303
|
+
=== Text Transforms
|
304
|
+
|
305
|
+
Many places where font properties can be specified, a case transformation can
|
306
|
+
be applied to the text. The following transforms are recognized:
|
307
|
+
|
308
|
+
* uppercase
|
309
|
+
* lowercase
|
310
|
+
* none (clears an inherited value)
|
311
|
+
|
312
|
+
[CAUTION#transform-unicode-letters]
|
313
|
+
====
|
314
|
+
Since Ruby 2.4, Ruby has built-in support for transforming the case of any
|
315
|
+
letter defined by Unicode. If you're using Ruby < 2.4, and the text you want
|
316
|
+
to transform contains characters beyond the Basic Latin character set (e.g.,
|
317
|
+
an accented character), you must install either the `activesupport` or the
|
318
|
+
`unicode` gem in order for those characters to be transformed.
|
319
|
+
|
320
|
+
$ gem install activesupport
|
321
|
+
|
322
|
+
or
|
323
|
+
|
324
|
+
$ gem install unicode
|
325
|
+
====
|
326
|
+
|
327
|
+
// Additional transforms, such as capitalize, may be added in the future.
|
328
|
+
|
329
|
+
=== Colors
|
330
|
+
|
331
|
+
The theme language supports color values in three formats:
|
332
|
+
|
333
|
+
Hex:: A string of 3 or 6 characters with an optional leading `#`, optional surrounding quotes or both.
|
334
|
+
RGB:: An array of numeric values ranging from 0 to 255.
|
335
|
+
CMYK:: An array of numeric values ranging from 0 to 1 or from 0% to 100%.
|
336
|
+
Transparent:: The special value `transparent` indicates that a color should not be used.
|
337
|
+
|
338
|
+
==== Hex
|
339
|
+
|
340
|
+
The hex color value is likely most familiar to web developers. The value must
|
341
|
+
be either 3 or 6 characters (case insensitive) with an optional leading hash
|
342
|
+
(`#`), optional surrounding quotes or both.
|
343
|
+
|
344
|
+
To align with CSS, you may add a `+#+` in front of the hex color value. A YAML
|
345
|
+
preprocessor is used to ensure the value is not treated as a comment as it
|
346
|
+
would normally be the case in YAML.
|
347
|
+
|
348
|
+
You also may put quotes around the CSS-style hex value to make it friendly to
|
349
|
+
a YAML editor or validation tool. In this case, the leading `+#+` on a hex
|
350
|
+
value is entirely optional.
|
351
|
+
|
352
|
+
Regardless, we recommend that you always use either a leading `+#+` or
|
353
|
+
surrounding quotes (or both) to prevent YAML from mangling the value.
|
354
|
+
|
355
|
+
The following are all equivalent values for the color red:
|
356
|
+
|
357
|
+
[cols="8*m"]
|
358
|
+
|===
|
359
|
+
|#ff0000
|
360
|
+
|#FF0000
|
361
|
+
|'ff0000'
|
362
|
+
|'FF0000'
|
363
|
+
|#f00
|
364
|
+
|#F00
|
365
|
+
|'f00'
|
366
|
+
|'F00'
|
367
|
+
|===
|
368
|
+
|
369
|
+
Here's how a hex color value appears in the theme file:
|
370
|
+
|
371
|
+
[source,yaml]
|
372
|
+
----
|
373
|
+
base:
|
374
|
+
font_color: #ff0000
|
375
|
+
----
|
376
|
+
|
377
|
+
==== RGB
|
378
|
+
|
379
|
+
An RGB array value must be three numbers ranging from 0 to 255. The values
|
380
|
+
must be separated by commas and be surrounded by square brackets.
|
381
|
+
|
382
|
+
NOTE: An RGB array is automatically converted to a hex string internally,
|
383
|
+
so there's no difference between ff0000 and [255, 0, 0].
|
384
|
+
|
385
|
+
Here's how to specify the color red in RGB:
|
386
|
+
|
387
|
+
* [255, 0, 0]
|
388
|
+
|
389
|
+
Here's how a RGB color value appears in the theme file:
|
390
|
+
|
391
|
+
[source,yaml]
|
392
|
+
----
|
393
|
+
base:
|
394
|
+
font_color: [255, 0, 0]
|
395
|
+
----
|
396
|
+
|
397
|
+
==== CMYK
|
398
|
+
|
399
|
+
A CMYK array value must be four numbers ranging from 0 and 1 or from 0% to
|
400
|
+
100%. The values must be separated by commas and be surrounded by square
|
401
|
+
brackets.
|
402
|
+
|
403
|
+
Unlike the RGB array, the CMYK array _is not_ converted to a hex string
|
404
|
+
internally. PDF has native support for CMYK colors, so you can preserve the
|
405
|
+
original color values in the final PDF.
|
406
|
+
|
407
|
+
Here's how to specify the color red in CMYK:
|
408
|
+
|
409
|
+
* [0, 0.99, 1, 0]
|
410
|
+
* [0, 99%, 100%, 0]
|
411
|
+
|
412
|
+
Here's how a CMYK color value appears in the theme file:
|
413
|
+
|
414
|
+
[source,yaml]
|
415
|
+
----
|
416
|
+
base:
|
417
|
+
font_color: [0, 0.99, 1, 0]
|
418
|
+
----
|
419
|
+
|
420
|
+
==== Transparent
|
421
|
+
|
422
|
+
It's possible to specify no color by assigning the special value
|
423
|
+
`transparent`, as shown here:
|
424
|
+
|
425
|
+
[source,yaml]
|
426
|
+
----
|
427
|
+
base:
|
428
|
+
background_color: transparent
|
429
|
+
----
|
430
|
+
|
431
|
+
=== Images
|
432
|
+
|
433
|
+
An image is specified either as a bare image path or as an inline image macro
|
434
|
+
as found in the AsciiDoc syntax. Images are currently resolved relative to the
|
435
|
+
value of the `pdf-stylesdir` attribute.
|
436
|
+
|
437
|
+
The following image types (and corresponding file extensions) are supported:
|
438
|
+
|
439
|
+
* PNG (.png)
|
440
|
+
* JPEG (.jpg)
|
441
|
+
* SVG (.svg)
|
442
|
+
|
443
|
+
CAUTION: The GIF format (.gif) is not supported.
|
444
|
+
|
445
|
+
Here's how an image is specified in the theme file as a bare image path:
|
446
|
+
|
447
|
+
[source,yaml]
|
448
|
+
----
|
449
|
+
title_page:
|
450
|
+
background_image: title-cover.png
|
451
|
+
----
|
452
|
+
|
453
|
+
Here's how the image is specified using the inline image macro:
|
454
|
+
|
455
|
+
[source,yaml]
|
456
|
+
----
|
457
|
+
title_page:
|
458
|
+
background_image: image:title-cover.png[]
|
459
|
+
----
|
460
|
+
|
461
|
+
Like in the AsciiDoc syntax, the inline image macro allows you to supply
|
462
|
+
set the width of the image and the alignment:
|
463
|
+
|
464
|
+
[source,yaml]
|
465
|
+
----
|
466
|
+
title_page:
|
467
|
+
logo_image: image:logo.png[width=250,align=center]
|
468
|
+
----
|
469
|
+
|
470
|
+
=== Quoted String
|
471
|
+
|
472
|
+
Some of the keys accept a quoted string as text content.
|
473
|
+
The final segment of these keys is always named `content`.
|
474
|
+
|
475
|
+
A content key accepts a string value. It's usually best to quote the string or
|
476
|
+
use the {uri-symfony-yaml-format-strings}[YAML multi-line string syntax, {browser-window--new}].
|
477
|
+
|
478
|
+
Text content may be formatted using a subset of inline HTML. You can use the
|
479
|
+
well-known elements such as `<strong>`, `<em>`, `<code>`, `<a>`, `<sub>`,
|
480
|
+
`<sup>`, `<del>`, and `<span>`. The `<span>` element supports the `style`
|
481
|
+
attribute, which you can use to specify the `color`, `font-weight`, and
|
482
|
+
`font-style` CSS properties. You can also use the `rgb` attribute on the
|
483
|
+
`<color>` element to change the color or the `name` and `size` attributes
|
484
|
+
on the `<font>` element to change the font properties. If you need to add an
|
485
|
+
underline or strikethrough decoration to the text, you can assign the
|
486
|
+
`underline` or `line-through` to the `class` attribute on any aforementioned
|
487
|
+
element.
|
488
|
+
|
489
|
+
Here's an example of using formatting in the content of the menu caret:
|
490
|
+
|
491
|
+
[source,yaml]
|
492
|
+
----
|
493
|
+
menu_caret_content: " <font size=\"1.15em\"><color rgb=\"#b12146\">\u203a</color></font> "
|
494
|
+
----
|
495
|
+
|
496
|
+
NOTE: The string must be double quoted in order to use a Unicode escape
|
497
|
+
code like `\u203a`.
|
498
|
+
|
499
|
+
Additionally, normal substitutions are applied to the value of content keys
|
500
|
+
for running content, so you can use
|
501
|
+
most AsciiDoc inline formatting (e.g., `+*strong*+` or `+{attribute-name}+`)
|
502
|
+
in the values of those keys.
|