/docgen

A simple script to generate markdown documentation from C source code

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Docgen

A simple python script to generate markdown documentation from C source code

Usage

The program takes a single argument, the path to the input file. The generated documentation will be printed to stdout.

python3 main.py <input file>

If you want to write the output to a file you can run. This will write the output to the file specified by <output file>.

python3 main.py <input file> > <output file>

Example

The following example shows the input file and the generated documentation.

/**
 * Test file for docgen.
 * @description: This is a test file for docgen.
 * @file: test.c
 * @version: 1.0
 * @author: John Doe
 * @date: 2012-01-01
 * @license: GPL
 * @see: http://www.gnu.org/licenses/gpl.html
*/

#include <stdio.h>
#include <stdlib.h>

/**
 * Test function.
 * @description: This is a test function.
 * @param: a: This is a test parameter.
 * @param: b: This is a test parameter.
 * @return: This is a test return value.
*/
int test(int a, int b)
{
    return a + b;
}

/**
 * Main function.
 * @description: This is a main function.
 * @param: argc: This is a test parameter.
 * @param: argv: This is a test parameter.
 * @return: This is a test return value.
*/
int main(int argc, char *argv[])
{
    int a = 1;
    int b = 2;
    int c = test(a, b);
    printf("c = %d", c);
    return 0;
}
# Test file for docgen.
description: This is a test file for docgen.

file: test.c

version: 1.0

author: John Doe

date: 2012-01-01

license: GPL

see: http://www.gnu.org/licenses/gpl.html

```c
#include <stdio.h>
```
## Test function.
description: This is a test function.

### Parameters
* a: This is a test parameter.
* b: This is a test parameter.
### Return value
This is a test return value.
```c
int test(int a, int b)
```
## Main function.
description: This is a main function.

* argc: This is a test parameter.
* argv: This is a test parameter.
### Return value
This is a test return value.
```c
int main(int argc, char *argv[])
```

Licence

This project is licensed under the General Public Licence version 3.0. See the LICENCE file for more information.