@@ -365,7 +365,7 @@ In the code portion of a .comp file, follow normal C coding style.
365365
366366== Style for the Documentation
367367
368- This is a very recent (1 /2022) part of this document. Please help shaping it if you are familiar with asciidoc.
368+ This is a very recent (09 /2022) part of this document. Please help shaping it if you are familiar with asciidoc.
369369
370370// After looking at the website, and maybe watching the one or other YouTube Video, the
371371// LinuxCNC documentation is likely the first point of contact for any new
@@ -388,9 +388,8 @@ This is a very recent (1/2022) part of this document. Please help shaping it if
388388// included file includes it.
389389
390390
391- * header tags block like toc etc
392- +
393- --
391+ === Header, tags, toc, anchors etc.
392+
394393Every file should start with a header. This is typically
395394----
396395:lang: en
@@ -400,79 +399,226 @@ and longer documents may also chose to set
400399:toc:
401400----
402401This should be followed by an anchor for that section or chapter that is
403- represented in that file, like
402+ represented in that file like
404403----
405- [[cha:filename ]]
404+ [[cha:<file-title> ]]
406405----
407- If the file has a language-extension like _fr then this extension shall not become part of the anchor.
408- For a better consistency, and maintainability, the anchors need to be the same for all langages.
409- If the page needs extras, e.g. for the syntax-highlighting, then such lines may then follow.
410- --
411- * anchors for titles and other blocks
412- +
406+ // For a better consistency, and maintainability, the anchors need to be the same for all langages.
407+ // If the page needs extras, e.g. for the syntax-highlighting, then such lines may then follow.
408+
409+ // .Anchors for titles and other blocks
410+
413411If a chapter/section header shall be granted the option to be
414- referenced from another part of the documentation then it needs an achor .
412+ referenced from another part of the documentation then it needs an anchor .
415413The anchor shall be a combination of an indicator of the kind
416- of block that is referenced (cha,sec,fig,tab,...) together with a
414+ of block that is referenced (cha, sec, fig ,tab, ...) together with a
417415short name identifying the object.
418416
419- * index entries for titles and other blocks
420417
421- ?
418+ // * index entries for titles and other blocks
419+
420+ // ?
421+
422+ === Lists
423+
424+ I think we should not define whether we should have a dot at the end of list items or not
425+
426+ === Sections and subsections
427+
428+ The depth of sections shall not exceed 3 levels. If more structure is needed,
429+ subheadings can be inserted like this:
430+ ----
431+ = Chapter
432+ == Section
433+ === Subsection
434+ .Subheading
435+ ----
436+
437+ === Code blocks
438+
439+ Asciidoc supports syntax highlighting for several languages.
440+ The most common used in LinuxCNC are: _c, python, sh, tcl, xml_. +
441+ They are used like this:
442+ ----
443+ [source,c]
444+ ----
445+ // some code
446+ ----
447+ ----
448+ It also exists some LinuxCNC-specific syntax highlighting
449+ for _hal, ini, ngc_. +
450+ To use those, following lines need to be inserted:
451+ ----
452+ // these attributes must come after the document title, to work around a bug in asciidoc 8.6.6
453+ :ini: {basebackend@docbook:'':ini}
454+ :hal: {basebackend@docbook:'':hal}
455+ :ngc: {basebackend@docbook:'':ngc}
456+ ----
457+
458+ The keywords for those need to be surrounded by curly braces:
459+ ----
460+ [source,{ini}]
461+ ----
462+ // some code
463+ ----
464+ ----
465+
466+ === Pin listings
467+
468+
469+ .Compact Form
470+
471+ ----
472+ * **comp.group.**_N_**.pin** '(type, direction)' - Functional description
473+ ----
474+
475+ Example:
476+ ====
477+ * **halui.joint.**_N_**.select** '(bit, in)' - Pin for selecting joint N
478+ * **halui.joint.**_N_**.is-selected** '(bit, out)' - Status pin that joint N is selected
479+ * **halui.joint.**_N_**.has-fault** '(bit, out)' - Status pin telling that joint N has a fault
480+ ====
481+ Where _N_ is the instance number of the component. If it's a componemt/module that can only be loaded once, a zero could/should replace the _N_:
482+
483+ ====
484+ * *iocontrol.0.coolant-flood* '(Bit, Out)' TRUE when flood coolant is requested
485+
486+ * *iocontrol.0.coolant-mist* '(Bit, Out)' TRUE when mist coolant is requested
487+
488+ * *iocontrol.0.emc-enable-in* '(Bit, In)' Should be driven FALSE when an external
489+ estop condition exists.
490+ ====
491+
492+ [NOTE]
493+ (Bit, In) or (bit, in) ?
494+
495+ .Expanded (extended, enlarged?) Form, variant 1
496+
497+ ----
498+ * **comp.group.**_N_**.pin**:: '(type, direction)' - Functional description
499+ ----
500+
501+ Example:
502+ ====
503+ **pid.**_N_**.Pgain**:: '(float, in)' - Proportional gain. Results in a contribution to the output that is the error multiplied by Pgain.
504+
505+ **pid.**_N_**.Igain**:: '(float, in)' - Integral gain. Results in a contribution to the output that is the integral of the error multiplied by Igain. For example an error of 0.02 that lasted 10 seconds would result in an integrated error '(errorI)' of 0.2, and if Igain is 20, the integral term would add 4.0 to the output.
506+
507+ **pid.**_N_**.Dgain**:: '(float, in)'- Derivative gain. Results in a contribution to the output that is the rate of change (derivative) of the error multiplied by Dgain. For example an error that changed from 0.02 to 0.03 over 0.2 seconds would result in an error derivative (errorD) of of 0.05, and if Dgain is 5, the derivative term would add 0.25 to the output.
508+ ====
509+
510+ .Expanded (extended, enlarged?) Form, variant 2
511+ ----
512+ * **comp.group.**_N_**.pin** '(type, direction)':: Functional description
513+ ----
514+
515+ Example:
516+ ====
517+ **pid.**_N_**.Pgain** '(float, in)':: Proportional gain. Results in a contribution to the output that is the error multiplied by Pgain.
518+
519+ **pid.**_N_**.Igain** '(float, in)':: Integral gain. Results in a contribution to the output that is the integral of the error multiplied by Igain. For example an error of 0.02 that lasted 10 seconds would result in an integrated error (`errorI`) of 0.2, and if Igain is 20, the integral term would add 4.0 to the output.
520+
521+ **pid.**_N_**.Dgain** '(float, in)':: Derivative gain. Results in a contribution to the output that is the rate of change (derivative) of the error multiplied by Dgain. For example an error that changed from 0.02 to 0.03 over 0.2 seconds would result in an error derivative (errorD) of of 0.05, and if Dgain is 5, the derivative term would add 0.25 to the output.
522+ ====
523+
524+ === Listings of Commands/Messages
525+
526+ .Panelui
527+ ====
528+ .*home_selected*
529+ * required argument: axis number (int)
530+
531+ .*unhome_selected*
532+ * required argument: axis number (int)
533+
534+ .*override_limits*
422535
423- * lists formatting
536+ .*spindle_forward_adjust*
537+ * optional argument: starting RPM (int) - default 100
538+ * Description: If the spindle is stopped it will start in the forward direction.
539+ If it is already running it will increase or decrease the rpm depending on
540+ what direction the spindle is running in.
424541
425- ?
542+ .*spindle_forward*
543+ * optional argument: starting RPM (int) - default 100
426544
427- * usage of lists vs titles
545+ ====
428546
429- ?
430547
431- * use of bold and italic
432- * structure/page splitting guidance
433- - avoid 2k+ char long lines
434- * table formatting
548+ .GStat
549+ ====
550+ *motion-mode-changed* :: '(returns integer)' -
551+ Sent when motion's mode has changed
435552
436- Tables can be presented with a series of options.
553+ *spindle-control-changed* :: '(returns integer, bool, integer, bool)' -
554+ (spindle num, spindle on state, requested spindle direction & rate, at-speed state) +
555+ Sent when spindle direction or running status changes or at-speed changes.
437556
438- - header
557+ *current-feed-rate* :: '(returns float)' -
558+ Sent when the current feed rate changes.
439559
440- With the header-option set, the fist line will be interpreted accordingly.
560+ *current-x-rel-position* :: '(returns float)' -
561+ Sent every 100ms.
441562
442- - column width
563+ *current-position* :: '(returns pyobject, pyobject, pyobject, pyobject)' -
564+ Sent every 100ms. +
565+ returns tuples of position, relative position, distance-to-go and +
566+ the joint actual position. Before homing, on multi-joint axes, only joint +
567+ position is valid.
568+ ====
443569
444- in ideal column, the column is constituted only by its data. No
445- vertical separators should be required. The horizontal alignment will
446- also not be required since the writing itself is horizontal enough.
447570
448- If individual fields have too much text then a line-break within that
449- field should be provoked.
450571
451- - what lines are visible
572+ === Values and Units
452573
453- As motivated above, there should be no grid lines.
454- The top and bottom lines should separate the table from the surrounding text.
455- Another line could be motivated between the header and the main body.
574+ Between a value and its unit shall be always a space, preferably a thin space (\ ). +
575+ Example: `100\ kHz` -> 100 kHz
456576
457- - captions
458577
459- Asciidoc makes it difficult to nicely prepare captions. At the same time,
460- captions are the only bit of the whole document that even with the first flick
461- through the document will not escape the reader's attention.
462- ----
463- Instruction needs to be added
464- ----
465578
466- - reference
579+ * usage of lists vs titles +
580+ ?
581+
582+ * use of bold and italic
583+ * structure/page splitting guidance
584+ - avoid 2k+ char long lines
585+
586+ === Table Formatting
587+ Tables can be presented with a series of options.
588+
589+ - header +
590+ With the header-option set, the fist line will be interpreted accordingly.
591+
592+ - column width +
593+ in ideal column, the column is constituted only by its data. No
594+ vertical separators should be required. The horizontal alignment will
595+ also not be required since the writing itself is horizontal enough.
596+ +
597+ If individual fields have too much text then a line-break within that
598+ field should be provoked.
599+
600+ - what lines are visible +
601+ As motivated above, there should be no grid lines.
602+ The top and bottom lines should separate the table from the surrounding text.
603+ Another line could be motivated between the header and the main body.
604+
605+ - captions +
606+ Asciidoc makes it difficult to nicely prepare captions. At the same time,
607+ captions are the only bit of the whole document that even with the first flick
608+ through the document will not escape the reader's attention.
609+ ----
610+ Instruction needs to be added
611+ ----
467612
468- * figure formatting (captions)
469- - reference
470- - caption
471- ----
472- Instruction needs to be added
473- ----
474- * footnotes
475- * comments
476- * interaction with other media like videos
613+ - reference
614+ * figure formatting (captions)
615+ - reference
616+ - caption
617+ ----
618+ Instruction needs to be added
619+ ----
620+ * footnotes
621+ * comments
622+ * interaction with other media like videos
477623
478624// vim: set syntax=asciidoc:
0 commit comments