Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ the index.tmpl.
`po4a.cfg` is used to map source files to translated documentation when
generating translated files using the files in `docs/po/`.

Every translated HTML page is emitted regardless of completeness; the
topbar language-switcher post-process greys out per-page entries whose
`.po` coverage falls below `POKEEP` percent (default 80). Override at
build time: `make POKEEP=30 docs` to surface in-progress translations,
`make POKEEP=0 docs` to keep every entry clickable. See
`docs/src/code/contributing-to-linuxcnc.adoc` for details.

== Notes on LinuxCNC documentation

The main LinuxCNC Makefile can optionally build the documentation and
Expand Down
3 changes: 2 additions & 1 deletion docs/po4a.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
[type: AsciiDoc_def] src/Master_Getting_Started.adoc $lang:build/adoc/$lang/Master_Getting_Started.adoc
[type: AsciiDoc_def] src/Master_Integrator.adoc $lang:build/adoc/$lang/Master_Integrator.adoc
[type: xhtml_def] src/index.tmpl $lang:build/adoc/$lang/index.tmpl
[type: Text_def] src/topbar-labels $lang:build/adoc/$lang/topbar-labels
[type: AsciiDoc_def] src/help/rtfaults.adoc $lang:build/adoc/$lang/help/rtfaults.adoc
[type: AsciiDoc_def] src/help/tklinuxcnc.adoc $lang:build/adoc/$lang/help/tklinuxcnc.adoc
[type: AsciiDoc_def] src/code/adding-configs.adoc $lang:build/adoc/$lang/code/adding-configs.adoc
Expand Down Expand Up @@ -78,7 +79,7 @@
[type: AsciiDoc_def] src/examples/spindle.adoc $lang:build/adoc/$lang/examples/spindle.adoc
[type: AsciiDoc_def] src/gcode/coordinates.adoc $lang:build/adoc/$lang/gcode/coordinates.adoc
[type: AsciiDoc_def] src/gcode/g-code.adoc $lang:build/adoc/$lang/gcode/g-code.adoc
[type: xhtml_def] src/gcode.html $lang:build/html/$lang/gcode.html
[type: xhtml_def] src/gcode.html.in $lang:build/adoc/$lang/gcode-raw.html
[type: AsciiDoc_def] src/gcode/machining-center.adoc $lang:build/adoc/$lang/gcode/machining-center.adoc
Comment thread
grandixximo marked this conversation as resolved.
[type: AsciiDoc_def] src/gcode/m-code.adoc $lang:build/adoc/$lang/gcode/m-code.adoc
[type: AsciiDoc_def] src/gcode/o-code.adoc $lang:build/adoc/$lang/gcode/o-code.adoc
Expand Down
1 change: 1 addition & 0 deletions docs/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docinfo-header.html
143 changes: 129 additions & 14 deletions docs/src/Submakefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ ASCIIDOCTOR_DEFAULT_CSS := $(shell ruby -e 'require "asciidoctor"; print Asciido
LANGUAGES := $(strip $(shell sed -e's/#.*//' < $(DOC_DIR)/po4a.cfg | grep '^\[po4a_langs\]' | cut -d" " -f2-))
LANGUAGES_MATCH := $(shell echo $(LANGUAGES) | tr " " "|")

# Native switcher labels read from docs/src/lang-labels (tag<ws>name);
# a tag with no entry falls back to its code with a warning.
LANG_LABEL_FILE := $(DOC_SRCDIR)/lang-labels
define LANG_LABEL_template
LANG_LABEL_$(1) := $(or $(shell sed -ne 's/^$(1)[[:space:]][[:space:]]*//p' $(LANG_LABEL_FILE)),$(1)$(warning lang-labels: no entry for '$(1)', using tag))
endef
$(foreach L,en $(LANGUAGES),$(eval $(call LANG_LABEL_template,$(L))))

# Minimum per-master translation completeness (percent) below which the
# language-switcher post-process pass greys out a page's entry for that
# language. The translated HTML is still emitted (po4a runs with --keep 0)
# so deep links never 404; the post-process just demotes <a> to <span>.
# Default 80% matches po4a's own default and the MDN/Hugo/Sphinx
# convention. Translators previewing work-in-progress can lower it:
# `make POKEEP=30 docs`.
POKEEP ?= 80

GENERATED_MANPAGES += ../docs/man/man1/linuxcnc.1
GENERATED_MANPAGES += $(patsubst ../docs/src/man/%.adoc, ../docs/man/%, $(wildcard ../docs/src/man/*/*.adoc))

Expand Down Expand Up @@ -442,10 +459,51 @@ endif
# English gcode reference must land in the build tree even when only PDF docs
# are enabled (debian/configure passes --enable-build-documentation=pdf, so
# .copy-asciidoc-stamp -- which lives under htmldocs -- does not fire).
# Per-lang topbar fragments. Pre-substituted versions of docinfo-header.html
# with lcnc-cssrel and lcnc-lang-label resolved; consumed by the gcode.html
# and index.html rules below, which still need to substitute {lcnc-subpath}.
objects/topbar-en.html: $(DOC_SRCDIR)/docinfo-header.html
@mkdir -p $(@D)
@sed -e 's|{lcnc-cssrel}|../|g' -e 's|{lcnc-lang-label}|$(LANG_LABEL_en)|g' $< > $@

$(foreach L,$(LANGUAGES),objects/topbar-$(L).html): objects/topbar-%.html: $(DOC_SRCDIR)/docinfo-header.html
@mkdir -p $(@D)
@sed -e 's|{lcnc-cssrel}|../|g' -e 's|{lcnc-lang-label}|$(LANG_LABEL_$*)|g' $< > $@

# debian/linuxcnc-doc-en.docs installs docs/build/html/en/gcode.html, so the
# English gcode reference must land in the build tree even when only PDF docs
# are enabled (debian/configure passes --enable-build-documentation=pdf, so
# .copy-asciidoc-stamp -- which lives under htmldocs -- does not fire).
# Wraps the .in template with the English topbar fragment and rewrites the
# CSS path (the source sits at docs/build/html/en/, css at docs/build/html/).
docs: $(DOC_OUT_HTML)/en/gcode.html
$(DOC_OUT_HTML)/en/gcode.html: $(DOC_SRCDIR)/gcode.html
$(DOC_OUT_HTML)/en/gcode.html: $(DOC_SRCDIR)/gcode.html.in objects/topbar-en.html $(DOC_SRCDIR)/Submakefile
@mkdir -p $(@D)
cp -f $< $@
$(Q){ \
topbar=$$(mktemp) ; \
sed 's|{lcnc-subpath}|gcode.html|g' objects/topbar-en.html > $$topbar ; \
awk -v t="$$topbar" 'BEGIN{ while ((getline line < t) > 0) buf = buf line "\n" } /<body>/{ print; printf "%s", buf; next } { print }' $< \
| sed 's|href="lcnc-overrides.css"|href="../lcnc-overrides.css"|g' > $@ ; \
rm -f $$topbar ; \
}

# Per-language gcode.html: po4a translates docs/src/gcode.html.in into
# $(DOC_OUT_ADOC)/<lang>/gcode-raw.html. Wrap each raw output with the
# lang-specific topbar to produce the final $(DOC_OUT_HTML)/<lang>/gcode.html.
$(foreach L,$(LANGUAGES),$(DOC_OUT_HTML)/$(L)/gcode.html): $(DOC_OUT_HTML)/%/gcode.html: objects/topbar-%.html $(DOC_SRCDIR)/Submakefile | translateddocs
@mkdir -p $(dir $@)
$(Q){ \
topbar=$$(mktemp) ; \
sed 's|{lcnc-subpath}|gcode.html|g' objects/topbar-$*.html > $$topbar ; \
awk -v t="$$topbar" 'BEGIN{ while ((getline line < t) > 0) buf = buf line "\n" } /<body>/{ print; printf "%s", buf; next } { print }' $(DOC_OUT_ADOC)/$*/gcode-raw.html \
| sed 's|href="lcnc-overrides.css"|href="../lcnc-overrides.css"|g' > $@ ; \
rm -f $$topbar ; \
}

# Hook per-lang gcode.html into the docs target when translations are on.
ifeq ($(BUILD_DOCS_TRANSLATED),yes)
docs: $(foreach L,$(LANGUAGES),$(DOC_OUT_HTML)/$(L)/gcode.html)
endif

pdfdocs: svgs_made_from_dots $(PDF_TARGETS) $(DOC_OUT_HTML)/pdf/index.html

Expand Down Expand Up @@ -475,19 +533,57 @@ endif
# gen_complist aliases: a phony prereq is always "newer", so naming them
# re-touched .htmldoc-stamp every run, dragging checkref and the css copy
# with it. The stamps fire only when their real inputs change.
.htmldoc-stamp: .copy-asciidoc-stamp $(DOC_DIR)/.gen_complist-stamp $(HTML_TARGETS) .images-stamp .include-stamp $(DOC_OUT_HTML)/asciidoctor.css $(DOC_OUT_HTML)/rouge-github.css
.htmldoc-stamp: .copy-asciidoc-stamp $(DOC_DIR)/.gen_complist-stamp $(HTML_TARGETS) .images-stamp .include-stamp $(DOC_OUT_HTML)/asciidoctor.css $(DOC_OUT_HTML)/rouge-github.css .lang-switcher-stamp
touch $@

# Walk every generated HTML page and grey out language-switcher entries
# whose translated counterpart is below POKEEP coverage. Runs at the end
# of the build (depends on every HTML target so it sees the final tree).
# The script is idempotent so re-running over a processed tree is a
# content-stable no-op. Gated on BUILD_DOCS_TRANSLATED: with English-only
# builds there is nothing to grey out.
ifeq ($(BUILD_DOCS_TRANSLATED),yes)
.lang-switcher-stamp: $(DOC_SRCDIR)/lang_switcher_postprocess.py $(HTML_TARGETS) $(TRANSLATED_MAN_HTML_TARGETS) $(wildcard $(DOC_DIR)/po/*.po)
$(Q)python3 $(DOC_SRCDIR)/lang_switcher_postprocess.py $(DOC_OUT_HTML) $(DOC_DIR)/po $(POKEEP) $(LANGUAGES)
@touch $@
else
.lang-switcher-stamp:
@touch $@
endif

# Shared assets at the top of the html tree. Index templates and the
# asciidoctor docinfo reference them via ../ relative paths so we ship
# one copy regardless of how many languages render. gcode.html is NOT
# shared: po4a translates it per-language and the per-lang index links
# to its sibling gcode.html.
SHARED_HTML_ASSETS = \
$(DOC_SRCDIR)/lcnc-overrides.css \
$(DOC_SRCDIR)/lcnc-docs.svg \
$(DOC_SRCDIR)/index.css \
$(DOC_SRCDIR)/linuxcnc-logo-chips.png

# docinfo-header.html: generated from .in template. The @LANGUAGE_SWITCHER@
# placeholder expands to one <li> per language (English plus everything
# in $(LANGUAGES)), labelled via $(LANG_LABEL_<lang>). asciidoctor then
# substitutes the {lcnc-cssrel} / {lcnc-lang-label} / {lcnc-subpath}
# attributes per page. po4a.cfg drives the language list, lang-labels
# the display names.
$(DOC_SRCDIR)/docinfo-header.html: $(DOC_SRCDIR)/docinfo-header.html.in $(DOC_DIR)/po4a.cfg $(LANG_LABEL_FILE) $(DOC_SRCDIR)/Submakefile
@block=$$(mktemp); \
printf ' <div class="lcnc-lang-switcher">\n' > $$block ; \
printf ' <input type="checkbox" id="lcnc-lang-toggle" class="lcnc-lang-toggle">\n' >> $$block ; \
printf ' <label for="lcnc-lang-toggle" class="lcnc-lang-label">{lcnc-lang-label}</label>\n' >> $$block ; \
printf ' <ul class="lcnc-lang-list">\n' >> $$block ; \
printf ' <li><a href="{lcnc-cssrel}en/{lcnc-subpath}">$(LANG_LABEL_en)</a></li>\n' >> $$block ; \
$(foreach L,$(LANGUAGES),printf ' <li><a href="{lcnc-cssrel}$(L)/{lcnc-subpath}">$(LANG_LABEL_$(L))</a></li>\n' >> $$block ;) \
printf ' </ul>\n' >> $$block ; \
printf ' </div>\n' >> $$block ; \
awk -v block="$$block" ' \
/@LANGUAGE_SWITCHER@/ { while ((getline line < block) > 0) print line; next } \
{ print } \
' $< > $@ ; \
rm -f $$block

# Stamp-gated asset copy; copy_asciidoc_files stays as a phony alias.
# The en/gcode.html copy lives in its own rule above so it fires for PDF-only
# builds as well; .copy-asciidoc-stamp depends on it for HTML builds.
Expand Down Expand Up @@ -607,7 +703,7 @@ $(foreach L,$(LANGUAGES), \
# from docs/man/<lang>/manN. cssrel is ../../../ for both: each output
# sits at docs/build/html/<lang>/man/manN/X.html (4 levels under html/).
define MAN_HTML_RULE
$(DOC_OUT_HTML)/$(1)/man/%.html: $(2)/% $(DOC_SRCDIR)/docinfo.html
$(DOC_OUT_HTML)/$(1)/man/%.html: $(2)/% $(DOC_SRCDIR)/docinfo.html $(DOC_SRCDIR)/docinfo-header.html
@$$(ECHO) Formatting $$(notdir $$<) as HTML
@mkdir -p $$(dir $$@)
$$(Q)if grep -q '^\.so' $$<; then \
Expand Down Expand Up @@ -636,6 +732,8 @@ $(DOC_OUT_HTML)/$(1)/man/%.html: $(2)/% $(DOC_SRCDIR)/docinfo.html
-a mansource=LinuxCNC \
-a manmanual='LinuxCNC Documentation' \
-a "lcnc-cssrel=../../../" \
-a "lcnc-lang-label=$(LANG_LABEL_$(1))" \
-a "lcnc-subpath=$$(patsubst $(DOC_OUT_HTML)/$(1)/%,%,$$@)" \
-a docinfo=shared \
-a docinfodir=$$(realpath $$(DOC_SRCDIR)) \
-a source-highlighter=rouge \
Expand Down Expand Up @@ -696,19 +794,34 @@ objects/index.incl: $(GENERATED_MANPAGES) objects/var-MAN_HTML_TARGETS $(DOC_SRC
mkdir -p $(DOC_OUT_HTML)/en/man/man/images/
find $(DOC_DIR)/man -maxdepth 3 -name "*.png" ! -name "grohtml*" -exec mv {} "$(DOC_OUT_HTML)/en/man/man/images/" \;

$(DOC_OUT_HTML)/%/index.html: $(DOC_OUT_ADOC)/%/index.tmpl ../VERSION $(DOC_SRCDIR)/index.foot
$(DOC_OUT_HTML)/%/index.html: $(DOC_OUT_ADOC)/%/index.tmpl objects/index.incl ../VERSION $(DOC_SRCDIR)/index.foot $(DOC_SRCDIR)/docinfo-header.html $(DOC_SRCDIR)/Submakefile
@mkdir -p $(dir $@)
cat $(filter-out ../VERSION, $^) | \
sed "s/@VERSION@/`cat ../VERSION`/" | \
if [ "yes" != "$(BUILD_DOCS_TRANSLATED)" ]; then sed '/@TRANSLATIONS@/,/@ENDTRANSLATIONS@/d' ; else grep -Ev '@(END)?TRANSLATIONS@'; fi > $@
$(Q){ \
topbar=$$(mktemp) ; \
sed -e 's|{lcnc-cssrel}|../|g' -e 's|{lcnc-lang-label}|$(LANG_LABEL_$*)|g' -e 's|{lcnc-subpath}|index.html|g' $(DOC_SRCDIR)/docinfo-header.html > $$topbar ; \
(cat $(DOC_OUT_ADOC)/$*/index.tmpl objects/index.incl $(DOC_SRCDIR)/index.foot) \
| sed "s/@VERSION@/`cat ../VERSION`/" \
| awk -v t="$$topbar" 'BEGIN{ while ((getline line < t) > 0) buf = buf line "\n" } /<body>/{ print; printf "%s", buf; next } { print }' \
| sed 's|href="lcnc-overrides.css"|href="../lcnc-overrides.css"|g' \
| if [ "yes" != "$(BUILD_DOCS_TRANSLATED)" ]; then sed '/@TRANSLATIONS@/,/@ENDTRANSLATIONS@/d' ; else grep -Ev '@(END)?TRANSLATIONS@'; fi > $@ ; \
rm -f $$topbar ; \
}

# Rich English landing page lives at <html>/en/index.html (sibling to the
# translated <html>/<lang>/index.html files), generated from index.tmpl
# plus the manpage index include.
$(DOC_OUT_HTML)/en/index.html: $(DOC_SRCDIR)/index.tmpl objects/index.incl $(DOC_SRCDIR)/index.foot ../VERSION $(DOC_SRCDIR)/Submakefile
$(DOC_OUT_HTML)/en/index.html: $(DOC_SRCDIR)/index.tmpl objects/index.incl $(DOC_SRCDIR)/index.foot ../VERSION $(DOC_SRCDIR)/docinfo-header.html $(DOC_SRCDIR)/Submakefile
@mkdir -p $(dir $@)
(cat $(DOC_SRCDIR)/index.tmpl objects/index.incl $(DOC_SRCDIR)/index.foot) | sed "s/@VERSION@/`cat ../VERSION`/" | \
if [ "yes" != "$(BUILD_DOCS_TRANSLATED)" ]; then sed '/@TRANSLATIONS@/,/@ENDTRANSLATIONS@/d' ; else grep -Ev '@(END)?TRANSLATIONS@'; fi > $@
$(Q){ \
topbar=$$(mktemp) ; \
sed 's|{lcnc-subpath}|index.html|g' objects/topbar-en.html > $$topbar ; \
(cat $(DOC_SRCDIR)/index.tmpl objects/index.incl $(DOC_SRCDIR)/index.foot) \
| sed "s/@VERSION@/`cat ../VERSION`/" \
| awk -v t="$$topbar" 'BEGIN{ while ((getline line < t) > 0) buf = buf line "\n" } /<body>/{ print; printf "%s", buf; next } { print }' \
| sed 's|href="lcnc-overrides.css"|href="../lcnc-overrides.css"|g' \
| if [ "yes" != "$(BUILD_DOCS_TRANSLATED)" ]; then sed '/@TRANSLATIONS@/,/@ENDTRANSLATIONS@/d' ; else grep -Ev '@(END)?TRANSLATIONS@'; fi > $@ ; \
rm -f $$topbar ; \
}

# Tree-root redirect: docs/build/html/index.html bounces to en/. The
# page is a checked-in static file under docs/src/; just copy it.
Expand Down Expand Up @@ -950,7 +1063,7 @@ $(foreach L,$(LANGUAGES),$(eval $(call HTML_COPY_RULE,$(L))))
LANG=$$(echo $$HTML_REL | cut -d/ -f1); \
REST=$$(echo $$HTML_REL | cut -d/ -f2-); \
HTML_DIR=$$(dirname $$REST | cut -d/ -f1); \
for IMAGE_FILE in $$(grep -oE 'src="[^"]+"' $$HTML_FILE | sed 's/src="//;s/"$$//' | grep -vE '^https?:|^data:|^/'); do \
for IMAGE_FILE in $$(grep -oE 'src="[^"]+"' $$HTML_FILE | sed 's/src="//;s/"$$//' | grep -vE '^https?:|^data:|^/|lcnc-docs\.svg'); do \
IMAGE_DIR=$$(dirname $$IMAGE_FILE); \
IMAGE_PATH=$(DOC_SRCDIR)/$$HTML_DIR/$$IMAGE_FILE; \
mkdir -p $(DOC_OUT_HTML)/$$LANG/$$HTML_DIR/$$IMAGE_DIR; \
Expand Down Expand Up @@ -1024,7 +1137,7 @@ $(DOC_OUT_ADOC)/%.html: LCNC_CSSREL=$(shell python3 -c "print('../' * '$*'.count
# $4 xref-exclude pattern (English filters all lang subdirs; translated
# trees are rooted inside their own lang dir so the exclude is empty).
define ASCIIDOCTOR_HTML_RULE
$$(patsubst %.adoc,$2/%.html,$$(DOC_SRCS_$(call toUC,$1)_SMALL)): $2/%.html: $2/%.adoc $$(DOC_SRCDIR)/docinfo.html
$$(patsubst %.adoc,$2/%.html,$$(DOC_SRCS_$(call toUC,$1)_SMALL)): $2/%.html: $2/%.adoc $$(DOC_SRCDIR)/docinfo.html $$(DOC_SRCDIR)/docinfo-header.html
$$(ECHO) "Building '$1' adoc to html: " $$<
$$(Q)asciidoctor -r $$(realpath $$(DOC_SRCDIR))/extensions/xref_resolver.rb \
-r $$(realpath $$(DOC_SRCDIR))/extensions/rouge_hal.rb \
Expand All @@ -1035,14 +1148,16 @@ $$(patsubst %.adoc,$2/%.html,$$(DOC_SRCS_$(call toUC,$1)_SMALL)): $2/%.html: $2/
-a "xref-exclude=$4" \
-a "relindir=$$(shell dirname $$*)" \
-a "lcnc-cssrel=$$(LCNC_CSSREL)" \
-a "lcnc-lang-label=$(LANG_LABEL_$1)" \
-a "lcnc-subpath=$$(patsubst $1/%,%,$$*).html" \
-a docinfo=shared \
-a docinfodir=$$(realpath $$(DOC_SRCDIR)) \
-a source-highlighter=rouge \
-a rouge-style=github \
-a webfonts! \
-a linkcss -a copycss! \
-a "stylesdir=$$(LCNC_CSSREL)" \
-d book -a toc -a numbered \
-d book -a toc=left -a numbered \
-o $$@ $$< || (X=$$$$?; rm -f $$@; exit $$$$X)
endef

Expand Down
8 changes: 8 additions & 0 deletions docs/src/code/building-linuxcnc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ The most commonly used arguments are:
Disable building the translated documentation for all available languages.
The building of the translated documentation takes a huge amount of time, so it is recommend to skip that if not really needed.

Translation completeness threshold::
`make POKEEP=N docs`. Per-master threshold (percent) below which a
language-switcher entry is greyed out on the corresponding page.
Translated HTML is always emitted; this knob only affects whether
the entry stays clickable. Default 80. Translators can lower the
threshold (`POKEEP=30`, `POKEEP=0`) to make their work-in-progress
show up as live links. See the contributing guide for details.

[[make-arguments]]
==== `make` arguments

Expand Down
25 changes: 25 additions & 0 deletions docs/src/code/contributing-to-linuxcnc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,31 @@ https://hosted.weblate.org/projects/linuxcnc/
Documentation on how to use Weblate is here:
https://docs.weblate.org/en/latest/user/basic.html

=== Previewing a translation locally

Every translated HTML page is emitted regardless of how much of its
source has actually been translated. The topbar language switcher
greys out entries whose underlying `.po` coverage for that specific
master falls below *80%* by default. Greyed entries are still in the
DOM (so deep links keep working) but rendered as plain text rather
than clickable links, signalling to readers that the page is mostly
English.

If you are actively translating and want your work-in-progress to
appear as a live link on its companion pages, lower the threshold at
build time:

[source,sh]
----
cd src
make POKEEP=30 docs # any page >= 30% translated stays clickable
make POKEEP=0 docs # everything clickable, even untouched pages
----

`POKEEP` is consumed by the post-process pass that walks every HTML
file once at the end of the build. The default value, used by the
published build, is 80.

== Other ways to contribute

There are many ways to contribute to LinuxCNC, that are not addressed
Expand Down
17 changes: 17 additions & 0 deletions docs/src/docinfo-header.html.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<header id="lcnc-topbar" class="lcnc-topbar">
<a class="lcnc-topbar-home" href="{lcnc-cssrel}index.html">
<img src="{lcnc-cssrel}lcnc-docs.svg" alt="LinuxCNC Documentation">
</a>
<nav class="lcnc-topbar-links">
<a data-lcnc-link="0" href="https://linuxcnc.org">LinuxCNC Home Page</a>
<span class="lcnc-sep" aria-hidden="true">&bull;</span>
<a data-lcnc-link="1" href="https://wiki.linuxcnc.org/cgi-bin/wiki.pl">Wiki</a>
<span class="lcnc-sep" aria-hidden="true">&bull;</span>
<a data-lcnc-link="2" href="https://forum.linuxcnc.org">Forum</a>
<span class="lcnc-sep" aria-hidden="true">&bull;</span>
<a data-lcnc-link="3" href="https://github.com/LinuxCNC/linuxcnc">Source</a>
<span class="lcnc-sep" aria-hidden="true">&bull;</span>
<a data-lcnc-link="4" href="{lcnc-cssrel}en/gcode.html">G-Code Quick Reference</a>
</nav>
@LANGUAGE_SWITCHER@
</header>
22 changes: 0 additions & 22 deletions docs/src/gcode.html → docs/src/gcode.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -197,28 +197,6 @@
}
}
function fixup_urls() {
var links=document.evaluate('//a[@href]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for(var i=0; i<links.snapshotLength; i++) {
var it = links.snapshotItem(i);
it.setAttribute('href',
"https://linuxcnc.org/docs/devel/html/" + it.getAttribute('href'));
}
}

// In the LinuxCNC package, gcode/g-code.html is (probably) not included. In this
// case, fix up the links to point at the online version instead of a local
// version
if(document.location.protocol == "file:") {
try {
var x = document.implementation.createDocument("", "", null);
x.load("gcode/g-code.html");
x.onerror = fixup_urls;
} catch(err) {
fixup_urls();
}
}

// --></script>

</body></html>
Loading
Loading