Skip to content

Commit 5d091b7

Browse files
committed
docs: generate list of missing components
1 parent 4385731 commit 5d091b7

5 files changed

Lines changed: 88 additions & 6 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ build-stamp
1313
.tmp*
1414
# Ignore generated html files,
1515
/docs/src/*/*.html
16+
docs/src/hal/components_gen1.adoc
17+
docs/src/hal/components_gen9.adoc
1618
# docs/html/.gitignore is for the html directory
1719
debian/*.debhelper.log
1820
rtlib/Module.symvers

docs/src/Submakefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,17 @@ pdfdocs: svgs_made_from_dots $(PDF_TARGETS)
350350

351351
htmldocs: svgs_made_from_dots .htmldoc-stamp checkref_en
352352

353-
.htmldoc-stamp: copy_asciidoc_files $(HTML_TARGETS) .images-stamp .include-stamp
353+
.htmldoc-stamp: copy_asciidoc_files gen_complist $(HTML_TARGETS) .images-stamp .include-stamp
354354
touch $@
355355

356356
.PHONY: copy_asciidoc_files
357357
copy_asciidoc_files:
358358
cp -f /etc/asciidoc/stylesheets/*.css $(DOC_DIR)/html
359359
cp -f /etc/asciidoc/javascripts/*.js $(DOC_DIR)/html
360360

361+
gen_complist:
362+
python3 $(DOC_SRCDIR)/gen_complist.py
363+
361364
checkref: checkref_en checkref_de checkref_es checkref_fr checkref_hu checkref_nb checkref_vi checkref_zh_CN
362365

363366
checkref_en: $(DOC_TARGETS_HTML_EN) $(DOC_DIR)/html/index.html $(DOC_DIR)/html/gcode.html .htmldoc-stamp

docs/src/asciideps

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ includes () {
99
DIR=`dirname "$1"`
1010

1111
for f in `sed -ne "s|^include::\(.*\)\[\]$|$DIR/\1|p" "$1"`; do
12+
# components_gen.adoc will contain only generated content
13+
case "$f" in
14+
*/components_gen*.adoc)
15+
touch "$f"
16+
;;
17+
esac
1218
echo "$f"
1319
includes "$f"
1420
done

docs/src/gen_complist.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env python3
2+
# This file compares the entries in the component list (components.adoc) with the
3+
# available man pages and adds a tables for missing components.
4+
5+
from os import listdir
6+
from os.path import isfile, join
7+
8+
man1_path = '../docs/html/man/man1'
9+
man1_files = {f.replace('.1.html', '') for f in listdir(man1_path) if isfile(join(man1_path, f))}
10+
man9_path = '../docs/html/man/man9'
11+
man9_files = {f.replace('.9.html', '') for f in listdir(man9_path) if isfile(join(man9_path, f))}
12+
13+
file1 = open('../docs/src/hal/components.adoc', 'r')
14+
section_switch = '[[sec:realtime-components]]'
15+
doc1 = set()
16+
doc9 = set()
17+
components = [doc1,doc9]
18+
comp_index = 0
19+
for line in file1:
20+
if section_switch in line:
21+
comp_index = 1
22+
23+
if line[0] == '|' and line[1] != '=':
24+
line = line.split('|')
25+
if line[1].strip() != '':
26+
components[comp_index].add(line[1].strip())
27+
#print(line[1].strip(), "-->", comp_index)
28+
29+
file1.close()
30+
31+
miss1 = man1_files.difference(doc1)
32+
obs1 = doc1.difference(man1_files)
33+
miss9 = man9_files.difference(doc9)
34+
obs9 = doc9.difference(man9_files)
35+
36+
file2 = open('../docs/src/hal/components_gen1.adoc', 'w')
37+
if len(miss1) > 0:
38+
file2.write('=== Not categorized (auto generated)\n')
39+
file2.write('[{tab_options}]\n|=======================\n')
40+
for i in sorted(miss1):
41+
file2.write('| ' + i + ' |||\n')
42+
file2.write('|=======================\n')
43+
if len(obs1) > 0:
44+
file2.write('\n=== Obsolete (auto generated)\n')
45+
file2.write('[{tab_options}]\n|=======================\n')
46+
for i in sorted(obs1):
47+
file2.write('| ' + i + ' |||\n')
48+
file2.write('|=======================\n')
49+
file2.close()
50+
51+
file3 = open('../docs/src/hal/components_gen9.adoc', 'w')
52+
if len(miss9) > 0:
53+
file3.write('=== Not categorized (auto generated)\n')
54+
file3.write('[{tab_options}]\n|=======================\n')
55+
for i in sorted(miss9):
56+
file3.write('| ' + i + ' |||\n')
57+
file3.write('|=======================\n')
58+
if len(obs9) > 0:
59+
file3.write('\n=== Obsolete (auto generated)\n')
60+
file3.write('[{tab_options}]\n|=======================\n')
61+
for i in sorted(obs9):
62+
file3.write('| ' + i + ' |||\n')
63+
file3.write('|=======================\n')
64+
file3.close()
65+
66+
print('gen_complist: Added {} uncategorized and {} obsolete entries to hal component list (man1)'.format(len(miss1), len(obs1)))
67+
print('gen_complist: Added {} uncategorized and {} obsolete entries to hal component list (man9)'.format(len(miss9), len(obs9)))

docs/src/hal/components.adoc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,22 @@ man axis (or perhaps 'man 1 axis' if your system requires it.)
3434

3535
[{tab_options}]
3636
|=======================
37-
| gs2 | HAL userspace component for Automation Direct GS2 VFD's. ||
38-
| mb2hal | ||
37+
| mb2hal | MB2HAL is a generic userspace HAL component to communicate with one or more Modbus devices. Modbus RTU and Modbus TCP is supported.||
3938
|=======================
4039

4140
=== Diagnostic and Configuration Tools
4241

4342
[{tab_options}]
4443
|=======================
4544
| halmeter | Observe HAL pins, signals, and parameters. ||
46-
| halshow |||
47-
| halscope |||
45+
| halshow | Show HAL parameters, pins and signals ||
46+
| halscope | Software oscilloscope for viewing real time waveforms of HAL pins and signals ||
4847
|=======================
4948

5049
=== Other
5150

5251
[{tab_options}]
5352
|=======================
54-
| comp | Build, compile and install LinuxCNC HAL components. ||
5553
| halcmd | Manipulate the Enhanced Machine Controller HAL from the command line. ||
5654
| hal_input | Control HAL pins with any Linux input device, including USB HID devices. ||
5755
| halrun | Manipulate the Enhanced Machine Controller HAL from the command line. ||
@@ -63,6 +61,8 @@ man axis (or perhaps 'man 1 axis' if your system requires it.)
6361
| shuttle | control HAL pins with the ShuttleXpress and ShuttlePRO devices made by Contour Design. ||
6462
|=======================
6563

64+
include::components_gen1.adoc[]
65+
6666
[[sec:realtime-components]]
6767

6868
== Realtime Components
@@ -160,6 +160,7 @@ Limit its slew rate to less than maxv per second. Limit its second derivative to
160160

161161
[{tab_options}]
162162
|=======================
163+
| gs2 | HAL userspace component for Automation Direct GS2 VFD's. ||
163164
| hal_ppmc | Pico Systems <<cha:pico-drivers,driver>> for analog servo, PWM and Stepper controller. ||
164165
| hm2_7i43 | Mesa Electronics driver for the 7i43 EPP Anything IO board with HostMot2. (See the man page for more information) ||
165166
| hm2_pci | Mesa Electronics driver for the 5i20, 5i22, 5i23, 4i65, and 4i68 Anything I/O boards, with HostMot2 firmware. (See the man page for more information) ||
@@ -214,6 +215,7 @@ clarkeinv:: (((clarkeinv))) Inverse Clarke transform.
214215

215216
[{tab_options}]
216217
|=======================
218+
| comp | Build, compile and install LinuxCNC HAL components. ||
217219
|motion | Accepts NML motion commands, interacts with HAL in realtime. ||
218220
|classicladder | Realtime software PLC based on ladder logic. See <<cha:classicladder,ClassicLadder>> chapter for more information. ||
219221
|threads | Creates hard realtime HAL threads. ||
@@ -255,6 +257,8 @@ to the smoothing level desired. Divide the axis.N.jog-scale values by scale. ||
255257
| watchdog | Monitor one to thirty-two inputs for a 'heartbeat'. ||
256258
|=======================
257259

260+
include::components_gen9.adoc[]
261+
258262
== HAL API calls
259263

260264
----

0 commit comments

Comments
 (0)