You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-21Lines changed: 28 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ RobotCDocs is a tool developed for the purpose of attaching descriptions to user
13
13
14
14
## What it can do
15
15
### Scan / Parse Files
16
-
RobotCDocs recursively searches for any header files in a directory. Each individual header file will be scanned for comments detailing a declaration of a function or variable, like so:
16
+
RobotCDocs recursively searches for any header (.h) or source (.c) files in a directory. Each individual header file will be scanned for comments detailing a declaration of a function or variable, like so:
17
17
18
18
FooLibrary / Foo.h -
19
19
@@ -36,13 +36,13 @@ RobotCDocs recursively searches for any header files in a directory. Each indivi
36
36
37
37

38
38
39
-
### Flag Setup Functions / Variables
40
-
Have setup functions or variables? By simply typing `[SETUP]` in any comment, the function or variable will be listed under `Setup`.
39
+
### Custom Naming Schemes
40
+
By default, the documentation of a declaration will be listed under its file's name. This is seen in the above example, where Foo(parameter) is listed under the _Foo_ category. You can change the category of a declaration with the addition of `@`. In the code below, the addition of `@setup` means that the declaration will be listed under _Setup_, no matter what file it's in. As you can see, `setup` is automatically capitalized to `Setup`.
41
41
42
42
FooLibrary / Foo.h -
43
43
44
44
/*
45
-
* [SETUP]
45
+
* @setup
46
46
*
47
47
* Very important setup function.
48
48
*/
@@ -54,24 +54,22 @@ Have setup functions or variables? By simply typing `[SETUP]` in any comment, th
54
54
## How it works
55
55
RobotC's function library descriptions are located in a file called `BuiltInVariables.txt` that get parsed at runtime. The contents of this file are the functions and variables you see in the function library of RobotC.
56
56
57
-
RobotCDocs allows you to add descriptions to any function or variable by writing the definition of it directly into `BuiltInVariables.txt`. The format of this function definition is similar to CSV. An example is included below. (You won't have to write at all in this dirty format, RobotCDocs does it for you)
57
+
RobotCDocs allows you to add descriptions to any function or variable by writing the definition of it directly into `BuiltInVariables.txt`. The format of this function definition is similar to CSV. Here's a sample output of what RobotCDocs adds to `BuiltInVariables.txt`:
58
58
59
59
Battery & Power Control, Variables, V2, feat_NaturalLanguageInActive, noFeatRest, F, A, BackupBatteryLevel //Returns the current voltage level of the VEX
60
60
61
61
62
62
## How to use
63
-
Using RobotCDocs is as easy as editing `setup.txt` and running `main.py`.
64
-
65
-
### Editing setup.txt
63
+
### Configuring setup.txt
66
64
In `setup.txt`, you have to write your desired library name and a directory to be scanned:
67
65
68
66
> Library Name
69
67
[Desired Library Name]
70
68
71
-
> Where to look for files
69
+
> Where to look for documentation files
72
70
[Path to folder containing header files]
73
71
74
-
> Where to find BuiltInVariables.txt
72
+
> Where to output BuiltInVariables.txt
75
73
[Path to RobotC folder containing BuiltInVariables.txt]
76
74
77
75
@@ -80,10 +78,10 @@ __Example__:
80
78
> Library Name
81
79
Diego's Custom Library
82
80
83
-
> Where to look for files
81
+
> Where to look for documentation files
84
82
C:\Users\user\Desktop\FooDocs
85
83
86
-
> Where to find BuiltInVariables.txt
84
+
> Where to output BuiltInVariables.txt
87
85
C:\Program Files (x86)\Robomatter Inc\ROBOTC Development Environment 4.X\Includes
88
86
89
87
@@ -93,30 +91,39 @@ __Example__:
93
91
94
92
95
93
### Running main.py
96
-
RobotCDocs has only been tested on Windows 10, and was written with python 3.7. To run in the console, simply type `python main.py` inside the root directory (assuming you installed python on your PATH). If unclear errors appear, be sure to report it in the issue tracker.
94
+
RobotCDocs has only been tested on Windows 10, and was written with python 3.7. To run in the console, simply type `python main.py` inside the root directory (assuming you installed python on your PATH).
97
95
98
96
99
97
### Format of Comments
100
-
101
-
Each header file should have a multi-line comment detailing the contents of the file. This is __required__. The name of the file listed inside it will hold all the functions and declarations
98
+
RobotCDocs only parses multiline comments that precede a declaration of a function, and have an asterisk detailing the contents, such as below:
102
99
103
100
/*
104
-
* Foo.h
101
+
* @Foo
105
102
*
106
103
* Here goes my description!
104
+
* Here goes another sentence!
107
105
*/
106
+
void NameOfFunction(); // Should be close to comment
108
107
109
-
As seen above, RobotCDocs only accepts multi-line comments that start each line with an asterisk with a space on each side. These comments should appear right above function or variable declarations.
108
+
Multiline comments that aren't preceding a declaration of a function or variable will be ignored, and a warning will be printed to the console. Same holds true for lines that don't have an asterisk, or don't have the correct number of spaces in them.
110
109
111
110
/*
112
-
* Here goes my description!
111
+
* Foo.h
112
+
*
113
+
* This won't be parsed by RobotCDocs!
113
114
*/
114
-
void NameOfFunction(); // Should be close to comment
115
+
116
+
/*
117
+
* This line will be parsed.
118
+
This line won't be parsed.
119
+
* This line won't be parsed.
120
+
*/
121
+
task main();
115
122
116
-
If the function should be listed under `Setup`, it should be formatted like so:
123
+
Like previously mentioned, declarations with a custom category should have the name of the category right beside a `@`.
0 commit comments