Skip to content

Commit 07ea260

Browse files
Update README.md
1 parent 373cdf4 commit 07ea260

File tree

1 file changed

+28
-21
lines changed

1 file changed

+28
-21
lines changed

README.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RobotCDocs is a tool developed for the purpose of attaching descriptions to user
1313

1414
## What it can do
1515
### 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:
1717

1818
FooLibrary / Foo.h -
1919

@@ -36,13 +36,13 @@ RobotCDocs recursively searches for any header files in a directory. Each indivi
3636

3737
![Preview Image](/Images/Foo_Image.png)
3838

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`.
4141

4242
FooLibrary / Foo.h -
4343

4444
/*
45-
* [SETUP]
45+
* @setup
4646
*
4747
* Very important setup function.
4848
*/
@@ -54,24 +54,22 @@ Have setup functions or variables? By simply typing `[SETUP]` in any comment, th
5454
## How it works
5555
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.
5656

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`:
5858

5959
Battery & Power Control, Variables, V2, feat_NaturalLanguageInActive, noFeatRest, F, A, BackupBatteryLevel //Returns the current voltage level of the VEX
6060

6161

6262
## 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
6664
In `setup.txt`, you have to write your desired library name and a directory to be scanned:
6765

6866
> Library Name
6967
[Desired Library Name]
7068

71-
> Where to look for files
69+
> Where to look for documentation files
7270
[Path to folder containing header files]
7371

74-
> Where to find BuiltInVariables.txt
72+
> Where to output BuiltInVariables.txt
7573
[Path to RobotC folder containing BuiltInVariables.txt]
7674

7775

@@ -80,10 +78,10 @@ __Example__:
8078
> Library Name
8179
Diego's Custom Library
8280

83-
> Where to look for files
81+
> Where to look for documentation files
8482
C:\Users\user\Desktop\FooDocs
8583

86-
> Where to find BuiltInVariables.txt
84+
> Where to output BuiltInVariables.txt
8785
C:\Program Files (x86)\Robomatter Inc\ROBOTC Development Environment 4.X\Includes
8886

8987

@@ -93,30 +91,39 @@ __Example__:
9391

9492

9593
### 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).
9795

9896

9997
### 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:
10299

103100
/*
104-
* Foo.h
101+
* @Foo
105102
*
106103
* Here goes my description!
104+
* Here goes another sentence!
107105
*/
106+
void NameOfFunction(); // Should be close to comment
108107

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.
110109

111110
/*
112-
* Here goes my description!
111+
* Foo.h
112+
*
113+
* This won't be parsed by RobotCDocs!
113114
*/
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();
115122

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 `@`.
117124

118125
/*
119-
* [SETUP]
126+
* @setup
120127
*
121128
* Here goes my description!
122129
*/

0 commit comments

Comments
 (0)