Open jgvictores opened 6 years ago
Do you by chance mean that those huge chunks of how-to-use comments like this (usually located in the app's main.cpp
) should be moved to a .md file?
I refer to that type of movement, but rather than a suggestion, it is a question.
IMHO, the pros are:
What is your opinion? Maybe there is an option to link md via relative paths?
Personally I prefer md because of these reasons:
On the other hand, it has some cons:
My personal opinion: I only like Doxygen for documenting APIs, classes, etc. For any other doc info I prefer markdown because of the simplexity of the syntax yet beautiful syntax. :)
Sorry for my late response. I'm getting increasingly convinced that MD might be a nice replacement for long, unwieldy Doxygen doc files. We have a bunch of them scattered around asibot-main (see doc.dox). The syntax is rather obscure and lacks GitHub editor support (which is essentially a WYSIWYG markdown text editor).
dox: autogeneration of link pages (avoiding hard-coded to master/develop like here).
@jgvictores I think that relpaths could work there, try programs/openraveToStl
(or /programs/openraveToStl
, or ./programs/openraveToStl
).
Another remark: developers should feel impelled to keep their app documentation synced with any related change they commit. Doc files buried far from the source code or even a cumbersome syntax (with lack of editor support, as noted before) may lead to a situation in which devs either simply forget about the existence of related documentation or feel uncomfortable to edit those few lines. A clean workflow, stating what needs to be done before commiting (reflect changes in docs, update release notes, etc.), should follow from these considerations. Outdated documentation is evil. Compare YARP's CONTRIBUTING.md.
@jgvictores I think that relpaths could work there, try
programs/openraveToStl
(or/programs/openraveToStl
, or./programs/openraveToStl
).
@PeterBowman Correct, fixed at https://github.com/roboticslab-uc3m/tools/commit/567a8f7c0b21bf7a86c11331a8616e2b181fdfb9
I believe we haven't provided options on how to perform this migration. Going to check out: https://www.npmjs.com/package/doxygen2md
I believe we haven't provided options on how to perform this migration. Going to check out: https://www.npmjs.com/package/doxygen2md
Looks good!, at least to deserve a try!
Bad thing is it's not direct like Pandoc. Steps are using Doxygen to create an XML, then apply it. Alternatives I've seen are similar. Let's keep looking.
Refs of different ways we do and link things:
Would be nice to be able to link, e.g:
Cannot find a quick and easy way to do this.
To sum up: we prefer .md
for most situations, except existing .dox
which just set up entry point and groups.
README.md
per-folder.README.md
files.Do once: Set Doxygen up to generated documentation to link to GitHub URL of new README.md files.
I've set up a dox
target in project-generator and install rules that also take care of proper packaging. That is, you run make dox
and make package
, then CMake and CPack generate HTML docs and pack them for proper distribution. We can't achieve this if relying on URLs. Proposal: convert Markdown files (which are suitable for GH and online viewing) into an exportable markup and generate convenient install and packaging rules. Might be a long-term task.
Oh. Something like pandoc
to locally convert from .md
to .html
could be interesting. :+1:
Note: Doxygen supports Markdown! (reference)
Markdown support was introduced in doxygen version 1.8.0. It is a plain text formatting syntax written by John Gruber, with the following underlying design goal:
Also: Doxygen allows tranclusion (\include
command), while Markdown doesn't.
Edit: only partial support, i.e. links to local raw HTML files or HTMLs served remotely (full URLs). No transclusion.
Since \includedoc isn't parsed on time, very tempted to pre-process as in https://stackoverflow.com/questions/7857726/sed-replace-backslash-in-include
Idea: pass a path to a script in INPUT_FILTER
or FILTER_PATTERNS
(Doxyfile options) in order to replace a placeholder text inlined in .h docs with the actual MD file contents. Problem (see bolded text):
The
INPUT_FILTER
tag can be used to specify a program that doxygen should invoke to filter for each input file. Doxygen will invoke the filter program by executing (viapopen()
) the command:<filter> <input-file>
where<filter>
is the value of theINPUT_FILTER
tag, and<input-file>
is the name of an input file. Doxygen will then use the output that the filter program writes to standard output. IfFILTER_PATTERNS
is specified, this tag will be ignored. Note that the filter must not add or remove lines; it is applied before the code is scanned, but not when the output code is generated. If lines are added or removed, the anchors will not be placed correctly. Note that for custom extensions or not directly supported extensions you also need to setEXTENSION_MAPPING
for the extension otherwise the files are not properly processed by doxygen.
Reference: http://doxygen.nl/manual/config.html#cfg_input_filter.
Yes, I'm also concerned about those bold words.
Simple commands such as INPUT_FILTER = "sed s/FROM/TO/"
work.
Maybe awk
would be better than sed
.
Before I forget: http://doxygen.10944.n7.nabble.com/input-filter-woes-td2056.html
It looks like in general sed
and \n
are not big friends: https://askubuntu.com/questions/603096/replace-string-with-multiline-file-content
Just found a tool similar to Doxygen (can't tell the difference): https://github.com/copperspice/doxypress
There is a nice intermix of Markdown and Doxygen capabilities in libraries/YarpCloudUtils/README.md@vision. Even though the document has been written in Markdown, Doxygen is perfectly capable of coping well with it: doxy page. Note that documented classes and functions are automatically linked by Doxygen in text and code snippets. It is also trivial to link back to this page from usual doxy lines, see note.
YARP is moving towards a deeper integration between Markdown and Doxygen. This patchset esentially migrates a .dox into an .md and adds several Doxygen-like commands (\snippet
, \subpage
, \ref
) throughout those .md files to perform transclusion at the Doxygen level. The documentation is not fully functional on the Markdown side, yet it seems to combine the best of the two worlds.
Program documentation: