https://github.com/breakthatbass/cdox
documentation generator for generating C API docs in markdown format
https://github.com/breakthatbass/cdox
automation c documentation-generator python
Last synced: 2 months ago
JSON representation
documentation generator for generating C API docs in markdown format
- Host: GitHub
- URL: https://github.com/breakthatbass/cdox
- Owner: breakthatbass
- License: mit
- Created: 2021-09-24T23:26:14.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-03-07T13:47:17.000Z (over 4 years ago)
- Last Synced: 2026-01-04T19:28:53.496Z (6 months ago)
- Topics: automation, c, documentation-generator, python
- Language: Python
- Homepage:
- Size: 53.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cdox
A script to automate documentation of your C APIs in markdown format.
`cdox` reads in a source code file creates documentation based on the comments. it's sort of like doxygen but simpler and creates a markdown file.
## Usage
```
cdox infile outfile
```
## Installation
```
pip install cdox
```
## Rules
**cdox keywords:**
- `@name:` name of documentation.
- `@description:` description of file documentation.
- `@desc:` a description of a function.
- `@param:` a bullet point for info on a function paramter.
- `@return:` a bullet point for what the function returns.
**rules:**
- the keywords must be in multiline comments.
- the multiline comments must start with `/* *` and end with `* */` each on their own line.
- the function name/protoype must be on the line following the `* */`
## Example Usage
Check out [`example.md`](https://github.com/breakthatbass/cdox/blob/main/example.md) for what the [`test.c`](https://github.com/breakthatbass/cdox/blob/main/tests/test.c) excerpt below would produce.
#
```C
// test.c
/* *
* strncmp
*
* @desc: compare two strings up to `n` characters.
*
* @param: `s1` - a char array of at least one char.
* @param: `s2` - a char array of at least one char.
* @param: `n` - the number of chars to compare of each string.
*
* @return: 0 if strings are the same else a non-zero int.
* */
int strncmp(const char *s1, const char *s2, int n)
{
while(n > 0 && *s1 == *s2++) {
if(*s1++ == '\0')
return 0;
n--;
}
return (n == 0 ? 0 : *s1 - *--s2);
}
```
## todo
- add feature to allow making section headers
- add @global keyword for documentation of global variables