Skip to content

Commit c3caef5

Browse files
authored
Merge pull request #4053 from grandixximo/docs/asciidoctor-migration
docs: migrate documentation toolchain from asciidoc-py + dblatex to asciidoctor
2 parents f01903d + 239dd3f commit c3caef5

145 files changed

Lines changed: 2821 additions & 3722 deletions

File tree

Some content is hidden

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

.github/scripts/build-doc.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ set -x
55

66
cd src
77
./autogen.sh
8-
./configure --disable-check-runtime-deps --enable-build-documentation=html
8+
./configure --disable-check-runtime-deps \
9+
--enable-build-documentation=html \
10+
--enable-build-documentation-translation
911
make -O -j$((1+$(nproc))) manpages
1012
make -O -j$((1+$(nproc))) translateddocs
1113
make -O -j$((1+$(nproc))) docs

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@ position.txt
5050
# Ignore temp files
5151
*.swp
5252
*~
53+
# Ignore checkref leftover output (docs/src/checkref)
54+
.checklink.*.tmp
5355
# Ignore po4a temp files
5456
*.failed.po
5557
*-new_??.po
5658
# Ignore stamp files
5759
*.*-stamp
5860
# Ignore VSCode settings
5961
.vscode/settings.json
62+
# autoreconf cache from debian/configure
63+
/autom4te.cache/

debian/configure

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,7 @@ elif [ -f /etc/lsb-release ]; then
110110
fi
111111

112112
if [ -n "$ENABLE_BUILD_DOCUMENTATION" ]; then
113-
DOC_DEPENDS="dblatex (>= 0.2.12),\n dvipng,\n fonts-dejavu,\n graphviz,\n groff,\n inkscape,\n librsvg2-bin,\n python3-lxml,\n source-highlight,\n texlive-extra-utils,\n texlive-font-utils,\n texlive-fonts-recommended,\n texlive-lang-cyrillic,\n texlive-lang-european,\n texlive-lang-french,\n texlive-lang-german,\n texlive-lang-polish,\n texlive-lang-spanish,\n texlive-latex-recommended,\n w3c-linkchecker,\n xsltproc"
114-
115-
116-
case $DISTRIB_NAME in
117-
Debian-9)
118-
;; # No xetex in Debian 9 Stretch
119-
*)
120-
# Not quite sure which packages is needed for xetex, but
121-
# texlive-xetex seem like a safe choice. Need xetex to be
122-
# able to build Chinese PDF.
123-
DOC_DEPENDS="$DOC_DEPENDS,\n texlive-xetex"
124-
;;
125-
esac
113+
DOC_DEPENDS="asciidoctor,\n asciidoctor-pdf | ruby-asciidoctor-pdf,\n fonts-dejavu,\n fonts-noto-cjk,\n ghostscript,\n graphviz,\n librsvg2-bin,\n python3-fonttools,\n ruby-rouge,\n w3c-linkchecker"
126114
else
127115
DOC_DEPENDS=''
128116
fi

debian/control.top.in

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ Build-Depends:
1212
@KERNEL_HEADERS@,
1313
@MODUTILS_DEPENDS@,
1414
@EXTRA_BUILD@,
15-
docbook-xsl <!nodoc>,
16-
asciidoc,
17-
ghostscript <!nodoc>,
1815
groff-base <!nodoc>,
1916
imagemagick <!nodoc>,
20-
asciidoc-dblatex <!nodoc>,
17+
asciidoctor <!nodoc>,
18+
libunicode-linebreak-perl <!nodoc>,
2119
autoconf,
2220
automake,
2321
bwidget (>= 1.7),

debian/rules.in

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export TIME:=$(shell LANG=C date --date='@$(TIMESTAMP)' '+%T')
3333
kernel_version = @KERNEL_VERSION@
3434
configure_realtime_arg = @CONFIGURE_REALTIME_ARG@
3535
ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
36-
enable_build_documentation = @ENABLE_BUILD_DOCUMENTATION@
36+
enable_build_documentation = @ENABLE_BUILD_DOCUMENTATION@ \
37+
--enable-build-documentation-translation
3738
endif
3839
SRCDIR = $(CURDIR)/src
3940
DESTDIR=$(CURDIR)/debian/tmp
@@ -123,9 +124,14 @@ ifeq (,$(filter nodocs,$(DEB_BUILD_OPTIONS)))
123124
dh_installdocs --doc-main-package=@MAIN_PACKAGE_NAME@ --package=linuxcnc-doc-en
124125
mv debian/linuxcnc-doc-en/usr/share/doc/@MAIN_PACKAGE_NAME@ debian/linuxcnc-doc-en/usr/share/doc/linuxcnc
125126

126-
# Remove files for translations created where we do not want Debian packages.
127-
for l in ar es fr ru uk zh_CN; do \
128-
$(RM) -f debian/tmp/usr/share/doc/linuxcnc/LinuxCNC_*_$$l.pdf; \
127+
# Remove PDF files for translated locales that have no Debian package.
128+
# The authoritative locale list lives in docs/po4a.cfg's [po4a_langs]
129+
# line; only en and de get their own -doc package, every other locale
130+
# in that list has its PDFs dropped from the tmp staging area.
131+
for l in $$(sed -e's/#.*//' docs/po4a.cfg | grep '^\[po4a_langs\]' | cut -d" " -f2-); do \
132+
if [ "$$l" != "de" ]; then \
133+
$(RM) -f debian/tmp/usr/share/doc/linuxcnc/LinuxCNC_*_$$l.pdf; \
134+
fi; \
129135
done
130136
$(RM) -f debian/tmp/usr/share/doc/linuxcnc/*_es.adoc
131137
else

docs/help/tklinuxcnc.adoc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
= TkLinuxCNC
55

6-
// Custom lang highlight
7-
// must come after the doc title, to work around a bug in asciidoc 8.6.6
8-
:ini: {basebackend@docbook:'':ini}
9-
:hal: {basebackend@docbook:'':hal}
10-
:ngc: {basebackend@docbook:'':ngc}
116

127
== Menus
138

@@ -157,7 +152,7 @@ To change these settings, use the '@' key for Commanded/Actual, and
157152
the '#' key for Absolute/Relative. The default values can be set in
158153
the INI file, e.g.,
159154

160-
[source,{ini}]
155+
[source,ini]
161156
----
162157
[DISPLAY]
163158
POSITION_OFFSET = RELATIVE
@@ -166,7 +161,7 @@ POSITION_FEEDBACK = ACTUAL
166161

167162
or
168163

169-
[source,{ini}]
164+
[source,ini]
170165
----
171166
[DISPLAY]
172167
POSITION_OFFSET = ABSOLUTE

docs/html/gcode.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
tr.odd td { background: #d9d9d9; }
4242
tr.head td, tr.head th { background: black; color: white; }
4343
--></style>
44+
<link rel="stylesheet" href="lcnc-overrides.css"/>
4445
</head>
4546

4647
<body>

docs/html/index.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ p {
1313
margin-top: 0em;
1414
margin-bottom: 0em;
1515
}
16+
summary {
17+
margin-top: 0.65em;
18+
margin-bottom: 0.15em;
19+
font-family: sans-serif;
20+
cursor: pointer;
21+
}

docs/html/linuxcnc.css

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
:target { background: #DEF !important; }
1+
:target { background: #DEF !important; }
2+
body { margin: 1em 5% 1em 5%; }
23
tt {font-family: "Courier New", Courier, monospace; font-size: 0.95em;}
34
pre { font-family: monospace !important; }
5+
h1, h2, h3, h4, h5, h6 { font-family: Arial, Helvetica, sans-serif; }
46
h1, h2 { background: #c0c0f0; padding-left: 0.5em;}
7+
h3, h4, h5, h6 { background: #DEF; padding-left: 0.5em; }
58
h2 { padding-top: 0.35em; padding-bottom:0.15em;}
69
h1, h2, h3, h4, h5 { border-bottom: 2px solid #8080c0; color: black; }
10+
11+
@media (max-width: 768px) {
12+
body { margin: 0.5em 2% 0.5em 2%; }
13+
}
714
div.nav { float: right; background: #ffffff; }
8-
dt { font-weight: bold; }
15+
dt { font-weight: bold; color: #527bbd; margin-top: 0.5em; }
916
pre { margin-left: 4ex; auto; color: black; padding: 1ex; }
1017
div.float { text-align: center; margin: 2ex; padding: 1ex; }
1118
div.float span.caption { display: block; margin: 1em; }
@@ -28,8 +35,16 @@ table.tableblock { border-collapse: collapse; margin-left: auto; margin-right: a
2835
.clist { -moz-column-width: 40ex; -moz-column-gap: 4ex }
2936
.nclist { -moz-column-width: 20ex; -moz-column-gap: 4ex }
3037
.nclist li { list-style-type: none; text-indent: -.5ex; }
38+
#toctitle {
39+
font-family: Arial, Helvetica, sans-serif;
40+
color: #527bbd;
41+
font-size: 1.1em;
42+
font-weight: bold;
43+
margin-top: 1em;
44+
margin-bottom: 0.3em;
45+
}
3146
.toc li { list-style-type: none; }
32-
.toc li a { display: block; border: 1px solid transparent; text-indent: -1ex; }
47+
.toc li a { border: 1px solid transparent; text-indent: -1ex; }
3348

3449
/* AsciiDoc stuff */
3550
div.note {

docs/man/images/Images_info.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ ASCII art diagrams can be drawn e.g., with link:https://asciiflow.com/[asciiflow
5757
│ │
5858
──┤is-on off├──
5959
└───────────┘
60-
----
60+
----

0 commit comments

Comments
 (0)