Skip to content

Commit

Permalink
activate highlight.js
Browse files Browse the repository at this point in the history
- It supports everything we need except HAL syntax (of course not),
- it supports autodetection of code type,
- the notation "{ini}" leads to autodetection - but probably using "ini" is fine with asciidoctor
- highlight.js is currently accessed online --> has to be included in the repository for offline docs
  • Loading branch information
hansu committed Oct 7, 2022
1 parent 0e58cdc commit 3f3dcfc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docs/src/config/ini-config.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
:lang: en
:toc:
:source-highlighter: highlight.js

[[cha:ini-configuration]]
= INI Configuration(((INI Configuration)))
Expand Down Expand Up @@ -106,7 +107,7 @@ whitespace following the trailing backslash character.
Section identifiers may not be extended to multiple lines.

.Variable with Line extends Example
[source,{ini}]
[source,ini]
----
APP = sim_pin \
ini.0.max_acceleration \
Expand Down Expand Up @@ -134,7 +135,7 @@ To add a custom variable to an existing LinuxCNC section, simply include
the variable in that section.

.Custom Variable Example
[source,{ini}]
[source,ini]
----
[JOINT_0]
TYPE = LINEAR
Expand Down Expand Up @@ -482,7 +483,7 @@ path to the program or be located in a directory that is on the system path.

It is also possible to specify an interpreter:

[source,{ini}]
[source,ini]
----
PROGRAM_EXTENSION = .py Python Script
py = python
Expand Down
7 changes: 5 additions & 2 deletions docs/src/gcode/g-code.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
:lang: en
:toc:
:source-highlighter: highlight.js

[[cha:g-codes]]
= G-Codes
Expand Down Expand Up @@ -1094,8 +1095,9 @@ an encoder (or resolver) counter which resets index-enable once per rev.
See the Integrators Manual for more information on spindle synchronized
motion.

// this seems to enable auto detection of source type
.G33 Example
[source,{ngc}]
[source,'']
----
G90 (absolute distance mode)
G0 X1 Z0.1 (rapid to position)
Expand All @@ -1119,7 +1121,8 @@ It is an error if:
[[gcode:g33.1]]
== G33.1 Rigid Tapping(((G33.1 Rigid Tapping)))

[source,{ngc}]
// this should force gcode style, but doesn't actually
[source,gcode]
----
G33.1 X- Y- Z- K- I- $-
----
Expand Down

0 comments on commit 3f3dcfc

Please sign in to comment.