Quellcode durchsuchen

docs: created new documentation.md

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Mihai Tudor Panu vor 9 Jahren
Ursprung
Commit
9dcef6d7bb
3 geänderte Dateien mit 85 neuen und 21 gelöschten Zeilen
  1. 2
    0
      README.md
  2. 6
    21
      docs/contributions.md
  3. 77
    0
      docs/documentation.md

+ 2
- 0
README.md Datei anzeigen

@@ -45,6 +45,8 @@ Before you begin development, take a look at our @ref naming [conventions](docs/
45 45
 
46 46
 Also, please read the guidelines for @ref contributions [to UPM](docs/contributions.md).
47 47
 
48
+Don't forget to check the @ref documentation [section](docs/documentation.md).
49
+
48 50
 Make sure you add yourself as an author on every new code file submitted.
49 51
 If you are providing a fix with significant changes, feel free to add yourself
50 52
 as a contributor. Signing-off your commits is mandatory.

+ 6
- 21
docs/contributions.md Datei anzeigen

@@ -2,35 +2,20 @@ Contributing a module                         {#contributions}
2 2
 =====================
3 3
 
4 4
 Here are the rules of contribution:
5
-- Your module must have an example that builds against your UPM library
6
-- Commits must have a sign-off line by everyone who reviewed them
7
-- Commits must be named <file/module>: Some decent description
5
+- Your new module must have an example that builds against your UPM library.
6
+- Commits must have a sign-off line by everyone who reviewed them.
7
+- **Commits must be named <file/module>: Some decent description.**
8 8
 - You must license your module under a FOSS license. The recommended license
9 9
   is MIT but any permissive license is fine. Please consider that people using
10 10
   UPM may want to write proprietary programs with your sensors so we like to
11 11
   avoid GPL. (LGPL is fine). If your license is not MIT please include a
12
-  LICENSE file in src/mymodule/
12
+  LICENSE file in src/mymodule/.
13 13
 - Please test your module builds before contributing and make sure it works on
14 14
   the latest version of mraa. If you tested on a specific board/platform please
15 15
   tell us what this was in your PR.
16 16
 - Try not to break master. In any commit.
17
-- Attempt to have some decent API documentation below are the explicit rules on documentation:
18
-
19
-Documentation
20
-=============
21
-
22
-- Try to have no warnings in doxygen, this is generally fairly easy
23
-- Have the specific sensor manufacturer/model & version that you used, if you
24
-  support multiple versions please list
25
-- Comments do not need full stops
26
-- Stick to <80 chars per line even in comments
27
-- No text is allowed on the same line as the start or end of a comment /** */
28
-- All classes should have a "@brief" and a "@snippet"
29
-
30
-The example should have an 'Interesting' section which will be highlighted as a
31
-code sample in doxygen.  Everything in between such tags will show up in the
32
-class documentation when the following is put at the end of a class docstring
33
-as show above.
17
+- Attempt to have some decent API documentation as described in the the @ref
18
+  documentation [guide](documentation.md).
34 19
 
35 20
 Code signing
36 21
 ============

+ 77
- 0
docs/documentation.md Datei anzeigen

@@ -0,0 +1,77 @@
1
+Writing sensor documentation                        {#documentation}
2
+=====================
3
+
4
+It is highly encouraged to provide at least some basic documentation for the
5
+sensors that you want to add to UPM:
6
+
7
+- Try to have no warnings in doxygen, this is generally fairly easy.
8
+- Have the specific sensor manufacturer/model & version that you used, if you
9
+  support multiple versions please list.
10
+- Simple comments do not need full stops
11
+- Stick to <80 chars per line even in comments
12
+- No text is allowed on the same line as the start or end of a comment /** */
13
+
14
+New libraries must have the "@brief", "@defgroup" and "@ingroup" tags in one
15
+block. This usually follows the namespace and it is common to have one sensor
16
+per library.
17
+
18
+Here's how this looks:
19
+
20
+```
21
+@verbatim
22
+/**
23
+ * @brief Short description for entire library
24
+ * @defgroup <name> <libupm-name>
25
+ * @ingroup <manufacturer> <connection type> <sensor category> (<addl group>)
26
+ */
27
+@endverbatim
28
+```
29
+
30
+If you have multiple classes or sensors per library, only use the "@ingroup"
31
+tags that are common for all of them.
32
+
33
+All classes should then have a "@brief", "@ingroup" and "@snippet". For single
34
+sensor libraries this block can follow immediately after the one above like in
35
+this example:
36
+
37
+```
38
+@verbatim
39
+/**
40
+ * @brief Short class/sensor description
41
+ *
42
+ * Then add a longer
43
+ * description here.
44
+ *
45
+ * @ingroup <name> (<addl group>)
46
+ * @image html <name.jpeg>
47
+ * @snippet <name.cxx> Interesting
48
+ */
49
+@endverbatim
50
+```
51
+
52
+Libraries with multiple sensors can add specific "@ingroup" tags here, but make
53
+sure that the first one is the "<name>" specified in the library "@defgroup"
54
+tag. An example of such a library for reference is our libupm-i2clcd.
55
+
56
+Optionally, a small representative image can be placed in the "docs/images"
57
+subfolder. **Please do not use existing, copyrighted images with your sensors!**
58
+
59
+The example should have an 'Interesting' section which will be highlighted as
60
+a code sample in doxygen. Everything in between such tags will show up in the
61
+class documentation when "@snippet" is added at the end of a class docstring.
62
+Tags use this format:
63
+
64
+```
65
+@verbatim
66
+ //! [Interesting]
67
+
68
+    ...example code here...
69
+
70
+ //! [Interesting]
71
+@endverbatim
72
+```
73
+
74
+Existing groups that can be used for the manufacturer, connection and category
75
+tags are found in the src/upm.h file.
76
+
77
+For more examples take a look at the existing headers in our github repository.