Skip to content

Commit 2b436ad

Browse files
committed
split header
1 parent cc66e47 commit 2b436ad

File tree

6 files changed

+41
-14
lines changed

6 files changed

+41
-14
lines changed

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
source 'https://rubygems.org'
22

3-
gem 'asciidoctor', '2.0.10'
3+
gem 'asciidoctor', '2.0.11'
4+
gem 'asciidoctor-multipage', '0.0.12'
45
#gem 'jekyll', '3.8.6'
56
gem 'github-pages'

Gemfile.lock

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ GEM
88
tzinfo (~> 1.1)
99
addressable (2.6.0)
1010
public_suffix (>= 2.0.2, < 4.0)
11-
asciidoctor (2.0.10)
11+
asciidoctor (2.0.11)
12+
asciidoctor-multipage (0.0.12)
13+
asciidoctor (>= 2.0.11, < 2.1)
1214
coffee-script (2.4.1)
1315
coffee-script-source
1416
execjs
@@ -243,8 +245,9 @@ PLATFORMS
243245
ruby
244246

245247
DEPENDENCIES
246-
asciidoctor (= 2.0.10)
248+
asciidoctor (= 2.0.11)
249+
asciidoctor-multipage (= 0.0.12)
247250
github-pages
248251

249252
BUNDLED WITH
250-
2.0.2
253+
2.2.5

README.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ https://zenodo.org/badge/latestdoi/64534859[image:https://zenodo.org/badge/64534
1818

1919
TL;DR: xref:qemu-buildroot-setup-getting-started[xrefstyle=full]
2020

21-
The source code for this page is located at: https://github.com/cirosantilli/linux-kernel-module-cheat[]. Due to https://github.com/isaacs/github/issues/1610[a GitHub limitation], this README is too long and not fully rendered on github.com, so either use: https://cirosantilli.com/linux-kernel-module-cheat or <<build-the-documentation,build the docs yourself>>.
21+
The source code for this page is located at: https://github.com/cirosantilli/linux-kernel-module-cheat[]. Due to https://github.com/isaacs/github/issues/1610[a GitHub limitation], this README is too long and not fully rendered on github.com, so either use:
22+
23+
* https://cirosantilli.com/linux-kernel-module-cheat
24+
* https://cirosantilli.com/linux-kernel-module-cheat/index-split[]: split header version
25+
* <<build-the-documentation,build the docs yourself>>
2226

2327
image::https://raw.githubusercontent.com/cirosantilli/china-dictatorship-media/master/Xinjiang_prisoners_sitting_identified.jpeg[width=800]
2428

build-doc

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,36 @@ from the README to example sources to GitHub rather than locally.
3232
link_target_script = 'link-target-github.rb'
3333
else:
3434
link_target_script = 'link-target-up.rb'
35+
common_cmd = [
36+
'bundle', LF,
37+
'exec', LF,
38+
'asciidoctor', LF,
39+
'--attribute', 'docinfo=shared', LF,
40+
'--failure-level', 'info', LF,
41+
'--require', os.path.join(asciidoctor_dir, link_target_script), LF,
42+
'--trace', LF,
43+
'--verbose', LF,
44+
]
3545
exit_status = self.sh.run_cmd(
46+
common_cmd +
3647
[
37-
'asciidoctor', LF,
38-
'--attribute', 'docinfo=shared', LF,
39-
'--failure-level', 'info', LF,
40-
'--require', os.path.join(asciidoctor_dir, link_target_script), LF,
4148
'--out-file', self.env['readme_out'], LF,
42-
'--trace', LF,
43-
'--verbose', LF,
44-
] +
45-
[
4649
self.env['readme'], LF,
4750
],
4851
out_file=self.env['build_doc_log'],
4952
)
53+
if exit_status == 0:
54+
exit_status = self.sh.run_cmd(
55+
common_cmd +
56+
[
57+
'-D', self.env['out_doc_dir'], LF,
58+
'-a', 'multipage-level=6', LF,
59+
'-b', 'multipage_html5', LF,
60+
'-r', 'asciidoctor-multipage', LF,
61+
self.env['readme'], LF,
62+
],
63+
out_file=self.env['build_doc_multipage_log'],
64+
)
5065

5166
# Check that all local files linked from README exist.
5267
external_link_re = re.compile('^https?://')

common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@
5353
else:
5454
consts['out_dir'] = os.path.join(consts['root_dir'], 'out')
5555
consts['readme'] = os.path.join(consts['root_dir'], 'README.adoc')
56+
consts['out_doc_dir'] = os.path.join(consts['out_dir'], 'doc')
5657
consts['readme_out'] = os.path.join(consts['out_dir'], 'README.html')
5758
consts['build_doc_log'] = os.path.join(consts['out_dir'], 'build-doc.log')
59+
consts['build_doc_multipage_log'] = os.path.join(consts['out_dir'], 'build-doc-multipage.log')
5860
consts['gem5_out_dir'] = os.path.join(consts['out_dir'], 'gem5')
5961
consts['kernel_modules_build_base_dir'] = os.path.join(consts['out_dir'], 'kernel_modules')
6062
consts['buildroot_out_dir'] = os.path.join(consts['out_dir'], 'buildroot')

publish-gh-pages

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ git checkout master -- \
1010
_config.yml \
1111
;
1212
cp out/README.html index.html
13-
git add index.html
13+
cp out/doc/* .
14+
mv README.html index.html
15+
git add .
1416
git commit --message "$(git log -n1 --pretty='%H' master)"
1517
git push
1618
git checkout -

0 commit comments

Comments
 (0)