cmkr icon indicating copy to clipboard operation
cmkr copied to clipboard

Find a way to unify documentation

Open mrexodia opened this issue 3 years ago • 5 comments

Currently the cmkr executable has it's own hardcoded documentation built-in. It would be best if there could be a single source of documentation that is somehow generated into the project to decrease the maintenance burden.

mrexodia avatar May 03 '21 10:05 mrexodia

Maybe we should use Doxygen as an alternative to the old documentation I've made?

I'll analyze the complexity of applying it for the current project state

darknessxk avatar Dec 27 '21 19:12 darknessxk

I've found this if you find this a good alternative and is less harder to maintain in the long run

https://github.com/matusnovak/doxybook2

darknessxk avatar Dec 27 '21 19:12 darknessxk

I don’t think Doxygen will help because it focuses mostly on code-level documentation and this is a more high-level type of documentation that has nothing to do with the code.

I’m still thinking about a design to make the whole toml parsing a declarative system where metadata can then be applied, but honestly it’s not so bad.

For the command line argparse is a small library with a decent help generator so that would solve that need.

mrexodia avatar Dec 27 '21 19:12 mrexodia

I'll check out some other ideas but wrapping our current argument parsing method using some class to generate this info can be a good

Like creating a pattern like this

class CliArgument {
private:
 const char* tag;
 const char* description;
public:
 CliArgument(const char* _tag, const char* _desc): tag(_tag), description(_desc) {}
 
 const char* getTag() { return tag; }
 const char* getDescription() { return description; }
}

CliArgument outputArg { "--output", "File output" };

void ShowHelp() {
  // render all CliArgument tag + description here
}

This can works I think let me know your opinion about it

** This is really abstract idea, so don't think this as a final stuff just a concept

darknessxk avatar Dec 27 '21 22:12 darknessxk

For the argument parsing this library is probably pretty good: https://github.com/Taywee/args#simple-example

Combined with a little cmake to automatically generate the documentation it’s enough for the command line part at least.

mrexodia avatar Dec 28 '21 00:12 mrexodia