szaghi / FLAP

Fortran command Line Arguments Parser for poor people
151 stars 34 forks source link

Write markdown pages in the same way as manpages #59

Closed ollehellman closed 7 years ago

ollehellman commented 8 years ago

Hi,

I added an ugly fix that gives you a

call cli%save_usage_to_markdown('somefile.md')

that is, takes all the command line options and saves them to a markdown page. In a similarly hackish fashion, I joined that with FORD to generate nicely formatted documentation on the fly. The results look something like this:

screen shot 2016-04-02 at 00 10 47

Which I think is quite nice. Write documentation once, and get it everywhere. The drawback is that to make it truly nice it will have to increase complexity of FLAP. One would really like to be able to add things as

call cli%add(switch='--foo',help='some plain text [link](blabla)')

to the help. This will obviously break the actual command line interface and the manpages, but will be useful for the online documentation. Something like

call cli%add(switch='--foo',help='some plain text',mdhelp='md formatted text with a [link](something)')

where the extra optional tag will only get added to the markdown-help.

Personally, I really like this option. Does it sound interesting? I have it implemented and pretty much working, but perhaps not as sophisticated and general as it should be. The reason I ask is that it adds a layer of complexity that might not be desired.

Is this something you might be interested in?

szaghi commented 8 years ago

@ollehellman wonderful idea! I am absolutely interested to. If you have already implementd it I will happy to accept it or (my preferred option) I can add you as another main developer of this repo so you can directly push your patch here!

The extra complexity does not hurt me, this feature is worth to be implemented. Monday I can look at your patch.

Thank you very much!

victorsndvg commented 8 years ago

:+1: Great idea!

szaghi commented 7 years ago

@ollehellman I forget to tell you that your great patch was merged into master branch! I have to write some doc about it... I am closing this issue. Thank you again for your help!