ekxide / geoffrey

Syncs source code to markdown code blocks
Apache License 2.0
8 stars 1 forks source link

Remove comments in code snippets #3

Open elfenpiff opened 2 years ago

elfenpiff commented 2 years ago

Most of the time geoffrey is used to explain pieces of code in detail and then additional comments are like a double documentation. Here it would be helpful when geoffrey would ignore the code comments (maybe enabled via some option in the geoffrey markdown line) so that the reader of the markdown file could concentrate on the actual code example alone.

elBoberido commented 2 years ago

I also thought about that. I'm just not sure how to add customization options to the geoffrey tag. Maybe something like this

<!-- [geoffrey] [path/to/source/file] [doxygen snippet annotation] {strip-comments} -->
elfenpiff commented 2 years ago

Yes this looks nice.

elBoberido commented 2 years ago

On a second thought, comments are not that easy since you can also have multi line comments. How about something more generic like

<!-- [geoffrey] [path/to/source/file] [doxygen snippet annotation] {strip "^\s*//"} -->
elfenpiff commented 2 years ago

I like the more generic approach even more!