giblish 1.0.0.rc2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/unit_tests.yml +2 -2
  3. data/.ruby-version +1 -1
  4. data/Changelog.adoc +11 -3
  5. data/README.adoc +68 -72
  6. data/docs/howtos/{trigger_generation.adoc → setup_static_site.adoc} +23 -27
  7. data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/Render Documents.png +0 -0
  8. data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/View Documents.png +0 -0
  9. data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/deploy_with_hooks.graphml +0 -0
  10. data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/deploy_with_hooks.svg +0 -0
  11. data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/deploy_with_jenkins.graphml +0 -0
  12. data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/deploy_with_jenkins.svg +0 -0
  13. data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/docgen_github.puml +0 -0
  14. data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/giblish_deployment.graphml +0 -0
  15. data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/post-receive-example.sh +0 -0
  16. data/docs/reference/develop_and_build.adoc +27 -0
  17. data/giblish.gemspec +10 -6
  18. data/lib/giblish/application.rb +4 -4
  19. data/lib/giblish/cmdline.rb +2 -2
  20. data/lib/giblish/configurator.rb +4 -4
  21. data/lib/giblish/docattr_providers.rb +3 -3
  22. data/lib/giblish/indexbuilders/dotdigraphadoc.rb +4 -4
  23. data/lib/giblish/search/headingindexer.rb +1 -1
  24. data/lib/giblish/search/searchquery.rb +6 -6
  25. data/lib/giblish/version.rb +1 -1
  26. data/web_apps/gh_webhook_trigger/gh_webhook_trigger.rb +1 -30
  27. metadata +42 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 306ffd38e0b46b1da0bde8fbfe13e25edd2271cf3c9e40a0bd595e0bd92ab474
4
- data.tar.gz: 63124dcd57d6bc1a4b11c8b92b4250071b4d6bb1f3068e25e8465759722c2b82
3
+ metadata.gz: 536fb7fa58df4bca2bfa5b73f68ebec0dd32bff797c3401cd20e6ccb20450db7
4
+ data.tar.gz: 3f6f51691b25f64cf80da13d9467f5ea8f1ee296390efd7f77cd0ce49d7195c7
5
5
  SHA512:
6
- metadata.gz: 5f66a14a039fc925c55aef093b28db11f2aabc585b1dae43cf6ab39c42996c13ec85cfdd5f3c4decdc618caa0dfdaf8b43eb5152e9cf53c5f0e60ba50d1e9a52
7
- data.tar.gz: 575c20796a4d9aef25f90760dd1fd9e1bf7897fe9284951486b214bda56cb28a835c2c6a9c8306c91c50764bfb1c3ca170756a276a45b27b94ffc59c2fe972ad
6
+ metadata.gz: 855851b721c005724dd76daeafeb43945bda104f0edc3628530efa4b1a87bece735547be67f9ac584fbae8b1b640f36b19cc98112864e22ff1edd775be23a9a6
7
+ data.tar.gz: ef6c403e03b3abf628ddd896e935f3dbaf096a4368bb1702d665f269de1eddbccd2a2efeb2647e00dfa18888a7b82d47be711b39e4cddedcd7006ede4d96d471
@@ -2,14 +2,14 @@ name: Giblish CI checks
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [personal/rillbert/svg_index]
5
+ branches: [personal/rillbert/*, main]
6
6
 
7
7
  jobs:
8
8
  test:
9
9
  runs-on: ubuntu-latest
10
10
  strategy:
11
11
  matrix:
12
- ruby-version: ["2.7", "3.0"]
12
+ ruby-version: ["2.7", "3.0", "3.1"]
13
13
 
14
14
  steps:
15
15
  - name: Install binutils
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.3
1
+ 3.1.2
data/Changelog.adoc CHANGED
@@ -1,12 +1,20 @@
1
1
  = giblish changelog
2
+ :docid: G-006
2
3
 
3
4
  == Not yet in place
4
5
 
6
+ * Investigate how to remove tmp/cache files and dirs during graph generation
5
7
  * Update docs for giblish.
6
- ** the later part of the trigger_generation doc
7
- ** go through and fix spelling
8
+ ** write instructions for github webhook triggered generation
8
9
  * Update the default css for giblish html generation.
9
- * Maybe put some effort into the ConversionInfo hierarchy
10
+
11
+ == v2.0.0
12
+
13
+ This is a breaking release because the internal dependencies to asciidoctor-pdf has been bumped from one major release to the next. `giblish` itself has not seen any major, internal, updates.
14
+
15
+ Breaking changes::
16
+ * Dependency on asciidoctor-pdf has been bumped to v2.3
17
+ * rename some pdf attributes internally in giblish to comply with the new version of asciidoctor-pdf
10
18
 
11
19
  == v1.0.0
12
20
 
data/README.adoc CHANGED
@@ -1,11 +1,11 @@
1
1
  = giblish
2
2
  :docid: G-001
3
3
  :numbered:
4
+ :toc: preamble
5
+ :toclevels: 1
4
6
 
5
7
  image::https://github.com/rillbert/giblish/actions/workflows/unit_tests.yml/badge.svg["Build Status"]
6
8
 
7
- [abstract]
8
- == Purpose
9
9
 
10
10
  giblish converts a source directory tree containing AsciiDoc files to a destination directory tree containing the corresponding html or pdf files. It adds some handy tools for easier navigation of the resulting destination tree.
11
11
 
@@ -23,11 +23,11 @@ IMPORTANT: The examples below are *not* the official documentation for the corre
23
23
 
24
24
  |Raspberry Pi documentation
25
25
  |https://www.rillbert.se/giblish_examples/rpi_docs/giblish_example/index.html[example]
26
- |The original documentation site uses Jekyl for site generation, the link points to a mirror where some small tweaks to the docs were made to make them suitable for generation with giblish.
26
+ |The project's official documentation site uses Jekyl for site generation, the link points to a mirror where some small tweaks to the docs were made to make them suitable for generation with giblish.
27
27
 
28
28
  |The *old* asciidoctor docs
29
29
  |https://www.rillbert.se/giblish_examples/asciidoctor_docs/master/newindex.html[example]
30
- |An example of how giblish can generate the master branch of the official asciidoc.org documentation git repo can be found at
30
+ |An example of how giblish can generate the master branch of the *old, deprecated* official asciidoc.org documentation git repo.
31
31
 
32
32
  |===
33
33
 
@@ -36,18 +36,18 @@ IMPORTANT: The examples below are *not* the official documentation for the corre
36
36
  The features of giblish include:
37
37
 
38
38
  * An index page listing all rendered documents with clickable links.
39
- * A (stripped-down but nonetheless useful) text-search of your (html) documents (requires that you view your docs via a web-server.
40
39
  * If the source directory tree is part of a git repository, giblish can generate separate html/pdf trees for branches and/or tags that match a user specified regexp (see examples below).
41
40
  * Document ids - Note: the implementation of this is giblish-specific and thus you need to render your adoc files using giblish to make this work as intended. You can use document ids to:
42
41
  ** Reference one doc in the source tree from another doc without depending on file names or relative paths. The referenced doc can thus be moved within the source tree or change its file name and the reference will still be valid.
43
42
  ** Validate doc id references during document rendering and thus be alerted to any invalid doc id references.
44
43
  ** Let giblish generate a clickable graph of all document references (requires graphviz and the 'dot' tool).
45
-
46
- NOTE: giblish shall be considered stable from a usage perspective, please report bugs to the issue tracker. It's API however, is to be considered alpha, meaning that future versions may break the current usage of cmd line flags, generated artifacts, styling or other functionality.
44
+ * A stripped-down, but nonetheless useful, text-search of your html documents. This requires that you publish your docs to a web-server and setup an application on that same web-server. `giblish` provides most of the scaffolding though.
47
45
 
48
46
  == Dependencies and credits
49
47
 
50
- Giblish uses the awesome *asciidoctor* and *asciidoctor-pdf* projects under the hood. Thank you @mojavelinux and others for making these brilliant tools available!!
48
+ Giblish uses the awesome `asciidoctor` and `asciidoctor-pdf` projects under the hood. Thank you @mojavelinux and others for making these brilliant tools available!!
49
+
50
+ The official documentation of these tools as well as extensive information about the AsciiDoc syntax can be found at https://docs.asciidoctor.org
51
51
 
52
52
  == Installation
53
53
 
@@ -55,12 +55,6 @@ Giblish uses the awesome *asciidoctor* and *asciidoctor-pdf* projects under the
55
55
 
56
56
  Want to get started straight away? Go directly to the <<usage_examples>>.
57
57
 
58
- // install script for linux deps to the mathematica gem:
59
- // https://github.com/gjtorikian/mathematical/blob/47041d5492cc7c5f04105031430fb44119406f49/script/install_linux_deps
60
- //
61
- // Graphviz needed for some tests to pass
62
-
63
-
64
58
  === Some caveats
65
59
 
66
60
  When using giblish for generating docs the following applies:
@@ -82,6 +76,8 @@ Pull requests must meet the following to be considered for merging:
82
76
  To develop on giblish, you:
83
77
 
84
78
  . Install ruby on your local machine (rbenv is a good choice for handling ruby installations)
79
+ . Install necessary dependencies to install the ruby 'mathematica' gem, see eg https://github.com/gjtorikian/mathematical/blob/47041d5492cc7c5f04105031430fb44119406f49/script/install_linux_deps
80
+ . Install graphviz
85
81
  . Clone or fork the repository
86
82
  . Run the `bin/setup` script from a bash prompt
87
83
 
@@ -97,8 +93,8 @@ giblish extends the cross reference concept in asciidoc with a _document id_ mec
97
93
 
98
94
  Using doc ids makes it possible for giblish to do two things:
99
95
 
100
- . Make the reference from one document to another work even if one of the documents have been moved within the source tree.
101
- . Produce a clickable 'map' of the generated documents where the different references are clearly seen (this feature require that the 'dot' tool, part of the graphwiz package is installed on the machine where giblish is run).
96
+ . Make references from one document in the tree to another work even if one of the documents have been moved within the document source tree.
97
+ . Produce a clickable 'map' of the generated documents where the different references are clearly seen. This feature require that the 'dot' tool, part of the graphwiz package is installed on the machine where giblish is run.
102
98
 
103
99
  The use of the -d switch makes giblish parse the document twice, once to map up the doc ids and all references to them, once to actually generate the output documentation. Thus, you pay a performance penalty but this should not be a big inconvenience since the generation is quite fast in itself.
104
100
 
@@ -113,7 +109,7 @@ Example document one::
113
109
  = Document one
114
110
  :toc:
115
111
  :numbered:
116
- :docid: G-001
112
+ :docid: AB-001
117
113
 
118
114
  == Purpose
119
115
 
@@ -126,16 +122,16 @@ Example document two::
126
122
  = Document two
127
123
  :toc:
128
124
  :numbered:
129
- :docid: G-002
125
+ :docid: AB-002
130
126
 
131
127
  == Purpose
132
128
 
133
- To illustrate the use of doc id. You can refer to document one as <<:docid:G-001>>. This will display a clickable link with the doc id (G-001 in this case).
129
+ To illustrate the use of doc id. You can refer to document one as <<:docid:AB-001>>. This will display a clickable link with the doc id (AB-001 in this case).
134
130
 
135
131
  You can use the same syntax as the normal asciidoc cross-ref but replace 'xref' with ':docid:' as shown below:
136
132
 
137
- * <<:docid:G-002#purpose>> to refer to a specific section or anchor.
138
- * <<:docid:G-002#purpose,The purpose section>> to refer to a specific section and display a specific text for the link.
133
+ * <<:docid:AB-002#purpose>> to refer to a specific section or anchor.
134
+ * <<:docid:AB-002#purpose,The purpose section>> to refer to a specific section and display a specific text for the link.
139
135
  ----
140
136
 
141
137
  The above reference will work even if either document changes location or file name as long as both documents are parsed by giblish in the same run.
@@ -175,15 +171,15 @@ Generate html that can be browsed locally from file:://<my_dst_root>.
175
171
 
176
172
  * convert all .adoc or .ADOC files under the dir `my_src_root` to html and place the resulting files under the `my_dst_root` dir.
177
173
  * generate an index page named `index.html` that contains links and some info about the converted files. The file is placed in the `my_dst_root` dir.
178
- * copy the `css`, `fonts` and `images` directories found under `<working_dir>/path/to/my/resources` to `my_dst_root/web_assets`
179
- * link all generated html files to the css found at `/web_assets/css/mylayout.css`
174
+ * copy everything found under `<working_dir>/path/to/my/resources` to `my_dst_root/web_assets`
175
+ * link all generated html files to the mylayout.css found somewhere under `/web_assets`
180
176
 
181
177
  === Using a custom pdf theme for the generated pdfs
182
178
 
183
179
  giblish -f pdf -r path/to/my/resources -s mylayout my_src_root my_dst_root
184
180
 
185
181
  * convert all .adoc or .ADOC files under the dir `my_src_root` to pdf and place the resulting files under the `my_dst_root` dir. some info about the converted files. The file is placed in the `my_dst_root` dir.
186
- * the generated pdf will use the theme found at `<working_dir>/path/to/my/resources/themes/mylayout.yml`
182
+ * the pdfs will be rendered using the theme file named mylayout.yml found somewhere under `<working_dir>/path/to/my/resources`
187
183
 
188
184
  === Generate html from multiple git branches
189
185
 
@@ -196,72 +192,72 @@ Generate html that can be browsed locally from file:://<my_dst_root>.
196
192
  ** generate an index page named `index.html` that contains links and some info about the converted files. The file is placed in the `my_dst_root/<branch_name` dir.
197
193
  * generate a summary page containing links to a all branches and place it in the `my_dst_root` dir.
198
194
 
199
- === Publish the asciidoctor.org documents with text search
195
+ // === Publish the asciidoctor.org documents with text search
200
196
 
201
- giblish can be used to generate html docs suitable for serving via a web server (e.g. Apache). You can use the cgi script included in the giblish gem to provide text search capabilities.
197
+ // giblish can be used to generate html docs suitable for serving via a web server (e.g. Apache). You can use the cgi script included in the giblish gem to provide text search capabilities.
202
198
 
203
- Here is an example of how to publish the docs in the official asciidoctor.org git repo to a web server, including index pages and text search.
199
+ // Here is an example of how to publish the docs in the official asciidoctor.org git repo to a web server, including index pages and text search.
204
200
 
205
- NOTE: No consideration has been taken to how permissions are set up on the web server. Just running the below commands as-is on e.g.a standard apache set-up will bail out with 'permission denied' errors.
201
+ // NOTE: No consideration has been taken to how permissions are set up on the web server. Just running the below commands as-is on e.g.a standard apache set-up will bail out with 'permission denied' errors.
206
202
 
207
- ==== Generating the html documents
203
+ // ==== Generating the html documents
208
204
 
209
- The example assumes that you have one machine where you generate the documents and another machine that runs a web server to which you have ssh access.
205
+ // The example assumes that you have one machine where you generate the documents and another machine that runs a web server to which you have ssh access.
210
206
 
211
- The generated docs shall be accessible via _www.example.com/adocorg/with_search_
207
+ // The generated docs shall be accessible via _www.example.com/adocorg/with_search_
212
208
 
213
- You need to provide two pieces of deployment info to giblish when generating the documents:
209
+ // You need to provide two pieces of deployment info to giblish when generating the documents:
214
210
 
215
- * the uri path where to access the deployed docs (/adocorg/with_search in this example)
216
- * the path in the local file system on the web server where the search data can be accessed
217
- (/var/www/html/site_1/adocorg/with_search in this example)
211
+ // * the uri path where to access the deployed docs (/adocorg/with_search in this example)
212
+ // * the path in the local file system on the web server where the search data can be accessed
213
+ // (/var/www/html/site_1/adocorg/with_search in this example)
218
214
 
219
- The following commands will generate the asciidoctor.org documentation and deploy the result to the web server.
215
+ // The following commands will generate the asciidoctor.org documentation and deploy the result to the web server.
220
216
 
221
- . Clone the asciidoctor doc repo to your development machine
222
- +
223
- git clone https://github.com/asciidoctor/asciidoctor.org.git
217
+ // . Clone the asciidoctor doc repo to your development machine
218
+ // +
219
+ // git clone https://github.com/asciidoctor/asciidoctor.org.git
224
220
 
225
- . Generate the html documentation with the correct deployment info
226
- +
227
- giblish -j '^.*_include.*' -m -mp /var/www/html/site_1/adocorg/with_search -w /adocorg/with_search -g master --index-basename "myindex" asciidoctor.org/docs ./generated_docs
228
- +
229
- Explanation of the parameters and arguments::
230
- * *pass:[-j '^.*_include.*']* - exclude everything in the __include_ directory. (the
231
- asciidoctor.org repo stores partial docs here).
232
- * *-m* - assemble the necessary search data to support text search and include this data as part of
233
- the generated documents.
234
- * *-mp /var/www/html/site_1/adocorg/with_search* - the file system path on the deployment machine where
235
- the search data is located
236
- * *-w /adocorg/with_search* - the uri path to the deployed docs
237
- * *-g master* - publish all git branches that matches the regexp 'master' (i.e. only the 'master'
238
- branch).
239
- * *--index-basename "myindex"* - change the default name (index) that giblish uses for the generated
240
- index page. This is needed since asciidoctor.org contains an
241
- "index.adoc" file that would otherwise be overwritten by giblish.
242
- * *asciidoctor.org/docs* - the root of the source document tree.
243
- * *./generated_docs* - a temporary storage for the generated html docs on the local system.
244
- +
221
+ // . Generate the html documentation with the correct deployment info
222
+ // +
223
+ // giblish -j '^.*_include.*' -m -mp /var/www/html/site_1/adocorg/with_search -w /adocorg/with_search -g master --index-basename "myindex" asciidoctor.org/docs ./generated_docs
224
+ // +
225
+ // Explanation of the parameters and arguments::
226
+ // * *pass:[-j '^.*_include.*']* - exclude everything in the __include_ directory. (the
227
+ // asciidoctor.org repo stores partial docs here).
228
+ // * *-m* - assemble the necessary search data to support text search and include this data as part of
229
+ // the generated documents.
230
+ // * *-mp /var/www/html/site_1/adocorg/with_search* - the file system path on the deployment machine where
231
+ // the search data is located
232
+ // * *-w /adocorg/with_search* - the uri path to the deployed docs
233
+ // * *-g master* - publish all git branches that matches the regexp 'master' (i.e. only the 'master'
234
+ // branch).
235
+ // * *--index-basename "myindex"* - change the default name (index) that giblish uses for the generated
236
+ // index page. This is needed since asciidoctor.org contains an
237
+ // "index.adoc" file that would otherwise be overwritten by giblish.
238
+ // * *asciidoctor.org/docs* - the root of the source document tree.
239
+ // * *./generated_docs* - a temporary storage for the generated html docs on the local system.
240
+ // +
245
241
 
246
- . Copy the generated files to the web server
242
+ // . Copy the generated files to the web server
247
243
 
248
- scp -r ./generated_docs rillbert@my.web.server.org:/var/www/adocorg/with_search/.
249
- +
244
+ // scp -r ./generated_docs rillbert@my.web.server.org:/var/www/adocorg/with_search/.
245
+ // +
250
246
 
251
247
 
252
- ==== Copy the text search script to the web server
248
+ // ==== Copy the text search script to the web server
253
249
 
254
- This only needs to be done once (or if a new version of giblish breaks the currently used API).
250
+ // This only needs to be done once (or if a new version of giblish breaks the currently used API).
255
251
 
256
- IMPORTANT: The current version of giblish expects the script to be found at the URI path `/cgi-bin/giblish-search.cgi`. This might be customizable in future versions but is currently hard-coded. Thus, if your web-server serves pages at www.mywebsite.com, the search script must be accessible at www.mywebsite.com/cgi-bin/giblish-search.cgi
252
+ // IMPORTANT: The current version of giblish expects the script to be found at the URI path `/cgi-bin/giblish-search.cgi`. This might be customizable in future versions but is currently hard-coded. Thus, if your web-server serves pages at www.mywebsite.com, the search script must be accessible at www.mywebsite.com/cgi-bin/giblish-search.cgi
257
253
 
258
- . Find the server side script that implements text search that is included with giblish
254
+ // . Find the server side script that implements text search that is included with giblish
259
255
 
260
- gem which giblish
261
- +
256
+ // gem which giblish
257
+ // +
262
258
 
263
- In my case this returns `/var/lib/ruby/gems/2.4.0/gems/giblish-0.5.2/lib/giblish.rb`. This means that I will find the script in the same directory, i.e. `/var/lib/ruby/gems/2.4.0/gems/giblish-0.5.2/lib`.
259
+ // In my case this returns `/var/lib/ruby/gems/2.4.0/gems/giblish-0.5.2/lib/giblish.rb`. This means that I will find the script in the same directory, i.e. `/var/lib/ruby/gems/2.4.0/gems/giblish-0.5.2/lib`.
264
260
 
265
- . Copy the server side script to the /cgi-bin dir on the web server. In this example the cgi-bin dir is configured to be `/var/www/cgi-bin`
266
- +
267
- scp /var/lib/ruby/gems/2.4.0/gems/giblish-0.5.2/lib/giblish-search.cgi rillbert@my.web.server.org:/var/www/cgi-bin/giblish-search.cgi
261
+ // . Copy the server side script to the /cgi-bin dir on the web server. In this example the cgi-bin dir is configured to be `/var/www/cgi-bin`
262
+ // +
263
+ // scp /var/lib/ruby/gems/2.4.0/gems/giblish-0.5.2/lib/giblish-search.cgi rillbert@my.web.server.org:/var/www/cgi-bin/giblish-search.cgi
@@ -1,5 +1,6 @@
1
- = Trigger document generation
2
- :imagesdir: trigger_generation_im
1
+ = Setup a static website
2
+ using giblish and git
3
+ :imagesdir: setup_static_site_assets
3
4
  :numbered:
4
5
  :docid: G-003
5
6
  :toc: left
@@ -8,18 +9,18 @@
8
9
 
9
10
  To describe how to use `giblish` as a tool for creating a static web site backed by a git repo that is automatically generated each time a contributor push changes to the git repo.
10
11
 
11
- This text covers the followwing deployment scenarios:app-name:
12
+ This text covers the following deployment scenarios:
12
13
 
13
- . Using a git hook together with a simple (well) shell script
14
+ . Using a git hook together with a shell script.
14
15
  . Using a git hook together with Jenkins.
15
16
 
16
- They have been tested on Linux servers (Ubuntu). Most of the tools and scripts should work on a Windows server as well but might need some tweaking and is, again, not tested.
17
+ They have been tested on Linux servers (Ubuntu). Most of the tools and scripts should work on a Windows server as well but might need some tweaking and it is not tested.
17
18
 
18
19
  If you want to dive straight in and setup one of the scenarios below, jump to <<setup_instructions>>, otherwise read on for some examples and considerations.
19
20
 
20
21
  == Git hook and shell script
21
22
 
22
- This requires the least number of dependencies to work but is more limited.
23
+ This requires the least number of external dependencies but is limited.
23
24
 
24
25
  .Deploy using git hook and shell script
25
26
  image::deploy_with_hooks.svg[]
@@ -30,13 +31,13 @@ A 'Main Repo'::
30
31
  The common (bare) git repo used by all content writers to push updates to. This repo shall be setup with a server-side hook (_post-receive_) that initiates the html generation and is triggered by each push to the repo.
31
32
 
32
33
  A 'Staging Repo'::
33
- A mirror of the _Main Repo_ that fulfills two functions:
34
+ A mirror of the _Main Repo_ that fulfils two functions:
34
35
 
35
36
  . to provide a checked-out working tree with the source files (adoc files).
36
37
  . to provide a script that uses giblish to generate html documents and publish those docs to a location where a web server can access them.
37
38
 
38
- Web Server::
39
- Apache, Ngnix or other web server that provides clients with HTML pages located somewhere on the file system on the server (e.g under /var/www/... )
39
+ A Web Server::
40
+ Apache, Nginx or other web server that provides clients with HTML pages located somewhere on the file system on the server (e.g under /var/www/... )
40
41
 
41
42
  === Pros & Cons
42
43
 
@@ -48,7 +49,7 @@ Cons::
48
49
  * The hook and publish scripts provided with giblish runs synchronously at each push from a _Doc Writer_ to the _Main Repo_. The time it takes to generate the HTML docs from the adoc source will thus be added to each push to the _Main Repo_.
49
50
  * You need to manually setup the _Staging Repo_ on the server and this is a bit more 'hackish' than letting a build orchestrator tool implement a proper 'build' of your documents. You might for example end up with race conditions if two pushes to the _Main Repo_ are done close in time.
50
51
 
51
- === Using a combination of Jenkins and git hook
52
+ == Using a combination of Jenkins and git hook
52
53
 
53
54
  This setup adds a Jenkins (or similar build orchestrator) installation so it is more tools to setup but offer more flexibility and performance. It is also more robust and thus more 'production friendly'.
54
55
 
@@ -66,9 +67,9 @@ Jenkins instance::
66
67
  A running instance of Jenkins and one or more defined build jobs that use giblish to build the HTML documents.
67
68
 
68
69
  Web Server::
69
- Apache, Ngnix or other web server that provides clients with HTML pages located somewhere on the file system on the server (e.g under /var/www/... )
70
+ Apache, Nginx or other web server that provides clients with HTML pages located somewhere on the file system on the server (e.g under /var/www/... )
70
71
 
71
- ==== Pros & cons
72
+ === Pros & cons
72
73
 
73
74
  Pros::
74
75
  * Using Jenkins enables a lot of flexibility and scaleability. You can setup multiple Jenkins agents to increase performance, you can define many build jobs where each job builds either a particular branch from a particular git repo or many branches from one or many repos.
@@ -83,9 +84,9 @@ Follow the instructions below to get one of the above setups running on your ser
83
84
 
84
85
  === Some preliminary notes
85
86
 
86
- IMPORTANT: Setting up permissions and secure your setup from unwanted access is outside the scope of these instructions. You must understand and implement the proper user/groups/rules for your use case.
87
+ IMPORTANT: Setting up permissions and secure your setup from unwanted access is outside the scope of these instructions. You must understand and implement the proper authentication rules for your use case.
87
88
 
88
- NOTE: git server side hooks are used in the instructions below. For details on git hooks see https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks[this doc].
89
+ git server side hooks are used in the instructions below. For details on git hooks see https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks[this doc].
89
90
 
90
91
  [[common_setup]]
91
92
  === Initial setup
@@ -94,9 +95,9 @@ These steps are common to both deployment scenarios.
94
95
 
95
96
  giblish setup::
96
97
  . Install ruby on the _Server_ (a version no more than 18 months old)
97
- . Install giblish on the _Server_ using `gem install giblish`
98
+ . Install giblish on the _Server_. See e.g. <<:docid:G-001>>
98
99
 
99
- git and gitrepo setup::
100
+ git and git repo setup::
100
101
  . Install git on the _Server_.
101
102
  . Setup the *bare* _Main Repo_ on the _Server_ by either.
102
103
  .. Copy a bare repo you already use to the _Server_ file system.
@@ -104,7 +105,7 @@ git and gitrepo setup::
104
105
  +
105
106
  NOTE: If you start with an empty, bare, _Main Repo_ on the _Server_, it is a good idea to directly clone it to your local machine, commit some content to the 'master' branch and push the result back to the _Main Repo_. An empty, bare repo does not even contain a 'master' branch from the start and this can lead to some edge cases that complicate things.
106
107
 
107
- === Use a git hook and shell script
108
+ === Scenario 1 - use a git hook and shell script
108
109
 
109
110
  First, follow the steps described in <<common_setup>>. Then proceed with the steps below.
110
111
 
@@ -125,13 +126,10 @@ git clone file:///usr/local/main_repo.git
125
126
  +
126
127
  .Find the `post-receive` template in the giblish gem
127
128
  ====
128
- On a server running Ubuntu 16.04, `gem which giblish` returns:
129
-
130
- /var/lib/gems/2.6.0/gems/giblish-0.7.0/lib/giblish.rb
129
+ run the following to copy the post-receive template to your current directory:
130
+
131
+ cp $(dirname $(gem which giblish))/../scripts/hooks/post-receive.example .
131
132
 
132
- and the template hook can be found under
133
-
134
- /var/lib/gems/2.6.0/gems/giblish-0.7.0/scripts/hooks/post-receive.example
135
133
  ====
136
134
 
137
135
  . Rename the copy to `post-receive`
@@ -143,8 +141,6 @@ That's it. You can now push to your _Main Repo_ and the `post-receive` hook will
143
141
 
144
142
  === Setup the git hook and Jenkins scenario
145
143
 
146
- TBD...
147
-
148
144
  First, follow the steps described in <<common_setup>>. Then proceed with the steps below.
149
145
 
150
146
  ==== Sequence for generating documents
@@ -162,7 +158,7 @@ image::Render Documents.png[]
162
158
  ====
163
159
  [source,bash]
164
160
  ----
165
- include::../scripts/hooks/post-receive.example[]
161
+ include::../../scripts/hooks/post-receive.example[]
166
162
  ----
167
163
  ====
168
164
 
@@ -175,6 +171,6 @@ Below is an example of a `post-update` hook that triggers Jenkins jobs after a p
175
171
  ====
176
172
  [source,bash]
177
173
  ----
178
- include::../docgen/scripts/githook_examples/post-update.example[]
174
+ include::../../scripts/hooks/post-update.example[]
179
175
  ----
180
176
  ====
@@ -0,0 +1,27 @@
1
+ = Developing and building giblish
2
+ :docid: G-005
3
+
4
+ NOTE: giblish is developed using the https://github.com/rbenv/rbenv[rbenv] ruby version manager. It is *strongly recommended* to setup and use this tool when developing or building giblish.
5
+
6
+ [[build_gem]]
7
+ == Building giblish as a gem
8
+
9
+ Setup dependencies::
10
+ . Setup your `rbenv` environment.
11
+ . Check out the branch you want to build.
12
+ . Open a terminal in the top directory of the checked-out branch.
13
+ . Install giblish' dependencies using `bundle install`
14
+ .. *Note* The `mathematical` gem is currently a development dependency for giblish and it can be a bit tricky to build and install its native dependencies. How to do that is outside the scope of this document.
15
+
16
+ Run the unit tests::
17
+ . Run the unit tests using `bundle exec rake`.
18
+
19
+ Build the gem::
20
+ . Build the gem using `bundle exec gem build`
21
+
22
+ == Publish a release
23
+
24
+ . Create a new release in GitHub using the same version nr as stated in `.../lib/version.rb`.
25
+ . Build the gem using the steps from <<build_gem>>.
26
+ . Publish the gem to https://rubygems.org/ by running `bundle exec gem push giblish-<version>.gem`
27
+
data/giblish.gemspec CHANGED
@@ -45,11 +45,12 @@ Gem::Specification.new do |spec|
45
45
  spec.require_paths = ["lib"]
46
46
 
47
47
  # Development deps
48
- spec.add_development_dependency "minitest", "~> 5.0"
49
- spec.add_development_dependency "standard", "~> 1.1"
48
+ spec.add_development_dependency "minitest", "~> 5.16"
49
+ spec.add_development_dependency "standard", "~> 1.16"
50
50
  spec.add_development_dependency "rake", "~> 13.0"
51
51
  spec.add_development_dependency "oga", "~> 3.3"
52
- spec.add_development_dependency "thor", "~> 0.20.3"
52
+ # spec.add_development_dependency "thor", "~> 0.20.3"
53
+ spec.add_development_dependency "thor", "~> 1.2"
53
54
  spec.add_development_dependency "asciidoctor-mathematical", "~> 0.3.5"
54
55
  # needed for the sinatra-based apps
55
56
  spec.add_development_dependency "sinatra", "~>2.1"
@@ -58,11 +59,14 @@ Gem::Specification.new do |spec|
58
59
  spec.add_development_dependency "rack-test", "1.1"
59
60
 
60
61
  # Run-time deps
62
+ # 'matrix' needed because of incompatibilities between prawn v2.4
63
+ # and ruby 3.1
64
+ spec.add_runtime_dependency "matrix", "~>0.4"
61
65
  spec.add_runtime_dependency "warning", "~>1.2"
62
66
  spec.add_runtime_dependency "asciidoctor", "~>2.0", ">= 2.0.17"
63
67
  spec.add_runtime_dependency "asciidoctor-diagram", ["~> 2.2"]
64
- spec.add_runtime_dependency "asciidoctor-pdf", ["~> 1.6", ">= 1.6.2"]
65
- spec.add_runtime_dependency "git", "~> 1.9"
66
- spec.add_runtime_dependency "rouge", "~> 3.0"
68
+ spec.add_runtime_dependency "asciidoctor-pdf", ["~> 2.3"]
69
+ spec.add_runtime_dependency "git", "~> 1.12"
70
+ spec.add_runtime_dependency "rouge", "~> 3.30"
67
71
  spec.add_runtime_dependency "prawn-svg", "~> 0.32.0"
68
72
  end
@@ -232,10 +232,10 @@ module Giblish
232
232
 
233
233
  def select_conversion(user_opts)
234
234
  case user_opts
235
- in {branch_regex: _} | {tag_regex: _}
236
- GitRepoConvert.new(user_opts)
237
- else
238
- DirTreeConvert.new(user_opts)
235
+ in {branch_regex: _} | {tag_regex: _}
236
+ GitRepoConvert.new(user_opts)
237
+ else
238
+ DirTreeConvert.new(user_opts)
239
239
  end
240
240
  end
241
241
  end
@@ -285,12 +285,12 @@ module Giblish
285
285
  end
286
286
 
287
287
  if opts.make_searchable && opts.format != "html"
288
- raise OptionParser::InvalidArgument, "Error: The --make-searchable option "\
288
+ raise OptionParser::InvalidArgument, "Error: The --make-searchable option " \
289
289
  "is only supported for html rendering."
290
290
  end
291
291
 
292
292
  if opts.search_action_path && !opts.make_searchable
293
- raise OptionParser::InvalidArgument, "Error: The --server-search-path "\
293
+ raise OptionParser::InvalidArgument, "Error: The --server-search-path " \
294
294
  "flag is only supported in combination with the --make-searchable (-m) flag."
295
295
  end
296
296
  end
@@ -86,10 +86,10 @@ module Giblish
86
86
  )
87
87
 
88
88
  layout_config = case config_opts
89
- in format: "html" then HtmlLayoutConfig.new(config_opts)
90
- in format: "pdf" then PdfLayoutConfig.new(config_opts)
91
- else
92
- raise OptionParser::InvalidArgument, "The given cmd line flags are not supported: #{config_opts.inspect}"
89
+ in format: "html" then HtmlLayoutConfig.new(config_opts)
90
+ in format: "pdf" then PdfLayoutConfig.new(config_opts)
91
+ else
92
+ raise OptionParser::InvalidArgument, "The given cmd line flags are not supported: #{config_opts.inspect}"
93
93
  end
94
94
 
95
95
  # setup all options from the chosen layout configuration but
@@ -43,7 +43,7 @@ module Giblish
43
43
  # pdf_font_dirs:: one or more Pathnames to each font dir that shall be
44
44
  # checked for fonts
45
45
  def initialize(pdf_style_path, *pdf_font_dirs)
46
- @pdf_style_path = pdf_style_path
46
+ @pdf_theme_path = pdf_style_path
47
47
  # one can specify multiple font dirs as:
48
48
  # -a pdf-fontsdir="path/to/fonts;path/to/more-fonts"
49
49
  # Always use the GEM_FONTS_DIR token to load the adoc-pdf gem's font dirs as well
@@ -52,8 +52,8 @@ module Giblish
52
52
 
53
53
  def document_attributes(src_node, dst_node, dst_top)
54
54
  result = {
55
- "pdf-style" => @pdf_style_path.basename.to_s,
56
- "pdf-stylesdir" => @pdf_style_path.dirname.to_s,
55
+ "pdf-theme" => @pdf_theme_path.basename.to_s,
56
+ "pdf-themesdir" => @pdf_theme_path.dirname.to_s,
57
57
  "icons" => "font"
58
58
  }
59
59
  result["pdf-fontsdir"] = @pdf_fontsdir unless @pdf_fontsdir.nil?
@@ -115,10 +115,10 @@ module Giblish
115
115
  # out-of-the-box for pdf).
116
116
  rp = conv_info.dst_rel_path
117
117
  dot_entry += case rp.extname
118
- when ".html"
119
- ", URL=\"#{rp}\" ]"
120
- else
121
- " ]"
118
+ when ".html"
119
+ ", URL=\"#{rp}\" ]"
120
+ else
121
+ " ]"
122
122
  end
123
123
  doc_dict[doc_id] = dot_entry
124
124
  end
@@ -181,7 +181,7 @@ module Giblish
181
181
  # we did not get a heading, this is ok as well but we can not
182
182
  # index it
183
183
  Giblog.logger.debug do
184
- "Did not index the anchor: #{match_str} at "\
184
+ "Did not index the anchor: #{match_str} at " \
185
185
  "line #{line_no}, probably not associated with a heading."
186
186
  end
187
187
  end
@@ -7,12 +7,12 @@ module Giblish
7
7
 
8
8
  def initialize(uri: nil, query_params: nil)
9
9
  @parameters = case [uri, query_params]
10
- in [String, nil]
11
- uri_2_params(uri)
12
- in [nil, _]
13
- validate_parameters(query_params)
14
- else
15
- raise ArgumentError, "You must supply one of 'uri: [String]' or 'query_params: [Hash]' got: #{query_params}"
10
+ in [String, nil]
11
+ uri_2_params(uri)
12
+ in [nil, _]
13
+ validate_parameters(query_params)
14
+ else
15
+ raise ArgumentError, "You must supply one of 'uri: [String]' or 'query_params: [Hash]' got: #{query_params}"
16
16
  end
17
17
  end
18
18
 
@@ -1,3 +1,3 @@
1
1
  module Giblish
2
- VERSION = "1.0.0.rc2".freeze
2
+ VERSION = "2.0.0".freeze
3
3
  end
@@ -17,7 +17,7 @@ accesslog_path = Pathname.new(__dir__).join("log/access.log")
17
17
  accesslog_path.dirname.mkpath
18
18
  access_logger = ::Logger.new(accesslog_path.to_s)
19
19
 
20
- # instantiate the one-and-only web-hook-manager
20
+ # the target directory on the server's file system
21
21
  DSTDIR = "/var/www/rillbert_se/html/public/giblish_examples/giblish"
22
22
  clone_dir = Dir.mktmpdir
23
23
 
@@ -42,32 +42,3 @@ end
42
42
  get "/" do
43
43
  ""
44
44
  end
45
-
46
- # class GenerateDocsFromGitHubHook < Sinatra::Base
47
- # ::Logger.class_eval { alias_method :write, :<< }
48
-
49
- # accesslog_path = Pathname.new(__dir__).join("../log/access.log")
50
- # accesslog_path.dirname.mkpath
51
- # access_logger = ::Logger.new(accesslog_path.to_s)
52
-
53
- # errorlog_path = Pathname.new(__dir__).join("log/error.log")
54
- # errorlog_path.dirname.mkpath
55
- # error_logger = ::File.new(errorlog_path.to_s, "a+")
56
- # error_logger.sync = true
57
-
58
- # configure do
59
- # use ::Rack::CommonLogger, access_logger
60
- # end
61
-
62
- # before {
63
- # env["rack.errors"] = error_logger
64
- # }
65
-
66
- # # instantiate the one-and-only web-hook-manager
67
- # wm = WebhookManager.new(/svg/, "https://github.com/rillbert/giblish.git", Dir.mktmpdir, "giblish", "docs", dstdir, error_logger)
68
-
69
- # post "/payload" do
70
- # gh_data = JSON.parse(request.body.read, symbolized_names: true)
71
- # wm.run(gh_data)
72
- # end
73
- # end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: giblish
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anders Rillbert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-30 00:00:00.000000000 Z
11
+ date: 2022-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '5.16'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: '5.16'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: standard
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.1'
33
+ version: '1.16'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.1'
40
+ version: '1.16'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.20.3
75
+ version: '1.2'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.20.3
82
+ version: '1.2'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: asciidoctor-mathematical
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '1.1'
153
+ - !ruby/object:Gem::Dependency
154
+ name: matrix
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '0.4'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '0.4'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: warning
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -204,48 +218,42 @@ dependencies:
204
218
  requirements:
205
219
  - - "~>"
206
220
  - !ruby/object:Gem::Version
207
- version: '1.6'
208
- - - ">="
209
- - !ruby/object:Gem::Version
210
- version: 1.6.2
221
+ version: '2.3'
211
222
  type: :runtime
212
223
  prerelease: false
213
224
  version_requirements: !ruby/object:Gem::Requirement
214
225
  requirements:
215
226
  - - "~>"
216
227
  - !ruby/object:Gem::Version
217
- version: '1.6'
218
- - - ">="
219
- - !ruby/object:Gem::Version
220
- version: 1.6.2
228
+ version: '2.3'
221
229
  - !ruby/object:Gem::Dependency
222
230
  name: git
223
231
  requirement: !ruby/object:Gem::Requirement
224
232
  requirements:
225
233
  - - "~>"
226
234
  - !ruby/object:Gem::Version
227
- version: '1.9'
235
+ version: '1.12'
228
236
  type: :runtime
229
237
  prerelease: false
230
238
  version_requirements: !ruby/object:Gem::Requirement
231
239
  requirements:
232
240
  - - "~>"
233
241
  - !ruby/object:Gem::Version
234
- version: '1.9'
242
+ version: '1.12'
235
243
  - !ruby/object:Gem::Dependency
236
244
  name: rouge
237
245
  requirement: !ruby/object:Gem::Requirement
238
246
  requirements:
239
247
  - - "~>"
240
248
  - !ruby/object:Gem::Version
241
- version: '3.0'
249
+ version: '3.30'
242
250
  type: :runtime
243
251
  prerelease: false
244
252
  version_requirements: !ruby/object:Gem::Requirement
245
253
  requirements:
246
254
  - - "~>"
247
255
  - !ruby/object:Gem::Version
248
- version: '3.0'
256
+ version: '3.30'
249
257
  - !ruby/object:Gem::Dependency
250
258
  name: prawn-svg
251
259
  requirement: !ruby/object:Gem::Requirement
@@ -281,17 +289,18 @@ files:
281
289
  - docs/concepts/text_search_im/cgi-search_request.svg
282
290
  - docs/concepts/text_search_im/search_request.puml
283
291
  - docs/concepts/text_search_im/search_request.svg
284
- - docs/howtos/trigger_generation.adoc
285
- - docs/howtos/trigger_generation_im/Render Documents.png
286
- - docs/howtos/trigger_generation_im/View Documents.png
287
- - docs/howtos/trigger_generation_im/deploy_with_hooks.graphml
288
- - docs/howtos/trigger_generation_im/deploy_with_hooks.svg
289
- - docs/howtos/trigger_generation_im/deploy_with_jenkins.graphml
290
- - docs/howtos/trigger_generation_im/deploy_with_jenkins.svg
291
- - docs/howtos/trigger_generation_im/docgen_github.puml
292
- - docs/howtos/trigger_generation_im/giblish_deployment.graphml
293
- - docs/howtos/trigger_generation_im/post-receive-example.sh
292
+ - docs/howtos/setup_static_site.adoc
293
+ - docs/howtos/setup_static_site_assets/Render Documents.png
294
+ - docs/howtos/setup_static_site_assets/View Documents.png
295
+ - docs/howtos/setup_static_site_assets/deploy_with_hooks.graphml
296
+ - docs/howtos/setup_static_site_assets/deploy_with_hooks.svg
297
+ - docs/howtos/setup_static_site_assets/deploy_with_jenkins.graphml
298
+ - docs/howtos/setup_static_site_assets/deploy_with_jenkins.svg
299
+ - docs/howtos/setup_static_site_assets/docgen_github.puml
300
+ - docs/howtos/setup_static_site_assets/giblish_deployment.graphml
301
+ - docs/howtos/setup_static_site_assets/post-receive-example.sh
294
302
  - docs/reference/box_flow_spec.adoc
303
+ - docs/reference/develop_and_build.adoc
295
304
  - docs/reference/search_spec.adoc
296
305
  - exe/giblish
297
306
  - giblish.gemspec
@@ -370,11 +379,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
370
379
  version: '0'
371
380
  required_rubygems_version: !ruby/object:Gem::Requirement
372
381
  requirements:
373
- - - ">"
382
+ - - ">="
374
383
  - !ruby/object:Gem::Version
375
- version: 1.3.1
384
+ version: '0'
376
385
  requirements: []
377
- rubygems_version: 3.2.32
386
+ rubygems_version: 3.3.7
378
387
  signing_key:
379
388
  specification_version: 4
380
389
  summary: A tool for publishing asciidoc docs stored in git repos