Skip to content

Commit 1ac4fcb

Browse files
Render Kroxylicious AsciiDoc on the website with Jekyll (#47)
* render release docs with jekyll * update sitewide code highlighting styles to match original docs styles * change asciidoc code highlighter to rouge * remove pygments from gemfile * fix asciitosvg rendering (adds go to workflow) * re-add missing dependencies to Gemfile.lock * render multiple versions of Kroxylicious docs with Jekyll (also, exclude docs files from being served raw) * add section anchors * add readme
1 parent bb0cf9a commit 1ac4fcb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+7268
-171
lines changed

.github/workflows/jekyll-gh-pages.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ jobs:
3939
run: gem install rake
4040
- name: Update Bundler and Setup Jekyll
4141
run: bundle install && bundle update --bundler
42+
- name: Setup Go
43+
uses: actions/setup-go@v5
44+
- name: Setup ASCIIToSVG
45+
run: go install github.com/asciitosvg/asciitosvg/cmd/a2s@latest
4246
- name: Download Bootstrap 5 SCSS Sources
4347
run: ./bootstrap_setup.sh
4448
- name: Build with Jekyll

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ source "https://rubygems.org"
1010
gem "jekyll", "~> 4.3.2"
1111
# If you have any plugins, put them here!
1212
group :jekyll_plugins do
13+
gem "asciidoctor-diagram"
14+
gem "jekyll-asciidoc"
1315
gem "jekyll-feed", "~> 0.12"
1416
gem "jekyll-sass-converter"
1517
gem "jekyll-seo-tag"

Gemfile.lock

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ GEM
33
specs:
44
addressable (2.8.6)
55
public_suffix (>= 2.0.2, < 6.0)
6+
asciidoctor (2.0.22)
7+
asciidoctor-diagram (2.3.0)
8+
asciidoctor (>= 1.5.7, < 3.x)
9+
asciidoctor-diagram-ditaamini (~> 1.0)
10+
asciidoctor-diagram-plantuml (~> 1.2021)
11+
rexml
12+
asciidoctor-diagram-ditaamini (1.0.3)
13+
asciidoctor-diagram-plantuml (1.2024.3)
614
colorator (1.1.0)
715
concurrent-ruby (1.2.3)
816
em-websocket (0.5.3)
@@ -34,6 +42,9 @@ GEM
3442
safe_yaml (~> 1.0)
3543
terminal-table (>= 1.8, < 4.0)
3644
webrick (~> 1.7)
45+
jekyll-asciidoc (3.0.1)
46+
asciidoctor (>= 1.5.0, < 3.0.0)
47+
jekyll (>= 3.0.0)
3748
jekyll-feed (0.17.0)
3849
jekyll (>= 3.7, < 5.0)
3950
jekyll-sass-converter (3.0.0)
@@ -54,8 +65,8 @@ GEM
5465
rb-fsevent (~> 0.10, >= 0.10.3)
5566
rb-inotify (~> 0.9, >= 0.9.10)
5667
mercenary (0.4.0)
57-
mini_portile2 (2.8.5)
58-
nokogiri (1.16.3)
68+
mini_portile2 (2.8.6)
69+
nokogiri (1.16.4)
5970
mini_portile2 (~> 2.8.2)
6071
racc (~> 1.4)
6172
pathutil (0.16.2)
@@ -70,16 +81,16 @@ GEM
7081
rexml (3.2.6)
7182
rouge (4.2.1)
7283
safe_yaml (1.0.5)
73-
sass-embedded (1.74.1)
84+
sass-embedded (1.75.0)
7485
google-protobuf (>= 3.25, < 5.0)
7586
rake (>= 13.0.0)
76-
sass-embedded (1.74.1-arm64-darwin)
87+
sass-embedded (1.75.0-arm64-darwin)
7788
google-protobuf (>= 3.25, < 5.0)
78-
sass-embedded (1.74.1-x64-mingw32)
89+
sass-embedded (1.75.0-x64-mingw32)
7990
google-protobuf (>= 3.25, < 5.0)
80-
sass-embedded (1.74.1-x86_64-darwin)
91+
sass-embedded (1.75.0-x86_64-darwin)
8192
google-protobuf (>= 3.25, < 5.0)
82-
sass-embedded (1.74.1-x86_64-linux-gnu)
93+
sass-embedded (1.75.0-x86_64-linux-gnu)
8394
google-protobuf (>= 3.25, < 5.0)
8495
terminal-table (3.0.2)
8596
unicode-display_width (>= 1.1.1, < 3)
@@ -100,8 +111,10 @@ PLATFORMS
100111
x86_64-linux
101112

102113
DEPENDENCIES
114+
asciidoctor-diagram
103115
http_parser.rb (~> 0.6.0)
104116
jekyll (~> 4.3.2)
117+
jekyll-asciidoc
105118
jekyll-feed (~> 0.12)
106119
jekyll-sass-converter
107120
jekyll-seo-tag
@@ -111,4 +124,4 @@ DEPENDENCIES
111124
wdm (~> 0.1.1)
112125

113126
BUNDLED WITH
114-
2.4.21
127+
2.4.22

_config.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ github_username: kroxylicious
2828

2929
# Build settings
3030
plugins:
31+
- asciidoctor-diagram
32+
- jekyll-asciidoc
3133
- jekyll-feed
3234
- jekyll-sass-converter
3335
- jekyll-seo-tag
@@ -43,6 +45,7 @@ plugins:
4345
#
4446
exclude:
4547
- .idea
48+
- docs/README.md
4649
# - .sass-cache/
4750
# - .jekyll-cache/
4851
# - gemfiles/
@@ -58,4 +61,20 @@ collections:
5861
use_cases:
5962
output: false
6063
quickstarts:
61-
output: false
64+
output: false
65+
66+
keep_files:
67+
- images
68+
69+
asciidoc:
70+
require_front_matter_header: true
71+
72+
asciidoctor:
73+
base_dir: :docdir
74+
safe: unsafe
75+
attributes:
76+
imagesdir: /images
77+
page-layout: docs
78+
toc: preamble
79+
source-highlighter: rouge
80+
sectanchors: ''

_data/kroxylicious.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
versions:
2+
- title: 'Development'
3+
url: '/kroxylicious'
4+
- title: 'v0.5.1'
5+
url: '/docs/v0.5.1/'
6+
- title: 'v0.5.0'
7+
url: '/docs/v0.5.0/'
8+
- title: 'v0.4.1'
9+
url: '/docs/v0.4.1/'
10+
- title: 'v0.4.0'
11+
url: '/docs/v0.4.0/'
12+
- title: 'v0.3.0'
13+
url: '/docs/v0.3.0/'

_includes/nav.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,17 @@
4343
<li class="nav-item py-lg-1 col-lg-auto">
4444
<div class="vr d-none d-lg-flex h-100 text-white"></div>
4545
</li>
46-
<li class="nav-item col-6 col-lg-auto">
47-
<a class="nav-link krx-nav-link py-2 px-0 px-lg-4" href="{{ '/kroxylicious' | relative_url }}">
48-
Docs
49-
</a>
46+
<li class="nav-item dropdown col-6 col-lg-auto">
47+
<a class="nav-link dropdown-toggle krx-nav-link py-2 px-0 px-lg-4" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Docs</a>
48+
<ul class="dropdown-menu">
49+
{% for version in site.data.kroxylicious.versions %}
50+
<li>
51+
<a class="dropdown-item {% if page.url == version.url %}active{% endif %} krx-nav-link py-2 px-0 px-lg-4" href="{{ version.url }}">
52+
{{ version.title }}
53+
</a>
54+
</li>
55+
{% endfor %}
56+
</ul>
5057
</li>
5158
<li class="nav-item py-lg-1 col-lg-auto">
5259
<div class="vr d-none d-lg-flex h-100 text-white"></div>

_layouts/docs.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
layout: default
3+
---
4+
<!-- _layouts/docs.html -->
5+
<div class="row justify-content-center gx-0">
6+
<div class="col-lg-3">
7+
<div class="card shadow my-lg-5 ms-lg-5 me-1">
8+
<div class="card-body mx-2">
9+
<h3 class="card-title">
10+
{{ page.title }}
11+
</h3>
12+
<div class="card-text g-0">
13+
<p><em>This documentation is for a stable release version of Kroxylicious. For the documentation from the latest development version of Kroxylicious, <a href="{{ '/kroxylicious' | relative_url }}">click here</a>.</small></em></p>
14+
{{ page.document | tocify_asciidoc }}
15+
</div>
16+
</div>
17+
</div>
18+
</div>
19+
<div class="col-lg-9">
20+
<div class="card shadow my-lg-5 me-lg-5 ms-1">
21+
<div class="card-body mx-2">
22+
<div class="row g-0">
23+
<div class="col-auto">
24+
<div class="card-text m-2">
25+
{% if page.version_warning %}
26+
{% include bs-alert.html type="warning" content=page.version_warning %}
27+
{% endif %}
28+
{{ content }}
29+
</div>
30+
</div>
31+
</div>
32+
</div>
33+
</div>
34+
</div>
35+
</div>

_sass/kroxylicious.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,14 @@ body {
123123
}
124124
}
125125

126-
// Rouge highlighter non-theme formatting
127-
// (AKA any formatting for Rouge that isn't part of the generated theme)
128-
129-
.highlighter-rouge {
130-
background-color: #f8f8f8!important;
126+
// Rouge highlighter additional formatting
127+
// Main rouge formatting is in css/code.css
128+
129+
// ensure padding for code blocks
130+
.highlight {
131+
text-wrap: wrap;
132+
padding: 1.5em;
133+
border-radius: 4px;
131134
}
132135

133136
div.highlighter-rouge {

0 commit comments

Comments
 (0)