hyla 1.0.7.pre.2 → 1.0.7.pre.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitignore +2 -0
- data/README.adoc +2 -2
- data/Rakefile +93 -24
- data/config.yaml +49 -0
- data/documentation/developer.adoc +6 -6
- data/documentation/imgkit.adoc +44 -0
- data/documentation/index.txt +3 -0
- data/documentation/introduction.adoc +8 -335
- data/documentation/prerequisites.adoc +1 -1
- data/documentation/scenario.adoc +320 -0
- data/lib/hyla/commands/generate.rb +11 -2
- data/lib/hyla/configuration.rb +10 -1
- data/lib/hyla/project.rb +1 -1
- data/lib/resources/assets/cover/cover.html +62 -0
- data/lib/resources/assets/cover/cover.png +0 -0
- data/lib/resources/{cover.slim → assets/cover/cover.slim} +0 -0
- data/lib/resources/assets/cover/image/1153872-redhat-backroung.png +0 -0
- data/lib/resources/assets/cover/image/1156515-Logo_RH_RGB_Reverse.png +0 -0
- data/lib/resources/assets/cover/image/1156524-bg_redhat.png +0 -0
- data/lib/resources/assets/cover/new_cover.slim +95 -0
- data/lib/resources/assets/revealjs-redhat/image/1156515-Logo_RH_RGB_Reverse.png +0 -0
- data/lib/resources/assets/revealjs-redhat/image/1156524-bg_redhat.png +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/css/font-awesome-4.3.0.css +2893 -0
- data/lib/resources/assets/revealjs-redhat/lib/css/gpe.css +705 -0
- data/lib/resources/assets/revealjs-redhat/lib/css/offline-v2.css +3646 -0
- data/lib/resources/assets/revealjs-redhat/lib/css/print/paper.css +176 -0
- data/lib/resources/assets/revealjs-redhat/lib/css/print/pdf.css +190 -0
- data/lib/resources/assets/revealjs-redhat/lib/css/theme-output.css +1358 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/font-awesome/FontAwesome.otf +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/font-awesome/fontawesome-webfont.eot +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/font-awesome/fontawesome-webfont.svg +565 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/font-awesome/fontawesome-webfont.ttf +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/font-awesome/fontawesome-webfont.woff +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/font-awesome/fontawesome-webfont.woff2 +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-bold.eot +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-bold.svg +637 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-bold.ttf +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-bold.woff +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-light.eot +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-light.svg +2121 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-light.ttf +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-light.woff +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-regular.eot +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-regular.svg +637 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-regular.ttf +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass-regular.woff +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass.css +32 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass.css-TODO +12 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass_bold-web.eot +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass_bold-web.svg +454 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass_bold-web.ttf +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass_bold-web.woff +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass_regular-web.eot +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass_regular-web.svg +454 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass_regular-web.ttf +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/font/overpass/overpass_regular-web.woff +0 -0
- data/lib/resources/assets/revealjs-redhat/lib/js/head.min.js +131 -0
- data/lib/resources/assets/revealjs-redhat/lib/js/reveal.min.js +1279 -0
- data/lib/resources/assets/revealjs-redhat/lib/plugin/highlight/highlight.js +25 -0
- data/lib/resources/assets/revealjs-redhat/lib/plugin/markdown/markdown.js +320 -0
- data/lib/resources/assets/revealjs-redhat/lib/plugin/markdown/marked.js +37 -0
- data/lib/resources/assets/revealjs-redhat/lib/plugin/notes/notes.html +387 -0
- data/lib/resources/assets/revealjs-redhat/lib/plugin/notes/notes.js +117 -0
- data/lib/resources/assets/revealjs-redhat/lib/plugin/zoom-js/zoom.js +258 -0
- data/lib/resources/assets/revealjs/css/theme/default.css +121 -0
- data/lib/resources/assets/revealjs/css/theme/gpe.css +85 -86
- data/lib/resources/assets/sass/gpe.scss +15 -14
- data/lib/resources/assets/sass/gpe2.scss +598 -0
- data/lib/resources/assets/sass/{_overpass.scss → overpass.scss} +0 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_admonition.html.slim +13 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_audio.html.slim +6 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_colist.html.slim +20 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_dlist.html.slim +53 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_example.html.slim +4 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_floating_title.html.slim +1 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_image.html.slim +15 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_listing.html.slim +31 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_literal.html.slim +4 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_math.html.slim +10 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_olist.html.slim +9 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_open.html.slim +15 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_page_break.html.slim +1 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_paragraph.html.slim +16 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_pass.html.slim +1 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_preamble.html.slim +6 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_quote.html.slim +14 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_ruler.html.slim +1 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_sidebar.html.slim +5 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_table.html.slim +45 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_toc.html.slim +12 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_ulist.html.slim +25 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_verse.html.slim +14 -0
- data/lib/resources/backends/slim/revealjs-redhat/block_video.html.slim +27 -0
- data/lib/resources/backends/slim/revealjs-redhat/document.html.slim +162 -0
- data/lib/resources/backends/slim/revealjs-redhat/embedded.html.slim +9 -0
- data/lib/resources/backends/slim/revealjs-redhat/helpers.rb +8 -0
- data/lib/resources/backends/slim/revealjs-redhat/inline_anchor.html.slim +11 -0
- data/lib/resources/backends/slim/revealjs-redhat/inline_break.html.slim +2 -0
- data/lib/resources/backends/slim/revealjs-redhat/inline_button.html.slim +1 -0
- data/lib/resources/backends/slim/revealjs-redhat/inline_callout.html.slim +7 -0
- data/lib/resources/backends/slim/revealjs-redhat/inline_footnote.html.slim +6 -0
- data/lib/resources/backends/slim/revealjs-redhat/inline_image.html.slim +24 -0
- data/lib/resources/backends/slim/revealjs-redhat/inline_indexterm.html.slim +2 -0
- data/lib/resources/backends/slim/revealjs-redhat/inline_kbd.html.slim +8 -0
- data/lib/resources/backends/slim/revealjs-redhat/inline_menu.html.slim +15 -0
- data/lib/resources/backends/slim/revealjs-redhat/inline_quoted.html.slim +22 -0
- data/lib/resources/backends/slim/revealjs-redhat/section.html.slim +23 -0
- data/lib/resources/backends/slim/revealjs/section.html.slim +2 -2
- data/lib/templates/_config.yaml +28 -8
- data/lib/templates/sample/slideshow_revealjs.adoc +21 -0
- metadata +97 -6
- data/.rakeTasks +0 -7
- data/.travis.yml +0 -10
@@ -0,0 +1,320 @@
|
|
1
|
+
|
2
|
+
The following scenario describes how we can can setup a project using one of the option proposed by Hyla : Create, Generate, Watch, ...
|
3
|
+
|
4
|
+
=== Delete Temp directory
|
5
|
+
|
6
|
+
rm -rf ~/hyla/MyBlankProject/
|
7
|
+
rm -rf ~/hyla/MyBookProject
|
8
|
+
rm -rf ~/hyla/MyPdfProject/
|
9
|
+
rm -rf ~/hyla/MyTocProject/
|
10
|
+
rm -rf ~/hyla/MyTrainingProject/
|
11
|
+
rm -rf ~/hyla/MyTrainingExercisesProject/
|
12
|
+
rm -rf ~/hyla/MyDeckSlideShow/
|
13
|
+
rm -rf ~/hyla/MyRevealSlideShow/
|
14
|
+
rm -rf ~/hyla/MyEmailProject/
|
15
|
+
|
16
|
+
=== Blank Project & Artifacts
|
17
|
+
|
18
|
+
Using hyla we will create a new project (= directory) and add artifacts (article, audio, video, image, source, table)
|
19
|
+
|
20
|
+
==== Create a Blank Project (with or without --force option)
|
21
|
+
|
22
|
+
hyla new --blank ~/hyla/MyBlankProject
|
23
|
+
hyla new -b ~/hyla/MyBlankProject -f
|
24
|
+
|
25
|
+
==== Create a Blank Project without _config.yaml config file, add artifact
|
26
|
+
|
27
|
+
- Clean and create a MyBlankProject (= directory) using --force option
|
28
|
+
|
29
|
+
cd ~/hyla
|
30
|
+
rm -rf MyBlankProject/
|
31
|
+
hyla new -b MyBlankProject -f
|
32
|
+
|
33
|
+
- Create Asciidoc files from templates (book, article, image, audio, ...)
|
34
|
+
|
35
|
+
hyla add --t asciidoc -a article -d ~/hyla/MyBlankProject
|
36
|
+
hyla add --t asciidoc -a book -d ~/hyla/MyBlankProject
|
37
|
+
hyla add --t asciidoc -a image -d ~/hyla/MyBlankProject
|
38
|
+
hyla add --t asciidoc -a audio -d ~/hyla/MyBlankProject
|
39
|
+
hyla add --t asciidoc -a video -d ~/hyla/MyBlankProject
|
40
|
+
hyla add --t asciidoc -a source -d ~/hyla/MyBlankProject
|
41
|
+
hyla add --t asciidoc -a table -d ~/hyla/MyBlankProject
|
42
|
+
|
43
|
+
==== Create a Blank Project using _config.yaml config file, add artefacts
|
44
|
+
|
45
|
+
- Clean up project and create a MyBlankProject (= directory) using --force option
|
46
|
+
|
47
|
+
cd ~/hyla
|
48
|
+
rm -rf MyBlankProject/
|
49
|
+
|
50
|
+
# Create a Blank project but containing the yaml config file
|
51
|
+
hyla new -b MyBlankProject
|
52
|
+
|
53
|
+
cd MyBlankProject
|
54
|
+
|
55
|
+
- Create Asciidoc files from samples (book, article, image, audio, ...)
|
56
|
+
|
57
|
+
hyla add --a article
|
58
|
+
hyla add --a book
|
59
|
+
hyla add --a image
|
60
|
+
hyla add --a audio
|
61
|
+
hyla add --a video
|
62
|
+
hyla add --a source
|
63
|
+
hyla add --a table
|
64
|
+
|
65
|
+
==== Generate HTML Content of an existing project (asciidoc 2 html)
|
66
|
+
|
67
|
+
hyla generate -r adoc2html -s ~/hyla/MyBlankProject/ -d ~/hyla/MyBlankProject/generated_content
|
68
|
+
|
69
|
+
==== Generate HTML Content of an existing project (asciidoc 2 html) with a different style
|
70
|
+
|
71
|
+
Styles available : liberation, asciidoctor, colony, foundation, foundation-lime, foundation-potion, github, golo, iconic, maker, readthedocs, riak, rocket-panda, rubygems
|
72
|
+
|
73
|
+
hyla generate -r adoc2html -s ~/hyla/MyBlankProject/ -d ~/hyla/MyBlankProject/generated_content --style liberation
|
74
|
+
hyla generate -r adoc2html -s ~/hyla/MyBlankProject/ -d ~/hyla/MyBlankProject/generated_content --style github
|
75
|
+
hyla generate -r adoc2html -s ~/hyla/MyBlankProject/ -d ~/hyla/MyBlankProject/generated_content --style foundation
|
76
|
+
|
77
|
+
==== Generate HTML Content within project
|
78
|
+
|
79
|
+
hyla generate -r adoc2html -s . -d generated_content
|
80
|
+
|
81
|
+
==== Generate HTML Content within project & using Config File
|
82
|
+
|
83
|
+
As destination directory is not longer '.' (which is the case when we add artefacts using `hyla add` command, then we must change the destination directory to `generated_content`. the original file is
|
84
|
+
still available as it will backup by ruby
|
85
|
+
|
86
|
+
ruby -i.bak -pe 'sub(%r{destination: .},"destination: generated_content")' _config.yaml
|
87
|
+
hyla generate
|
88
|
+
hyla generate -y foundation
|
89
|
+
|
90
|
+
|
91
|
+
=== Project from Template
|
92
|
+
|
93
|
+
==== Create a project using a template (training)
|
94
|
+
|
95
|
+
cd ~/hyla
|
96
|
+
hyla new --t training MyTrainingProject
|
97
|
+
|
98
|
+
// TODO Refactor Training Exercises Template
|
99
|
+
hyla new --t training-exercises MyTrainingExercisesProject
|
100
|
+
|
101
|
+
// TODO - Add images
|
102
|
+
hyla new --t book MyBookProject
|
103
|
+
|
104
|
+
==== Generate content and watch it
|
105
|
+
|
106
|
+
cd ~/hyla/MyTrainingProject
|
107
|
+
ruby -i.bak -pe 'sub(%r{destination: .},"destination: generated_content")' _config.yaml
|
108
|
+
hyla generate
|
109
|
+
|
110
|
+
hyla watch -s ~/hyla/MyTrainingProject/ -d ~/hyla/MyTrainingProject/generated_content
|
111
|
+
|
112
|
+
=== Table Of Content To asciidoc
|
113
|
+
|
114
|
+
==== Generate an asciidoctor project from a Table of Content
|
115
|
+
|
116
|
+
The entry point of a Documentation site, Training, Publication or Book will consist most of the time to create
|
117
|
+
a Table Of Content which is a collection of modules with chapters that we will develop. As this process to elaborate
|
118
|
+
the structure of the project will consume lot of time/effort, Hyla will simplify your life as it allows from a TOC file
|
119
|
+
|
120
|
+
|
121
|
+
= A. Introduction module
|
122
|
+
>> This is the module 'A. Introduction'
|
123
|
+
|
124
|
+
== 1. Chapter
|
125
|
+
This is a chapter about ...
|
126
|
+
|
127
|
+
== 2. Chapter
|
128
|
+
This is a Chapter about ...
|
129
|
+
|
130
|
+
=== 2.1. Section
|
131
|
+
This is a sub chapter
|
132
|
+
|
133
|
+
= B. Instruction module
|
134
|
+
>> This is the module 'B. Instruction module'
|
135
|
+
|
136
|
+
== 1. Chapter
|
137
|
+
This is a Chapter about ...
|
138
|
+
|
139
|
+
to generate a collection of folders (= modules) containing files which represent the chapters (== Titles of the TOC ).
|
140
|
+
For each module (= Module), an index file is also created including the files listed in a module. That can be serve to generate a
|
141
|
+
slideshow presentation using as backend (DeckJS, DZSlides, ...) later on.
|
142
|
+
|
143
|
+
- Delete existing project
|
144
|
+
|
145
|
+
cd ~/hyla
|
146
|
+
rm -rf MyTocProject/
|
147
|
+
|
148
|
+
- Generate asciidoc files from a Table Of Content (= collection of folders and files) and next HTML
|
149
|
+
|
150
|
+
hyla generate -r toc2adoc -p my-project -d ~/hyla/MyTocProject/ --toc ~/MyProjects/hyla/data/toc.adoc
|
151
|
+
hyla generate -r adoc2html -s ~/hyla/MyTocProject/ -d ~/hyla/MyTocProject/generated_content
|
152
|
+
|
153
|
+
Example about what is generated
|
154
|
+
|
155
|
+
>> Project Name : my-project <<
|
156
|
+
>> Directory created : ~/hyla/MyTocProject/A_Introduction_module <<
|
157
|
+
= File created : 1_Chapter
|
158
|
+
= File created : 2_Chapter
|
159
|
+
= File created : 3_Chapter
|
160
|
+
>> Directory created : ~/Temp/MyTocProject/B_Instruction_module <<
|
161
|
+
= File created : 1_Chapter
|
162
|
+
>> Directory created : /Temp/MyTocProject/C_Installation_module <<
|
163
|
+
= File created : 1_Chapter
|
164
|
+
= File created : 2_Chapter
|
165
|
+
|
166
|
+
|
167
|
+
- Watch asciidoc files and generate new HTML content when a modification is detected
|
168
|
+
|
169
|
+
While you develop asciidoc(tor) documents, it is interesting to consult the files rendered in HTML. Hyla supports such option with LiverReload
|
170
|
+
as a WebSocket server is exposed for the browser. To watch files and let's asciidoctor to render them, simply open a terminal and provide as
|
171
|
+
parameter the source directory containing the files to be watched.
|
172
|
+
|
173
|
+
hyla watch -s ~/hyla/MyTocProject/ -d ~/hyla/MyTocProject/generated_content
|
174
|
+
|
175
|
+
==== Generate an asciidoctor project from a Table of Content using YAML config file and watch content
|
176
|
+
|
177
|
+
rm -rf ~/hyla/MyTocProject
|
178
|
+
cd ~/hyla
|
179
|
+
hyla new --blank MyTocProject
|
180
|
+
cd MyTocProject
|
181
|
+
hyla generate --r toc2adoc
|
182
|
+
|
183
|
+
# Change destination in config files or pass info as option
|
184
|
+
# cd ../MyTocProject/
|
185
|
+
# subl _config.yaml
|
186
|
+
hyla generate -r adoc2html
|
187
|
+
|
188
|
+
hyla watch -s ~/hyla/MyTocProject/ -d generated_content
|
189
|
+
|
190
|
+
==== Generate a DeckJS Slideshow for a module
|
191
|
+
|
192
|
+
cd ~/hyla/MyTocProject
|
193
|
+
hyla generate --backend deckjs -s A_Introduction_module/ -d A_Introduction_module/generated_content -r index2html
|
194
|
+
|
195
|
+
==== Generate a DeckJS Slideshow for a Project (all the TOC)
|
196
|
+
|
197
|
+
cd ~/hyla/MyTocProject
|
198
|
+
hyla generate --backend deckjs -s . -d generated_content -r index2html
|
199
|
+
|
200
|
+
==== Server content locally - HTTP Server
|
201
|
+
|
202
|
+
To simplify your life, a simple HTTP Server can be started by Hyla and will allow to consult/browse HTML files generated. In this case, start this
|
203
|
+
Hyla command in another Terminal
|
204
|
+
|
205
|
+
hyla serve -P 4000 -H localhost -b /hyla/ --out_dir ~/hyla/MyTrainingProject/generated_content/
|
206
|
+
|
207
|
+
=== Generate a Slideshow
|
208
|
+
|
209
|
+
==== DeckJS
|
210
|
+
|
211
|
+
rm -rf ~/hyla/MyDeckSlideShow
|
212
|
+
cd ~/hyla
|
213
|
+
hyla new -b MyDeckSlideShow
|
214
|
+
|
215
|
+
hyla add --t slideshow -a deckjs -d MyDeckSlideShow
|
216
|
+
hyla generate --backend deckjs -s ~/hyla/MyDeckSlideShow -d ~/hyla/MyDeckSlideShow/generated_content -r adoc2html
|
217
|
+
|
218
|
+
==== Different DeckJS Style options
|
219
|
+
|
220
|
+
hyla generate --backend deckjs -s ~/hyla/MyDeckSlideShow -d ~/hyla/MyDeckSlideShow/generated_content -r adoc2html -a deckjs_theme=swiss,deckjs_transition=fade
|
221
|
+
hyla generate --backend deckjs -s ~/hyla/MyDeckSlideShow -d ~/hyla/MyDeckSlideShow/generated_content -r adoc2html -a deckjs_theme=web-2.0,deckjs_transition=horizontal-slide
|
222
|
+
|
223
|
+
==== RevealJS
|
224
|
+
|
225
|
+
rm -rf ~/hyla/MyRevealSlideShow
|
226
|
+
cd ~/hyla
|
227
|
+
hyla new -b MyRevealSlideShow
|
228
|
+
|
229
|
+
hyla add --t slideshow -a revealjs -d MyRevealSlideShow
|
230
|
+
|
231
|
+
cd MyRevealSlideShow
|
232
|
+
|
233
|
+
hyla generate --backend revealjs -s . -d generated_content -r adoc2html
|
234
|
+
|
235
|
+
|
236
|
+
=== Generate a PDF
|
237
|
+
|
238
|
+
A PDF document can be created using the rendering option `html2pdf`. To render the HTML file, Hyla uses the following Ruby
|
239
|
+
libraries https://github.com/pdfkit/pdfkit[pdfkit] and https://github.com/wkhtmltopdf/wkhtmltopdf[wkhtmltopdf].
|
240
|
+
|
241
|
+
- Clean and create a MyPdfProject (= directory)
|
242
|
+
|
243
|
+
cd ~/hyla
|
244
|
+
rm -rf MyPdfroject/
|
245
|
+
hyla new -b MyPdfProject --force
|
246
|
+
cd MyPdfProject
|
247
|
+
|
248
|
+
- Create Asciidoc file from sample (book)
|
249
|
+
|
250
|
+
hyla add -a book --t asciidoc -d .
|
251
|
+
|
252
|
+
- Generate HTML content using foundation stylesheet
|
253
|
+
|
254
|
+
hyla generate --style foundation
|
255
|
+
|
256
|
+
- We change the rendering from adoc2html to html2pdf
|
257
|
+
|
258
|
+
ruby -i.bak -pe 'sub(%r{rendering: adoc2html},"rendering: html2pdf")' _config.yaml
|
259
|
+
|
260
|
+
- Source directory & Destination directory
|
261
|
+
|
262
|
+
ruby -i.bak -pe 'sub(%r{source: .},"source: ./generated_content")' _config.yaml
|
263
|
+
ruby -i.bak -pe 'sub(%r{destination: generated_content},"destination: ./generated_content/pdf")' _config.yaml
|
264
|
+
|
265
|
+
- We will generate the PDF file for the image and book
|
266
|
+
|
267
|
+
hyla generate -f asciidoc_book.html
|
268
|
+
hyla generate -f asciidoc_image.html
|
269
|
+
|
270
|
+
- Result can be opened and viewed
|
271
|
+
|
272
|
+
open generated_content/pdf/asciidoc_book.pdf
|
273
|
+
open generated_content/pdf/asciidoc_image.pdf
|
274
|
+
|
275
|
+
=== Send Email
|
276
|
+
|
277
|
+
An email can be created using as attachment an HTML file based on the information, parameters provided into the
|
278
|
+
_config.yaml file. These parameters will allow to populate the email message and add as attachment the HTML
|
279
|
+
file generated from an asciidoc file.
|
280
|
+
|
281
|
+
email_attributes:
|
282
|
+
from: "Charles Moulliard <ch007m@gmail.com>"
|
283
|
+
to: 'cmoulliard@apache.com'
|
284
|
+
subject: "This is a beautiful HTML document created by Asciidoctor and Hyla Tool"
|
285
|
+
# GMAIL
|
286
|
+
smtp_server: 'smtp.gmail.com'
|
287
|
+
port: '587'
|
288
|
+
enable_starttls: 'true'
|
289
|
+
user: 'your_gmail_user'
|
290
|
+
password: 'your_gmail_password!'
|
291
|
+
|
292
|
+
Two new options are required to process the request on the command line or using _config.yaml file
|
293
|
+
|
294
|
+
source: ./generated_content
|
295
|
+
file: name_of_html_file
|
296
|
+
|
297
|
+
- Create a Blank project
|
298
|
+
|
299
|
+
cd ~/hyla
|
300
|
+
rm -rf MyEmailProject/
|
301
|
+
hyla new -b MyEmailProject --force
|
302
|
+
cd MyEmailProject
|
303
|
+
|
304
|
+
- Add an asciidoc file (report, doc, book, article)
|
305
|
+
|
306
|
+
hyla add --a book --d .
|
307
|
+
|
308
|
+
- Edit the _config.yaml file and add the parameters required (see previously)
|
309
|
+
|
310
|
+
- Generate HTML content using foundation stylesheet
|
311
|
+
|
312
|
+
hyla generate --style asciidoctor
|
313
|
+
|
314
|
+
- Send email to the SMTP server defined
|
315
|
+
|
316
|
+
hyla sendmail
|
317
|
+
|
318
|
+
- Consult the message received in your mailbox
|
319
|
+
|
320
|
+
image::image/email_send.png[]
|
@@ -115,6 +115,8 @@ module Hyla
|
|
115
115
|
return [Configuration::backends, 'haml', 'deckjs'] * '/'
|
116
116
|
when 'revealjs'
|
117
117
|
return [Configuration::backends, 'slim', 'revealjs'] * '/'
|
118
|
+
when 'revealjs-redhat'
|
119
|
+
return [Configuration::backends, 'slim', 'revealjs-redhat'] * '/'
|
118
120
|
when 'html5'
|
119
121
|
return [Configuration::backends, 'slim', 'html5'] * '/'
|
120
122
|
else
|
@@ -142,14 +144,18 @@ module Hyla
|
|
142
144
|
# Replace underscore with space, next digits & space with nothing & Capitalize
|
143
145
|
module_name = module_name.gsub('_', ' ').gsub(/^\d{1,2}\s/, '').capitalize
|
144
146
|
|
147
|
+
# f_html = File.read(Configuration::covers + '/cover.html')
|
148
|
+
|
145
149
|
Hyla.logger.debug "Module name : " + module_name
|
146
150
|
|
147
151
|
# Do the HTML Rendering
|
148
152
|
parameters = {:course_name => course_name,
|
149
153
|
:module_name => module_name,
|
150
|
-
:image_path => bg_image_path}
|
154
|
+
:image_path => bg_image_path }
|
151
155
|
res = template.render(Object.new, parameters)
|
152
156
|
|
157
|
+
# res = f_html
|
158
|
+
|
153
159
|
#
|
154
160
|
# Create the cover file and do the rendering of the image
|
155
161
|
#
|
@@ -159,7 +165,8 @@ module Hyla
|
|
159
165
|
out_file.puts "\n"
|
160
166
|
|
161
167
|
# Do the Rendering Image
|
162
|
-
kit = IMGKit.new(res, quality:
|
168
|
+
kit = IMGKit.new(res, quality: 100, width: 1280, height: 800)
|
169
|
+
|
163
170
|
kit.to_img(:png)
|
164
171
|
kit.to_file(image_name)
|
165
172
|
end
|
@@ -246,6 +253,8 @@ module Hyla
|
|
246
253
|
self.cp_resources_to_dir(File.dirname(html_dir), 'deck.js')
|
247
254
|
when 'revealjs'
|
248
255
|
self.cp_resources_to_dir(File.dirname(html_dir), 'revealjs')
|
256
|
+
when 'revealjs-redhat'
|
257
|
+
self.cp_resources_to_dir(File.dirname(html_dir), 'revealjs-redhat')
|
249
258
|
end
|
250
259
|
|
251
260
|
#
|
data/lib/hyla/configuration.rb
CHANGED
@@ -84,6 +84,13 @@ module Hyla
|
|
84
84
|
File.expand_path(COVER_TEMPLATE, File.dirname(__FILE__))
|
85
85
|
end
|
86
86
|
|
87
|
+
#
|
88
|
+
# Cover Slim Template
|
89
|
+
#
|
90
|
+
def self.covers
|
91
|
+
File.expand_path(COVERS, File.dirname(__FILE__))
|
92
|
+
end
|
93
|
+
|
87
94
|
#
|
88
95
|
# Templates Location
|
89
96
|
#
|
@@ -256,6 +263,8 @@ module Hyla
|
|
256
263
|
|
257
264
|
STYLES = '../../lib/resources/assets/styles'
|
258
265
|
|
266
|
+
COVERS = '../../lib/resources/assets/cover'
|
267
|
+
|
259
268
|
TEMPLATES = '../../lib/templates'
|
260
269
|
|
261
270
|
RESOURCES = '../../lib/resources'
|
@@ -264,7 +273,7 @@ module Hyla
|
|
264
273
|
|
265
274
|
BACKENDS = '../../lib/resources/backends'
|
266
275
|
|
267
|
-
COVER_TEMPLATE = '../../lib/resources/cover.slim'
|
276
|
+
COVER_TEMPLATE = '../../lib/resources/assets/cover/new_cover.slim'
|
268
277
|
|
269
278
|
ASSESSMENT_TXT = File.open(self.templates + '/course/assessment.txt','r').read
|
270
279
|
|
data/lib/hyla/project.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Hyla
|
2
|
-
VERSION = '1.0.7.pre.
|
2
|
+
VERSION = '1.0.7.pre.3'
|
3
3
|
DESCRIPTION = 'Asciidoctor Hyla - Command Line tool to create new project, watch modifications, generate content, publish or consult it live !'
|
4
4
|
SUMMARY = 'Asciidoctor Hyla - builder/generator of HTML5, slideshow. Watch modifications, generate content, publish or consult it live !'
|
5
5
|
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html class="sl-root base export loaded">
|
3
|
+
<head>
|
4
|
+
<meta name="viewport"
|
5
|
+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
|
6
|
+
<meta charset="utf-8">
|
7
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
8
|
+
<title>New GPE Cover</title>
|
9
|
+
<link rel="stylesheet" type="text/css" href="lib/offline-v2.css">
|
10
|
+
<link rel="stylesheet" type="text/css" href="lib/theme-output.css">
|
11
|
+
</head>
|
12
|
+
|
13
|
+
<body class="theme-font-overpass">
|
14
|
+
<div class="reveal">
|
15
|
+
<div class="slides">
|
16
|
+
<section class="has-dark-background" data-background-color="#cc0000"
|
17
|
+
data-background-image="image/1156524-bg_redhat.png">
|
18
|
+
<div class="sl-block" data-block-type="text"
|
19
|
+
style="width: 832px; left: 80px; top: 100px; height: auto;">
|
20
|
+
<div class="sl-block-content"><h1>MESSAGING DESIGN AND DEVELOPMENT WITH FUSE AMQ</h1></div>
|
21
|
+
</div>
|
22
|
+
<div class="sl-block" data-block-type="text"
|
23
|
+
style="height: auto; min-width: 30px; min-height: 30px; width: 776px; left: 80px; top: 390px;">
|
24
|
+
<div class="sl-block-content"><h2>INTRODUCTION TO MESSAGING</h2></div>
|
25
|
+
</div>
|
26
|
+
<div class="sl-block" data-block-type="image"
|
27
|
+
style="min-width: 30px; min-height: 30px; width: 211.706666666667px; height: 68px; left: 80px; top: -50px;">
|
28
|
+
<div class="sl-block-content" style="z-index: 13;"><img style="visibility: visible;"
|
29
|
+
data-natural-width="467"
|
30
|
+
data-natural-height="150"
|
31
|
+
data-src="image/1156515-Logo_RH_RGB_Reverse.png">
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</section>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
<script src="lib/head.min.js"></script>
|
38
|
+
<script src="lib/reveal.min.js"></script>
|
39
|
+
<script>
|
40
|
+
Reveal.initialize({
|
41
|
+
controls: true,
|
42
|
+
progress: true,
|
43
|
+
history: true,
|
44
|
+
mouseWheel: false,
|
45
|
+
|
46
|
+
autoSlide: 0,
|
47
|
+
autoSlideStoppable: true,
|
48
|
+
|
49
|
+
rolling_links: true,
|
50
|
+
center:false,
|
51
|
+
loop: false,
|
52
|
+
rtl: false,
|
53
|
+
|
54
|
+
transition: "none",
|
55
|
+
backgroundTransition: "none",
|
56
|
+
|
57
|
+
dependencies: []
|
58
|
+
});
|
59
|
+
</script>
|
60
|
+
|
61
|
+
</body>
|
62
|
+
</html>
|