Skip to content

Commit d666fe6

Browse files
committed
style guide structure
1 parent f6b86c8 commit d666fe6

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

docs/src/code/style-guide.adoc

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,21 @@
33

44
= Coding Style
55

6-
LinuxCNC is developed in C/C++, Python, BASH and Tcl/TK.
7-
Documentation is written in asciidoc, which includes parts of the
8-
UNIX man pages.
6+
LinuxCNC is developed in C/C++, Python, BASH and Tcl/Tk.
7+
Documentation is written in asciidoc, which includes the
8+
UNIX man pages written in Groff.
99

10-
These computer languages are not completely independent from each other.
11-
So is C/C++ used to extend the functionality of the other scripting
12-
languages. And executables implemented in any of these languages
13-
may be called from anywhere, mostly from the scripting languages.
10+
These programming languages are not completely independent from each other.
11+
So do the scripting languages extend the LinuxCNC core written in C/C++ for easier adaption of user interfaces.
1412

15-
Every computer language is its very own syntax and customs to be structured,
13+
Every programming language has its very own syntax and customs to be structured,
1614
and many flavours with every developer being very opinionated about
1715
their very own being the best. And while the exact style does not matter
1816
too much, it is important for the eye to see the source code formatted
1917
consistently.
2018

2119
This chapter hence describes the source code style preferred by the
22-
LinuxCNC team. This shall improve our overall efficiency and avoid
20+
LinuxCNC team. This shall improve the readability of source code and documentation and shall avoid
2321
intensive discussions (aka bike-shedding) about how to style it best.
2422

2523
== General comments
@@ -351,70 +349,72 @@ of .c and .h are reserved for plain C. Headers are for class, method,
351349
and structure declarations, not code (unless the functions are declared
352350
inline).
353351

354-
=== Python coding standards
352+
353+
== Python coding standards
355354

356355
Use the http://www.python.org/dev/peps/pep-0008/[PEP 8] style for
357356
Python code.
358357

359-
=== Comp coding standards
358+
== Comp coding standards
360359

361360
In the declaration portion of a .comp file, begin each declaration at
362361
the first column. Insert extra blank lines when they help group related
363362
items.
364363

365364
In the code portion of a .comp file, follow normal C coding style.
366365

367-
== Code describing the functionality for the human
366+
== Style for the Documentation
368367

369368
This is a very recent (1/2022) part of this document. Please help shaping it if you are familiar with asciidoc.
370369

371-
After the website, and maybe the one or other YouTube Video, the
372-
LinuxCNC documentation is likely the first point of contact for any new
373-
user. The talent to get the documentation right is mostly disjunct from
374-
computationally orchestrating all the moving parts of a mill or lathe,
375-
though. Still, we need this to shine if we want LinuxCNC to shine and
376-
for a transfer of our knowledge for the next generation - this seems
377-
fair to say for a project that was started in the last millenium and few
378-
individuals buying their own mills/lathes before their hair turns gray.
370+
// After looking at the website, and maybe watching the one or other YouTube Video, the
371+
// LinuxCNC documentation is likely the first point of contact for any new
372+
// user. The talent to get the documentation right is mostly disjunct from
373+
// computationally orchestrating all the moving parts of a mill or lathe,
374+
// though. Still, we need this to shine if we want LinuxCNC to shine and
375+
// for a transfer of our knowledge for the next generation - this seems
376+
// fair to say for a project that was started in the last millenium and few
377+
// individuals buying their own mills/lathes before their hair turns gray.
379378

380-
=== Overall structure of documentation
379+
// not really related to the style guide IMHO
380+
// == Overall structure of documentation
381381

382-
There are two basic documents, i.e. the
383-
* Users' Guide and the
384-
* Developers' Guide
382+
// There are two basic documents, i.e. the
383+
// * Users' Guide and the
384+
// * Developers' Guide
385385

386-
All documents created belong to either of these "parental documents"
387-
and are included from the respective document, either directly or that
388-
included file includes it.
386+
// All documents created belong to either of these "parental documents"
387+
// and are included from the respective document, either directly or that
388+
// included file includes it.
389389

390-
=== Common challenges
391390

392391
* header tags block like toc etc
393-
394-
Every file should start with a header. This is typically
395-
----
396-
:lang: en
397-
----
398-
and longer documents may also chose to set
399-
----
400-
:toc:
401-
----
402-
This should be followed by an anchor for that section or chapter that is
403-
represented in that file, like
404-
----
405-
[[cha:filename]]
406-
----
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-
392+
+
393+
--
394+
Every file should start with a header. This is typically
395+
----
396+
:lang: en
397+
----
398+
and longer documents may also chose to set
399+
----
400+
:toc:
401+
----
402+
This should be followed by an anchor for that section or chapter that is
403+
represented in that file, like
404+
----
405+
[[cha:filename]]
406+
----
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+
--
411411
* anchors for titles and other blocks
412-
413-
If a chapter/section header shall be granted the option to be
414-
referenced from another part of the documentation then it needs an achor.
415-
The anchor shall be a combination of an indicator of the kind
416-
of block that is referenced (cha,sec,fig,tab,...) together with a
417-
short name identifying the object.
412+
+
413+
If a chapter/section header shall be granted the option to be
414+
referenced from another part of the documentation then it needs an achor.
415+
The anchor shall be a combination of an indicator of the kind
416+
of block that is referenced (cha,sec,fig,tab,...) together with a
417+
short name identifying the object.
418418

419419
* index entries for titles and other blocks
420420

0 commit comments

Comments
 (0)