Skip to content

Commit 55e6260

Browse files
committed
docs: remap+source: ini->INI and language editing
1 parent 71d1839 commit 55e6260

10 files changed

Lines changed: 63 additions & 64 deletions

File tree

docs/src/remap/remap.adoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ in this example (see also `tests/interp/abort-hot-comment/test.ngc`):
12151215
[source,{ngc}]
12161216
---------------------------------------------------------------------
12171217
o100 if [..] (some error condition)
1218-
(abort, Bad Things! p42=#42 q=#<q> ini=#<_ini[a]x> pin=#<_hal[component.pin])
1218+
(abort, Bad Things! p42=#42 q=#<q> INI=#<_ini[a]x> pin=#<_hal[component.pin])
12191219
o100 endif
12201220
---------------------------------------------------------------------
12211221

@@ -2673,9 +2673,8 @@ thing.
26732673
.. execute the 'load_tool()' function with the pocket as parameter.
26742674

26752675
The last step actually sets the tooltable entries in the 'emcStatus' structure.
2676-
The actual action taken depends on whether the
2677-
RANDOM_TOOLCHANGER INI option was set, but at the end of the process
2678-
'toolTable[0]' reflects the tool currently in the spindle.
2676+
The actual action taken depends on whether the RANDOM_TOOLCHANGER INI option was set,
2677+
but at the end of the process 'toolTable[0]' reflects the tool currently in the spindle.
26792678

26802679
When that has happened:
26812680

docs/src/source-highlight/README

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
source-highlighting EMC languages in HTML documents
2-
=================================================
2+
===================================================
33

44
I've created GNU source-highlight language definitions for G-code and
5-
halcmd to highlight .hal and .ngc files in asciidoc. .ini file
5+
halcmd to highlight .hal and .ngc files in asciidoc. INI file
66
highlighting works out of the box. All three need a bit of trickery to
7-
work cleanly for both html and pdf.
7+
work cleanly for both HTML and PDF.
88

99
Highlighting is for HTML output only at this point in time. To have
10-
PDF's highlighted, the file
10+
PDFs highlighted, the file
1111
/usr/share/texmf-texlive/tex/latex/listings/lstlang1.sty needs to be
12-
extended to deal with ngc, hal and ini formats, and put into the build
12+
extended to deal with ngc, HAL and INI formats, and put into the build
1313
directory so dblatex can find it.
1414

15-
Highlighting halcmd, ini and ngc source in HTML is now integrated into
16-
the documentation build process. tcl, python, sh etc keep working out
15+
Highlighting halcmd, INI and ngc source in HTML is now integrated into
16+
the documentation build process. Tcl, Python, sh etc keep working out
1717
of the box.
1818

1919
NB: source-highlight's mechanisms to find .lang and .map files is
@@ -22,15 +22,15 @@ directory (/usr/share/source-highlight) needs to be replicated under 'local',
2222
and a new lang.map generated in there (all language definitions are
2323
relative to this directory, and include each other).
2424

25-
Using ngc, hal and ini file snippets in your .txt files:
25+
Using ngc, HAL and INI file snippets in your .txt files:
2626
========================================================
2727
Copy this to the top of your txt file:
2828
----------------- snip ----------------
2929
:ini: {basebackend@docbook:'':ini}
3030
:hal: {basebackend@docbook:'':hal}
3131
:ngc: {basebackend@docbook:'':ngc}
3232

33-
// begin a listing of ini/hal/ngc files like so:
33+
// Begin a listing of ini/hal/ngc files like so:
3434
//[source,{ini}]
3535
//[source,{hal}]
3636
//[source,{ngc}]
@@ -60,7 +60,7 @@ build (including a massive initial rebuild ;-)
6060
Building HTML examples in the this directory
6161
============================================
6262

63-
To produce pdf and html samples, type 'make examples' .
63+
To produce PDF and HTML samples, type 'make examples' .
6464

6565
This should produce {ini-demo,hal-demo,ngc-demo}.{pdf,html} files in
6666
the current directory, with proper highlighting of HTML only. PDF files

docs/src/source-highlight/Submakefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# the source-highlight language defs and lang.map dir
1+
# The source-highlight language defs and lang.map dir
22
HL_DIR=/usr/share/source-highlight
33

44
LOC_HL_DIR=../docs/src/source-highlight
55
LOC_LANG_MAP=$(LOC_HL_DIR)/local/lang.map
66

7-
# languages for which we provide our own .lang files
8-
# this includes overriding languages listed in HL_DIR
7+
# Languages for which we provide our own .lang files.
8+
# This includes overriding languages listed in HL_DIR.
99
EMCLANGS=$(wildcard $(LOC_HL_DIR)/*.lang)
1010

11-
# grep arg to suppress user defined langs already in lang.map
11+
# Grep arg to suppress user defined langs already in lang.map
1212
GREPARG= $(patsubst %, -e %,$(EMCLANGS))
1313

14-
# examples
14+
# Examples
1515
SOURCE_HIGHLIGHT_PDF_TARGETS := $(patsubst %.adoc, %.pdf, $(wildcard $(LOC_HL_DIR)/*.txt))
1616
SOURCE_HIGHLIGHT_HTML_TARGETS := $(patsubst %.adoc, %.html ,$(wildcard $(LOC_HL_DIR)/*.txt))
1717

18-
# tests with HTML output without going through asciidoc
18+
# Tests with HTML output without going through asciidoc
1919
TEST_SRCS := hal-test.hal ini-test.ini ngc-test.ngc
2020
TEST_TARGETS := hal-test.html ini-test.html ngc-test.html
2121

docs/src/source-highlight/hal-test.hal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# note this is for highlighting demo only - there aint any use to it
1+
# Note: This is for highlighting demo only - there aint any use to it
22

33
loadusr -W [MYSECTION]MYMODULE
44

docs/src/source-highlight/ini-demo.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
Details of the filter can be found in `./doc/source-highlight-filter.txt`.
66

7-
// for now, PDF's can't have highlighted ini,hal or ngc files
8-
// for brave souls: extend /usr/share/texmf-texlive/tex/latex/listings/lstlang1.sty
9-
// and make it a local copy in the current directory
10-
// HTML works fine
7+
// For now, PDF's can't have highlighted INI, HAL or ngc files.
8+
// For brave souls: extend /usr/share/texmf-texlive/tex/latex/listings/lstlang1.sty
9+
// and make it a local copy in the current directory.
10+
// HTML works fine.
1111

1212
// these attributes must come after the document title, to work around a bug in asciidoc 8.6.6
1313
:ini: {basebackend@docbook:'':ini}
1414
:hal: {basebackend@docbook:'':hal}
1515
:ngc: {basebackend@docbook:'':ngc}
1616

17-
// begin a listing of ini/hal/ngc files like so:
17+
// Begin a listing of INI/HAL/ngc files like so:
1818
//[source,{ini}]
1919
//[source,{hal}]
2020
//[source,{ngc}]
@@ -25,7 +25,7 @@ Details of the filter can be found in `./doc/source-highlight-filter.txt`.
2525
# EMC controller parameters for a simulated machine.
2626
2727
# General note: Comments can either be preceded with a # or ; - either is
28-
# acceptable, although # is in keeping with most linux config files.
28+
# acceptable, although # is in keeping with most Linux config files.
2929
3030
# General section -------------------------------------------------------------
3131
[EMC]
@@ -115,7 +115,7 @@ SERVO_PERIOD = 1000000
115115
# files, and then to execute any individual HALCMD commands.
116116
#
117117
118-
# list of hal config files to run through halcmd
118+
# list of HAL config files to run through halcmd
119119
# files are executed in the order in which they appear
120120
HALFILE = core_sim.hal
121121
HALFILE = axis_manualtoolchange.hal

docs/src/source-highlight/ini-test.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# EMC controller parameters for a simulated machine.
33

44
# General note: Comments can either be preceded with a # or ; - either is
5-
# acceptable, although # is in keeping with most linux config files.
5+
# acceptable, although # is in keeping with most Linux config files.
66

77
# General section -------------------------------------------------------------
88
[EMC]
@@ -92,7 +92,7 @@ SERVO_PERIOD = 1000000
9292
# files, and then to execute any individual HALCMD commands.
9393
#
9494

95-
# list of hal config files to run through halcmd
95+
# list of HAL config files to run through halcmd
9696
# files are executed in the order in which they appear
9797
HALFILE = core_sim.hal
9898
HALFILE = axis_manualtoolchange.hal

docs/src/source-highlight/ini.lang

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# simpleminded ini filter for source-highlight 2.4
1+
# simpleminded INI filter for source-highlight 2.4
22
#
33
comment start "#"
44
section start '\[.*\]'

docs/src/source-highlight/ngc-demo.adoc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
= Source Highlight Filter Test
44

5-
// for now, PDF's can't have highlighted ini,hal or ngc files
6-
// for brave souls: extend /usr/share/texmf-texlive/tex/latex/listings/lstlang1.sty
7-
// and make it a local copy in the current directory
8-
// HTML works fine
5+
// For now, PDF's can't have highlighted ini,hal or ngc files.
6+
// For brave souls: extend /usr/share/texmf-texlive/tex/latex/listings/lstlang1.sty
7+
// and make it a local copy in the current directory.
8+
// HTML works fine.
99

10-
// these attributes must come after the document title, to work around a bug in asciidoc 8.6.6
10+
// These attributes must come after the document title, to work around a bug in asciidoc 8.6.6.
1111
:ini: {basebackend@docbook:'':ini}
1212
:hal: {basebackend@docbook:'':hal}
1313
:ngc: {basebackend@docbook:'':ngc}
1414

15-
// begin a listing of ini/hal/ngc files like so:
15+
// Begin a listing of ini/hal/ngc files like so:
1616
//[source,{ini}]
1717
//[source,{hal}]
1818
//[source,{ngc}]
@@ -51,11 +51,11 @@ G 5 3
5151
G0
5252
G1
5353
;
54-
; to activate, incantate as follows in the ini file:
54+
; To activate, incantate as follows in the INI file:
5555
;
5656
; [RS274NGC]
57-
; # remap M6 to a named oword subroutine.
58-
; # the tool number currently loaded (in spindle) is passed as parameter #1
57+
; # Remap M6 to a named O-word subroutine.
58+
; # The tool number currently loaded (in spindle) is passed as parameter #1
5959
; M6_COMMAND=o<m6demo>call
6060
;
6161
;
@@ -85,18 +85,18 @@ O<m6demo_tc_at_g30> if [#<tool_change_at_g30>] NE 0
8585
G30
8686
O<m6demo_tc_at_g30> endif
8787
88-
; set analog output pin #2 to signal the pocket number
89-
; iocontrol.tool-number becomes motion.analog-out-02
88+
; Set analog output pin #2 to signal the pocket number.
89+
; iocontrol.tool-number becomes motion.analog-out-02.
9090
M68 E2 Q[#1]
9191
(DEBUG, set current tool number on motion.analog-out-02: #1)
9292
;
93-
; assert the equivalent of the iocontrol.tool-change pin
94-
; which is now motion.digital-out-01
93+
; Assert the equivalent of the iocontrol.tool-change pin,
94+
; which is now motion.digital-out-01.
9595
M64 P1
9696
(DEBUG, motion.digital-out-01 set high, waiting for motion.digital-in-01)
9797
;
98-
; wait for the equivalent of the iocontrol.tool-changed pin to go high
99-
; we use motion.digital-in-01
98+
; Wait for the equivalent of the iocontrol.tool-changed pin to go high.
99+
; We use motion.digital-in-01.
100100
;
101101
M66 P1 L3 Q#<timeout>
102102
;
@@ -106,7 +106,7 @@ O<m6demo_timeout> else
106106
(DEBUG, motion.digital-in-01 became true: #5399)
107107
O<m6demo_timeout> endif
108108
109-
; retract iocontrol.tool-change equivalent
109+
; Retract iocontrol.tool-change equivalent.
110110
(DEBUG, deasserting motion.digital-out-01)
111111
;
112112
M65 P1

docs/src/source-highlight/ngc-test.ngc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ G 5 3
2828
G0
2929
G1
3030
;
31-
; to activate, incantate as follows in the ini file:
31+
; To activate, incantate as follows in the INI file:
3232
;
3333
; [RS274NGC]
3434
; # remap M6 to a named oword subroutine.
@@ -62,18 +62,18 @@ O<m6demo_tc_at_g30> if [#<tool_change_at_g30>] NE 0
6262
G30
6363
O<m6demo_tc_at_g30> endif
6464

65-
; set analog output pin #2 to signal the pocket number
66-
; iocontrol.tool-number becomes motion.analog-out-02
65+
; Set analog output pin #2 to signal the pocket number.
66+
; iocontrol.tool-number becomes motion.analog-out-02.
6767
M68 E2 Q[#1]
6868
(DEBUG, set current tool number on motion.analog-out-02: #1)
6969
;
70-
; assert the equivalent of the iocontrol.tool-change pin
71-
; which is now motion.digital-out-01
70+
; Assert the equivalent of the iocontrol.tool-change pin,
71+
; which is now motion.digital-out-01.
7272
M64 P1
7373
(DEBUG, motion.digital-out-01 set high, waiting for motion.digital-in-01)
7474
;
75-
; wait for the equivalent of the iocontrol.tool-changed pin to go high
76-
; we use motion.digital-in-01
75+
; Wait for the equivalent of the iocontrol.tool-changed pin to go high.
76+
; We use motion.digital-in-01.
7777
;
7878
M66 P1 L3 Q#<timeout>
7979
;
@@ -83,7 +83,7 @@ O<m6demo_timeout> else
8383
(DEBUG, motion.digital-in-01 became true: #5399)
8484
O<m6demo_timeout> endif
8585

86-
; retract iocontrol.tool-change equivalent
86+
; Retract iocontrol.tool-change equivalent.
8787
(DEBUG, deasserting motion.digital-out-01)
8888
;
8989
M65 P1

docs/src/source-highlight/ngc.lang

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#
33
# Michael Haberler 3/2011
44
#
5-
# originally based on the Highlight-mode file for gedit,
6-
# written by Jan Van Gilsen <janvangilsen(at)gmail(dot)com>
5+
# Originally based on the Highlight-mode file for gedit,
6+
# written by Jan Van Gilsen <janvangilsen(at)gmail(dot)com>.
77
# Installation instructions can be found at:
88
# http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Highlighting_In_Gedit
99
# Version : 0.3
1010
# Last Edit : 10Th Nov 2007, by Jan Van Gilsen
11-
# Comment : added probing and rigid tapping G-codes (new in 2.2)
11+
# Comment : Added probing and rigid tapping G-codes (new in 2.2)
1212

1313

1414
environment comment delim '\([dD][eE][bB][uU][gG],' ")" begin
@@ -21,24 +21,24 @@ comment start ";"
2121

2222
ignore = 'axes'
2323

24-
# numbered parameters (#5xxx)
24+
# Numbered parameters (#5xxx)
2525
variable = '#([0-9]{4})'
2626

27-
# function parameter - #1 .. #30
27+
# Function parameter - #1 .. #30
2828
variable = '#[0-9][0-9]?'
2929

30-
# named parameters
30+
# Named parameters
3131
variable = '#<([^\>]+)>'
3232

33-
# math functions and boolean logic
33+
# Math functions and boolean logic
3434
function = "cos|tan|asin|acos|atan|exp|ln|sqrt|fup|fix|abs|or",
3535
"xor|and|mod|gt|lt|ge|le|eq|ne|exists"
3636
nonsensitive
3737

38-
# operators
38+
# Operators
3939
function = '(([\/|\=\+\*])|(\])|(\[))'
4040

41-
# line numbers
41+
# Line numbers
4242
comment = '^[n|N]([ |\t]*[0-9]){1,5}'
4343

4444
# O-word lines and their keywords

0 commit comments

Comments
 (0)