giblish 2.0.0.pre.alpha1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/unit_tests.yml +1 -1
- data/Changelog.adoc +11 -1
- data/README.adoc +12 -10
- data/docs/howtos/{trigger_generation.adoc → setup_static_site.adoc} +23 -27
- data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/Render Documents.png +0 -0
- data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/View Documents.png +0 -0
- data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/deploy_with_hooks.graphml +0 -0
- data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/deploy_with_hooks.svg +0 -0
- data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/deploy_with_jenkins.graphml +0 -0
- data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/deploy_with_jenkins.svg +0 -0
- data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/docgen_github.puml +0 -0
- data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/giblish_deployment.graphml +0 -0
- data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/post-receive-example.sh +0 -0
- data/docs/reference/develop_and_build.adoc +27 -0
- data/lib/giblish/version.rb +1 -1
- data/web_apps/gh_webhook_trigger/gh_webhook_trigger.rb +1 -30
- metadata +15 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 536fb7fa58df4bca2bfa5b73f68ebec0dd32bff797c3401cd20e6ccb20450db7
|
4
|
+
data.tar.gz: 3f6f51691b25f64cf80da13d9467f5ea8f1ee296390efd7f77cd0ce49d7195c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 855851b721c005724dd76daeafeb43945bda104f0edc3628530efa4b1a87bece735547be67f9ac584fbae8b1b640f36b19cc98112864e22ff1edd775be23a9a6
|
7
|
+
data.tar.gz: ef6c403e03b3abf628ddd896e935f3dbaf096a4368bb1702d665f269de1eddbccd2a2efeb2647e00dfa18888a7b82d47be711b39e4cddedcd7006ede4d96d471
|
data/Changelog.adoc
CHANGED
@@ -1,11 +1,21 @@
|
|
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
|
-
** write
|
8
|
+
** write instructions for github webhook triggered generation
|
7
9
|
* Update the default css for giblish html generation.
|
8
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
|
18
|
+
|
9
19
|
== v1.0.0
|
10
20
|
|
11
21
|
This release includes a complete refactoring of almost the entire code base.
|
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
|
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
|
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
|
|
@@ -45,7 +45,9 @@ The features of giblish include:
|
|
45
45
|
|
46
46
|
== Dependencies and credits
|
47
47
|
|
48
|
-
Giblish uses the awesome
|
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
|
49
51
|
|
50
52
|
== Installation
|
51
53
|
|
@@ -107,7 +109,7 @@ Example document one::
|
|
107
109
|
= Document one
|
108
110
|
:toc:
|
109
111
|
:numbered:
|
110
|
-
:docid:
|
112
|
+
:docid: AB-001
|
111
113
|
|
112
114
|
== Purpose
|
113
115
|
|
@@ -120,16 +122,16 @@ Example document two::
|
|
120
122
|
= Document two
|
121
123
|
:toc:
|
122
124
|
:numbered:
|
123
|
-
:docid:
|
125
|
+
:docid: AB-002
|
124
126
|
|
125
127
|
== Purpose
|
126
128
|
|
127
|
-
To illustrate the use of doc id. You can refer to document one as <<:docid:
|
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).
|
128
130
|
|
129
131
|
You can use the same syntax as the normal asciidoc cross-ref but replace 'xref' with ':docid:' as shown below:
|
130
132
|
|
131
|
-
* <<:docid:
|
132
|
-
* <<:docid:
|
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.
|
133
135
|
----
|
134
136
|
|
135
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.
|
@@ -1,5 +1,6 @@
|
|
1
|
-
=
|
2
|
-
|
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
|
12
|
+
This text covers the following deployment scenarios:
|
12
13
|
|
13
|
-
. Using a git hook together with a
|
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
|
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
|
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
|
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,
|
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
|
-
|
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,
|
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
|
-
|
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
|
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
|
-
|
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_
|
98
|
+
. Install giblish on the _Server_. See e.g. <<:docid:G-001>>
|
98
99
|
|
99
|
-
git and
|
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
|
-
===
|
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
|
-
|
129
|
-
|
130
|
-
/
|
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
|
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
|
174
|
+
include::../../scripts/hooks/post-update.example[]
|
179
175
|
----
|
180
176
|
====
|
File without changes
|
File without changes
|
data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/deploy_with_hooks.graphml
RENAMED
File without changes
|
File without changes
|
data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/deploy_with_jenkins.graphml
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/docs/howtos/{trigger_generation_im → setup_static_site_assets}/giblish_deployment.graphml
RENAMED
File without changes
|
File without changes
|
@@ -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/lib/giblish/version.rb
CHANGED
@@ -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
|
-
#
|
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: 2.0.0
|
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-08-
|
11
|
+
date: 2022-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -289,17 +289,18 @@ files:
|
|
289
289
|
- docs/concepts/text_search_im/cgi-search_request.svg
|
290
290
|
- docs/concepts/text_search_im/search_request.puml
|
291
291
|
- docs/concepts/text_search_im/search_request.svg
|
292
|
-
- docs/howtos/
|
293
|
-
- docs/howtos/
|
294
|
-
- docs/howtos/
|
295
|
-
- docs/howtos/
|
296
|
-
- docs/howtos/
|
297
|
-
- docs/howtos/
|
298
|
-
- docs/howtos/
|
299
|
-
- docs/howtos/
|
300
|
-
- docs/howtos/
|
301
|
-
- docs/howtos/
|
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
|
302
302
|
- docs/reference/box_flow_spec.adoc
|
303
|
+
- docs/reference/develop_and_build.adoc
|
303
304
|
- docs/reference/search_spec.adoc
|
304
305
|
- exe/giblish
|
305
306
|
- giblish.gemspec
|
@@ -378,9 +379,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
378
379
|
version: '0'
|
379
380
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
380
381
|
requirements:
|
381
|
-
- - "
|
382
|
+
- - ">="
|
382
383
|
- !ruby/object:Gem::Version
|
383
|
-
version:
|
384
|
+
version: '0'
|
384
385
|
requirements: []
|
385
386
|
rubygems_version: 3.3.7
|
386
387
|
signing_key:
|