j1-template 2021.1.29 → 2021.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/content_generator_post.html +3 -0
  3. data/_includes/themes/j1/procedures/posts/create_series_header.proc +6 -6
  4. data/assets/data/mdil_icons.json +2417 -0
  5. data/assets/themes/j1/core/css/icon-fonts/materialdesign-light.css +1222 -0
  6. data/assets/themes/j1/core/css/icon-fonts/materialdesign-light.min.css +1 -0
  7. data/assets/themes/j1/core/css/icon-fonts/materialdesign.css +1 -1
  8. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.css +1 -1
  9. data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/eot/materialdesignicons-light-webfont.eot +0 -0
  10. data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/materialdesignicons-light-webfont.woff +0 -0
  11. data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/materialdesignicons-light-webfont.woff2 +0 -0
  12. data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/svg/materialdesignicons-light-webfont.svg +801 -0
  13. data/assets/themes/j1/core/fonts/material_design_icons_light/fonts/ttf/materialdesignicons-light-webfont.ttf +0 -0
  14. data/assets/themes/j1/modules/mdiPreviewer/css/previewer.css +1 -1
  15. data/assets/themes/j1/modules/mdiPreviewer/css/previewer.min.css +1 -1
  16. data/assets/themes/j1/modules/mdiPreviewer/js/previewer.js +5 -15
  17. data/assets/themes/j1/modules/mdiPreviewer/js/previewer.min.js +1 -1
  18. data/assets/themes/j1/modules/mdilPreviewer/css/previewer.css +97 -0
  19. data/assets/themes/j1/modules/mdilPreviewer/css/previewer.min.css +15 -0
  20. data/assets/themes/j1/modules/mdilPreviewer/js/previewer.js +125 -0
  21. data/assets/themes/j1/modules/mdilPreviewer/js/previewer.min.js +15 -0
  22. data/assets/themes/j1/modules/showOnScroll/js/showOnScroll.js +73 -73
  23. data/assets/themes/j1/modules/showOnScroll/js/showOnScroll.min.js +15 -15
  24. data/lib/j1/commands/generate.rb +5 -8
  25. data/lib/j1/version.rb +1 -1
  26. data/lib/starter_web/Gemfile +1 -1
  27. data/lib/starter_web/_config.yml +3 -3
  28. data/lib/starter_web/_data/blocks/banner.yml +4 -5
  29. data/lib/starter_web/_data/modules/j1scroll.yml +2 -2
  30. data/lib/starter_web/_data/modules/navigator_menu.yml +3 -3
  31. data/lib/starter_web/_data/resources.yml +22 -0
  32. data/lib/starter_web/_includes/attributes.asciidoc +1 -1
  33. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  34. data/lib/starter_web/assets/images/modules/attics/annie-spratt-1920x1280.jpg +0 -0
  35. data/lib/starter_web/assets/images/modules/attics/antonino-visalli-1920x1280.jpg +0 -0
  36. data/lib/starter_web/assets/images/modules/attics/humble-lamb-1920x1280.jpg +0 -0
  37. data/lib/starter_web/assets/images/modules/attics/library-1920x1280.jpg +0 -0
  38. data/lib/starter_web/assets/images/modules/attics/romain-vignes-1920x1280.jpg +0 -0
  39. data/lib/starter_web/assets/images/modules/attics/sigmund-1920x1280.jpg +0 -0
  40. data/lib/starter_web/assets/images/{pages/videos → modules/attics}/szabo-viktor-1920x1280.jpg +0 -0
  41. data/lib/starter_web/assets/images/pages/asciidoc_skeletons/example-pdf-screenshot.png +0 -0
  42. data/lib/starter_web/collections/posts/public/featured/_posts/{2020-01-01-about-cookies.adoc → 2021-01-01-about-cookies.adoc} +0 -0
  43. data/lib/starter_web/collections/posts/public/featured/_posts/{2021-03-01-site-generators.adoc → 2021-02-01-site-generators.adoc} +0 -0
  44. 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
  45. 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
  46. 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
  47. data/lib/starter_web/collections/posts/public/{wikipedia → series}/_posts/_includes/attributes.asciidoc +0 -0
  48. data/lib/starter_web/collections/posts/public/{wikipedia → series}/_posts/_includes/documents/readme +0 -0
  49. data/lib/starter_web/collections/posts/public/{wikipedia → series}/_posts/_includes/tables/readme +0 -0
  50. data/lib/starter_web/index.html +2 -2
  51. data/lib/starter_web/package.json +1 -1
  52. data/lib/starter_web/pages/public/asciidoc_skeletons/{book → documentation}/000_intro.adoc +5 -7
  53. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +43 -0
  54. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +61 -0
  55. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/attributes.asciidoc +95 -0
  56. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/000_intro.asciidoc +54 -0
  57. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/000_basic_example.asciidoc +31 -0
  58. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/111_about_the_converter.asciidoc +111 -0
  59. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/112_getting_started.asciidoc +95 -0
  60. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/113_themes.asciidoc +39 -0
  61. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter.asciidoc +8 -0
  62. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/211_language_overview.asciidoc +122 -0
  63. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/212_values.asciidoc +502 -0
  64. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes/213_fonts.asciidoc +261 -0
  65. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/200_themes.asciidoc +8 -0
  66. data/lib/starter_web/pages/public/asciidoc_skeletons/{book → documentation}/a2p.bat +1 -1
  67. data/lib/starter_web/pages/public/asciidoc_skeletons/{book → documentation}/a2p.sh +2 -2
  68. data/lib/starter_web/pages/public/asciidoc_skeletons/{book/book.a2p → documentation/documentation.a2p} +2 -8
  69. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +86 -0
  70. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/100_chapter.asciidoc +848 -40
  71. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/200_chapter.asciidoc +149 -38
  72. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +2 -7
  73. data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +312 -119
  74. data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +2 -2
  75. data/lib/starter_web/pages/public/previewer/mdil_icons_preview.adoc +76 -0
  76. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  77. data/lib/starter_web/utilsrv/package.json +1 -1
  78. metadata +50 -53
  79. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-test-series.adoc +0 -128
  80. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-test-series.adoc +0 -131
  81. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-test-series.adoc +0 -131
  82. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-04-post-test-series.adoc +0 -132
  83. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/blindtext.asciidoc +0 -11
  84. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/font_icons.asciidoc +0 -23
  85. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/gallery.asciidoc +0 -5
  86. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/lightbox.asciidoc +0 -7
  87. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/documents/chapter_document.asciidoc +0 -9
  88. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/documents/entry_document.asciidoc +0 -3
  89. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/images/image.asciidoc +0 -6
  90. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_2_column.asciidoc +0 -12
  91. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_2_column_options.asciidoc +0 -30
  92. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_3_column.asciidoc +0 -16
  93. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/tables/table_4_column.asciidoc +0 -25
  94. data/lib/starter_web/pages/public/asciidoc_skeletons/book/100_chapter.adoc +0 -62
  95. data/lib/starter_web/pages/public/asciidoc_skeletons/book/200_chapter.adoc +0 -64
  96. data/lib/starter_web/pages/public/asciidoc_skeletons/book/900_references.adoc +0 -73
  97. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/attributes.asciidoc +0 -74
  98. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/000_intro.asciidoc +0 -33
  99. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/100_chapter/100_chapter_document.asciidoc +0 -21
  100. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/100_chapter/110_chapter_document.asciidoc +0 -36
  101. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/100_chapter.asciidoc +0 -7
  102. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/200_chapter/200_chapter_document.asciidoc +0 -53
  103. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/200_chapter.asciidoc +0 -5
  104. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/000_intro.asciidoc +0 -23
  105. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/100_chapter_document.asciidoc +0 -33
  106. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/200_chapter_document.asciidoc +0 -26
  107. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references/900_sources.asciidoc +0 -81
  108. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/900_references.asciidoc +0 -23
  109. data/lib/starter_web/pages/public/asciidoc_skeletons/book/_includes/documents/tables/110_material_design_icons.asciidoc +0 -102
  110. data/lib/starter_web/pages/public/asciidoc_skeletons/book/book.adoc +0 -136
  111. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/100_chapter.asciidoc +0 -60
  112. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/200_chapter.asciidoc +0 -59
  113. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/tables/110_material_design_icons.asciidoc +0 -102
  114. data/lib/starter_web/pages/public/features/modules.adoc +0 -104
  115. data/lib/starter_web/pages/public/features/platform.adoc +0 -104
@@ -0,0 +1,54 @@
1
+ // ~/document_base_folder/000_includes/documents
2
+ // Intro document: 000_intro.asciidoc
3
+ // -----------------------------------------------------------------------------
4
+
5
+ == Introduction
6
+
7
+ The skeleton of type *documentation* (book) can be used to create HTML output
8
+ (backend *html5*) for websites and *PDF* output (backend *pdf*) for offline
9
+ reading as well. _J1 Template_ comes with the full support of _Asciidoctor PDF_,
10
+ a Ruby-based add-on for _Asciidoctor_ using the Ruby PDF writer _Prawn_.
11
+
12
+ [IMPORTANT]
13
+ ====
14
+ If you have plans to convert documents of type type documentation (book)
15
+ into PDF, make sure you have enabled the Ruby *Gem* `asciidoctor-pdf` with
16
+ your projects's Gemfile. To make the converter usable, the plugin has to be
17
+ enabled with your site config file `_config.yml` in section
18
+ *PLUGIN configuration* as well.
19
+ ====
20
+
21
+ Prawn is a pure Ruby PDF generation library that provides a lot of great
22
+ functionality while trying to remain simple by providing a reasonable
23
+ performance.
24
+
25
+ Some of the important features of the *PDF* writer _Prawn_ are:
26
+
27
+ * Vector drawing support, including lines, polygons, curves,
28
+ ellipses, etc.
29
+ * Extensive text rendering support, including flowing text
30
+ nd limited inline formatting options.
31
+ * Support for both PDF builtin fonts as well as embedded TrueType
32
+ fonts
33
+ * A variety of low level tools for basic layout needs, including a
34
+ simple grid system
35
+ * PNG and JPG image embedding, with flexible scaling options
36
+ * Security features including encryption and password protection
37
+ * Tools for rendering repeatable content (i.e headers, footers, and
38
+ page numbers)
39
+ * Comprehensive internationalization features, including full support
40
+ for UTF-8 based fonts, right-to-left text rendering, fallback font support,
41
+ and extension points for customizable text wrapping.
42
+ * Support for PDF outlines for document navigation
43
+
44
+ [NOTE]
45
+ ====
46
+ .Converting the Skeleton
47
+
48
+ The Asciidoc skeleton *documentation* (book) is fully *relocateable* and can
49
+ be placed in any subfolder of your Jekyll site for *HTML* output. For *PDF*
50
+ output, a single variable `BASE_PATH` has to be set for your environment.
51
+
52
+ See the *batch* files `a2p.bat` for _Windows_ (`cmd.exe`) or `a2p.sh` used
53
+ on _Unix_ or _Linux_ OS for the shell (bash).
54
+ ====
@@ -0,0 +1,31 @@
1
+ = Document Title
2
+ Doc Writer <doc@example.com>
3
+ :doctype: book
4
+ :reproducible:
5
+ //:source-highlighter: coderay
6
+ :source-highlighter: rouge
7
+ :listing-caption: Listing
8
+ // Uncomment next line to set page size (default is A4)
9
+ //:pdf-page-size: Letter
10
+
11
+ A simple http://asciidoc.org[AsciiDoc] document.
12
+
13
+ == Introduction
14
+
15
+ A paragraph followed by a simple list with square bullets.
16
+
17
+ [square]
18
+ * item 1
19
+ * item 2
20
+
21
+ Here's how you say "`Hello, World!`" in Prawn:
22
+
23
+ .Create a basic PDF document using Prawn
24
+ [source,ruby]
25
+ ----
26
+ require 'prawn'
27
+
28
+ Prawn::Document.generate 'example.pdf' do
29
+ text 'Hello, World!'
30
+ end
31
+ ----
@@ -0,0 +1,111 @@
1
+ == About the PDF-Generator Prawn
2
+
3
+ {uri-asciidoctor-pdf}[Asciidoctor PDF, {browser-window--new}] is made possible by an amazing
4
+ Ruby gem named _Prawn_. And what a gem it is! {uri-prawn-home}[Prawn, {browser-window--new}] is a
5
+ nimble PDF writer for _Ruby_. More important, it's a hackable platform that offers
6
+ both high level APIs for the most common needs and low level APIs for bending
7
+ the document model to accommodate special circumstances.
8
+
9
+ [caption=Status]
10
+ CAUTION: _Asciidoctor PDF_ is currently _alpha_ software. While the converter
11
+ handles most AsciiDoc content, there's still work needed to fill in gaps
12
+ where conversion is incomplete, incorrect or not implemented. See the
13
+ milestone v1.5.0 in the {uri-asciidoctor-pdf-issues}[Issue tracker, {browser-window--new}]
14
+ for details.
15
+
16
+ With _Prawn_, you can write text, draw lines and shapes and place images
17
+ _anywhere_ on the page and add as much color as you like. In addition, it
18
+ brings a fluent API and aggressive code re-use to the printable document space.
19
+
20
+ Here's an example that demonstrates how to use _Prawn_ to create a basic PDF
21
+ document.
22
+
23
+ .Create a basic PDF document using _Prawn_
24
+ [source,ruby]
25
+ ----
26
+ require 'prawn'
27
+
28
+ Prawn::Document.generate 'output.pdf' do
29
+ text 'Hello, PDF creation!'
30
+ end
31
+ ----
32
+
33
+ It's that easy.
34
+ And that's just the beginning.
35
+
36
+ _Prawn_ is the _killer library_ for PDF generation we've needed to close this
37
+ critical gap in _Asciidoctor_. It absolutely takes the pain out of creating
38
+ printable documents. Picking up from there, _Asciidoctor PDF_ takes the pain out
39
+ of creating PDF documents _from AsciiDoc_.
40
+
41
+ === Highlights
42
+
43
+ * Direct AsciiDoc to PDF conversion
44
+ * SVG support
45
+ * PDF document outline (i.e., bookmarks)
46
+ * Table of contents page(s)
47
+ * Document metadata (title, authors, subject, keywords, etc)
48
+ * Internal cross reference links
49
+ * Syntax highlighting with Rouge, Pygments, or CodeRay
50
+ * Page numbering
51
+ * Customizable running content (header and footer)
52
+ * “Keep together” blocks (i.e., page breaks avoided in certain block content)
53
+ * Orphaned section titles avoided
54
+ * Autofit verbatim blocks (as permitted by base_font_size_min setting)
55
+ * Table border settings honored
56
+ * Font-based icons
57
+ * Custom (TTF) fonts
58
+ * Double-sided printing mode (margins alternate on recto and verso pages)
59
+
60
+ === Prerequisites
61
+
62
+ All that's needed is _Ruby_ (1.9.3 or above; 2.3.x recommended) and a few _Ruby_
63
+ gems, which we explain how to install in the next section.
64
+
65
+ To check if you have _Ruby_ available, use the `ruby` command to query the
66
+ version installed:
67
+
68
+ $ ruby --version
69
+
70
+ [WARNING]
71
+ ====
72
+ By default, _Asciidoctor PDF_ automatically installs the latest version of _Prawn_
73
+ if you don't already have _Prawn_ installed. This will fail on older versions of
74
+ _Ruby_. To workaround, you need to install certain dependencies first.
75
+
76
+ Starting with _Prawn_ 2.0.0, _Prawn_ requires Ruby >= 2.0.0 during installation.
77
+ Therefore, to use _Asciidoctor PDF_ with Ruby 1.9.3, you must first explicitly
78
+ install the following dependencies to lock the versions:
79
+
80
+ $ gem install prawn --version 1.3.0
81
+ gem install addressable --version 2.4.0
82
+ gem install prawn-svg --version 0.21.0
83
+ gem install prawn-templates --version 0.0.3
84
+
85
+ You can then proceed with installation of _Asciidoctor PDF_ on Ruby 1.9.3.
86
+
87
+ Starting with _Prawn_ 2.2.0, _Prawn_ requires Ruby >= 2.1.0 during installation.
88
+ Therefore, to use _Asciidoctor PDF_ with Ruby 2.0.0, you must first explicitly
89
+ install the following dependencies to lock the versions:
90
+
91
+ $ gem install prawn --version 2.1.0
92
+ gem install prawn-svg --version 0.26.0
93
+ gem install prawn-templates --version 0.0.4
94
+
95
+ For all other versions of _Ruby_, you can simply install the _Asciidoctor PDF_ gem.
96
+ It will transitively install the required dependencies.
97
+ ====
98
+
99
+ ==== System Encoding
100
+
101
+ _Asciidoctor_ assumes you're using UTF-8 encoding. To minimize encoding problems,
102
+ make sure the default encoding of your system is set to UTF-8.
103
+
104
+ If you're using a non-English Windows environment, the default encoding of your
105
+ system may not be UTF-8. As a result, you may get an `Encoding::UndefinedConversionError`
106
+ or other encoding issues when invoking _Asciidoctor_. To solve these problems, we
107
+ recommend at least changing the active code page in your console to UTF-8.
108
+
109
+ chcp 65001
110
+
111
+ Once you make this change, all your Unicode headaches will be behind you.
@@ -0,0 +1,95 @@
1
+ == Getting Started
2
+
3
+ You can get _Asciidoctor PDF_ by installing the published gem or running th
4
+ code from source.
5
+
6
+ === Install the Published Gem
7
+
8
+ _Asciidoctor PDF_ is published as a pre-release on RubyGems.org.
9
+ First, make sure you have satisfied the prerequisites.
10
+ Then, you can install the published gem using the following command:
11
+
12
+ $ gem install asciidoctor-pdf --pre
13
+
14
+ If you want to syntax highlight source listings, you'll also want to install
15
+ Rouge, Pygments, or CodeRay. Choose one (or more) of the following:
16
+
17
+ .Rouge (preferred)
18
+ $ gem install rouge
19
+
20
+ .Pygments
21
+ $ gem install pygments.rb
22
+
23
+ .CodeRay
24
+ $ gem install coderay
25
+
26
+ You then activate syntax highlighting for a given document by adding the
27
+ `source-highlighter` attribute to the document header (Rouge shown):
28
+
29
+ [source,asciidoc]
30
+ ----
31
+ :source-highlighter: rouge
32
+ ----
33
+
34
+ Assuming all the required gems install properly, verify you can run the
35
+ `asciidoctor-pdf` script:
36
+
37
+ $ asciidoctor-pdf -v
38
+
39
+ If you see the version of _Asciidoctor PDF_ printed, you're ready to use
40
+ _Asciidoctor PDF_.
41
+
42
+ Let's grab an AsciiDoc document to distill and start putting _Asciidoctor PDF_
43
+ to use!
44
+
45
+ === An Example AsciiDoc Document
46
+
47
+ If you don't already have an AsciiDoc document, you can use the
48
+ *basic_example.adoc* file found in the examples directory of this
49
+ project.
50
+
51
+ ifeval::[{safe-mode-level} < 20]
52
+ .000_basic_example.adoc
53
+ [source,asciidoc]
54
+ ....
55
+ include::000_basic_example.asciidoc[]
56
+ ....
57
+ endif::[]
58
+
59
+ It's time to convert the AsciiDoc document directly to PDF.
60
+
61
+ === Convert AsciiDoc to PDF
62
+
63
+ IMPORTANT: You'll need the `rouge` gem installed to run this example since
64
+ it uses the `source-highlighter` attribute with the value of `rouge`.
65
+
66
+ Converting to PDF is a simple as running the `asciidoctor-pdf` script using
67
+ _Ruby_ and passing our AsciiDoc document as the first argument.
68
+
69
+ $ asciidoctor-pdf 000_basic_example.adoc
70
+
71
+ This command is just a shorthand way of running:
72
+
73
+ $ asciidoctor -r asciidoctor-pdf -b pdf 000_basic_example.adoc
74
+
75
+ The `asciidoctor-pdf` command just saves you from having to remember all those
76
+ flags. That's why we created it.
77
+
78
+ When the script completes, you should see the file *000_basic_example.pdf*
79
+ in the same directory. Open the *000_basic_example.pdf* file with a PDF
80
+ viewer to see the result.
81
+
82
+ ifdef::backend-html5[]
83
+ .Example PDF document rendered in a PDF viewer
84
+ image::/assets/images/pages/asciidoc_skeletons/example-pdf-screenshot.png[Screenshot of PDF document,width=800,scaledwidth=100%]
85
+ endif::[]
86
+
87
+ ifdef::backend-pdf[]
88
+ .Example PDF document rendered in a PDF viewer
89
+ image::/assets/images/pages/asciidoc_skeletons/example-pdf-screenshot.png[Screenshot of PDF document,width=800,scaledwidth=100%]
90
+ endif::[]
91
+
92
+ You're also encouraged to try converting the documents in the examples
93
+ directory to see more of what _Asciidoctor PDF_ can do.
94
+
95
+ The pain of the DocBook toolchain should be melting away about now.
@@ -0,0 +1,39 @@
1
+ == Themes
2
+
3
+ The layout and styling of the PDF is driven by a YAML configuration file. To
4
+ learn how the theming system works and how to create and apply custom themes,
5
+ refer to the _Asciidoctor PDF_ Theme Guide. You can use
6
+ the built-in theme files, which you can find in the *data/themes* directory,
7
+ as examples.
8
+
9
+ === Support for Non-Latin Languages
10
+
11
+ _Asciidoctor_ can process the full range of characters in the UTF-8 character
12
+ set. That means you can write your document in any language, save the file
13
+ with UTF-8 encoding, and expect _Asciidoctor_ to convert the text properly.
14
+ However, you may notice that certain characters for certain languages, such
15
+ as Chinese, are missing in the PDF. Read on to find out why and how to
16
+ address it.
17
+
18
+ If you're writing in a non-Latin language, you need to use a dedicated theme
19
+ that provides the necessary fonts. For example, to produce a PDF from a
20
+ document written in a CJK language such as Chinese, you need to use a CJK
21
+ theme. You can get such a theme by installing the `asciidoctor-pdf-cjk-kai_gen_gothic`
22
+ gem. See the {uri-asciidoctor-pdf-cjk-kai_gen_gothic}[asciidoctor-pdf-cjk-kai_gen_gothic, {browser-window--new}]
23
+ project for detailed instructions.
24
+
25
+ Using a dedicated theme is necessary because PDF is a "`bring your own font`"
26
+ kind of system. In other words, the font you provide must provide glyphs for
27
+ all the characters. There's no one font that supports all the worlds languages
28
+ (though some, like Noto Serif, certainly come close). Even if there were such
29
+ a font, bundling that font with the main gem would make the package enormous.
30
+ It would also severely limit the style choices in the default theme, which
31
+ targets Latin-based languages.
32
+
33
+ Therefore, we're taking the strategy of creating separate dedicated theme
34
+ gems that target each language family, such as CJK. The base theme for CJK
35
+ languages is provided by the {uri-asciidoctor-pdf-cjk}[asciidoctro-pdf-cjk, {browser-window--new}]
36
+ project and a concrete implementation provided by the
37
+ {uri-asciidoctor-pdf-cjk-kai_gen_gothic}[asciidoctor-pdf-cjk-kai_gen_gothic, {browser-window--new}]
38
+ project that's based on the kai_gen_gothic font. Of course, you're free to
39
+ follow this model and create your own theme gem that uses fonts of your choice.
@@ -0,0 +1,8 @@
1
+ // Include documents
2
+ // -------------------------------------------------------------------
3
+
4
+ include::100_converter/111_about_the_converter.asciidoc[]
5
+
6
+ include::100_converter/112_getting_started.asciidoc[]
7
+
8
+ include::100_converter/113_themes.asciidoc[]
@@ -0,0 +1,122 @@
1
+ == Language Overview
2
+
3
+ The theme language in *Asciidoctor PDF* is based on the {uri-wikipedia-yaml}[YAML, {browser-window--new}]
4
+ data format and incorporates many concepts from CSS and SASS. Therefore, if you
5
+ have a background in web design, the theme language should be immediately
6
+ familiar to you.
7
+
8
+ Like CSS, themes have both selectors and properties. Selectors are the component
9
+ you want to style. The properties are the style elements of that component that
10
+ can be styled. All selector names are implicit (e.g., `heading`), so you
11
+ customize the theme primarily by manipulating pre-defined property values
12
+ (e.g., `font_size`).
13
+
14
+ [NOTE]
15
+ ====
16
+ The theme language in *Asciidoctor PDF* supports a limited subset of the
17
+ properties from CSS. Some of these properties have different names from
18
+ those found in CSS.
19
+
20
+ * Underscores (`_`) can be used in place of hyphens (`-`) for all property names in the theme language.
21
+ * Instead of separate properties for font weight and font style, the theme language combines these settings in the `font_style` property (allowed values: `normal`, `bold`, `italic` and `bold_italic`).
22
+ * The `text_align` property from CSS is the `align` property in the theme language.
23
+ * The `color` property from CSS is the `font_color` property in the theme language.
24
+ ====
25
+
26
+ A theme (or style) is described in a YAML-based data format and stored in a
27
+ dedicated theme file. YAML is a human-friendly data format that resembles CSS
28
+ and helps to describe the theme. The theme language adds some extra features
29
+ to YAML, such as variables, basic math, measurements and color values. These
30
+ enhancements will be explained in detail in later sections.
31
+
32
+ The theme file must be named _<name>-theme.yml_, where `<name>` is the name
33
+ of the theme. Here's an example of a basic theme file:
34
+
35
+ .basic-theme.yml
36
+ [source,yaml]
37
+ ----
38
+ page:
39
+ layout: portrait
40
+ margin: [0.75in, 1in, 0.75in, 1in]
41
+ size: Letter
42
+ base:
43
+ font_color: #333333
44
+ font_family: Times-Roman
45
+ font_size: 12
46
+ line_height_length: 17
47
+ line_height: $base_line_height_length / $base_font_size
48
+ vertical_spacing: $base_line_height_length
49
+ heading:
50
+ font_color: #262626
51
+ font_size: 17
52
+ font_style: bold
53
+ line_height: 1.2
54
+ margin_bottom: $vertical_spacing
55
+ link:
56
+ font_color: #002FA7
57
+ outline_list:
58
+ indent: $base_font_size * 1.5
59
+ ----
60
+
61
+ When creating a new theme, you only have to define the keys you want to
62
+ override from the base theme, which is loaded prior to loading your custom
63
+ theme. All the available keys are documented in section *Keys*. The converter
64
+ uses the information from the theme map to help construct the PDF.
65
+
66
+ [TIP]
67
+ ====
68
+ Instead of creating a theme from scratch, another option is to download the
69
+ {uri-asciidoctor-pdf-default-theme}[default-theme.yml, {browser-window--new}] file from the source
70
+ repository. Save the file using a unique name (e.g. _custom-theme.yml_) and
71
+ start hacking on it.
72
+
73
+ Alternatively, you can snag the file from your local installation using the
74
+ following command:
75
+
76
+ $ ASCIIDOCTOR_PDF_DIR=`gem contents asciidoctor-pdf --show-install-dir`;\
77
+ cp "$ASCIIDOCTOR_PDF_DIR/data/themes/default-theme.yml" custom-theme.yml
78
+ ====
79
+
80
+ Keys may be nested to an arbitrary depth to eliminate redundant prefixes (an
81
+ approach inspired by SASS). Once the theme is loaded, all keys are flattened
82
+ into a single map of qualified keys. Nesting is simply a shorthand way of
83
+ organizing the keys. In the end, a theme is just a map of key/value pairs.
84
+
85
+ Nested keys are adjoined to their parent key with an underscore (`_`).
86
+ This means the selector part (e.g., `link`) is combined with the property
87
+ name (e.g., `font_color`) into a single, qualified key (e.g., `link_font_color`).
88
+
89
+ For example, let's assume we want to set the base (i.e., global) font size
90
+ and color. These keys may be written longhand:
91
+
92
+ [source,yaml]
93
+ ----
94
+ base_font_color: #333333
95
+ base_font_family: Times-Roman
96
+ base_font_size: 12
97
+ ----
98
+
99
+ Or, to avoid having to type the prefix `base_` multiple times, the keys may
100
+ be written hierarchically:
101
+
102
+ [source,yaml]
103
+ ----
104
+ base:
105
+ font_color: #333333
106
+ font_family: Times-Roman
107
+ font_size: 12
108
+ ----
109
+
110
+ Or even:
111
+
112
+ [source,yaml]
113
+ ----
114
+ base:
115
+ font:
116
+ color: #333333
117
+ family: Times-Roman
118
+ size: 12
119
+ ----
120
+
121
+ Each level of nesting must be indented by two more spaces of indentation than
122
+ the parent level. Also note the presence of the colon after each key name.