Skip to main content

automate documentation of c projects

Project description

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 for what the below example would produce.

// 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdox-1.0.5.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file cdox-1.0.5.tar.gz.

File metadata

  • Download URL: cdox-1.0.5.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for cdox-1.0.5.tar.gz
Algorithm Hash digest
SHA256 c4548c44585f28ce5f6044f414e071ed283c23f9c4a316d35e073afdbdaebbfd
MD5 aa77235fbd8b2b1948a7871348fa3bf7
BLAKE2b-256 a4d71f360c18ba3bb81b200e290fff8dbc6d23f10979f79df634f36775bb750c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page