Generate README.md from inline doc

50 views
Skip to first unread message

Raphaël Pinson

unread,
Mar 17, 2015, 7:04:11 AM3/17/15
to puppe...@googlegroups.com
Hello!


I'd like to generate the README.md of my Puppet modules from modulesync, by getting the docs from the classes themselves.

I've considered using puppet-strings, but I don't really see how I could retrieve markdown from it.

Is there a way I could get markdown from the inline docs in classes/defines using Ruby, so I can include them in my README?



Thanks,

Raphaël

Henrik Lindberg

unread,
Mar 17, 2015, 12:09:57 PM3/17/15
to puppe...@googlegroups.com
Afaik, there is no feature available that extracts the documentation
from source and produces markdown.

The puppet-strings does this internally to extract the documentation
comments from the source. It then feeds this into yard to produce
interactive html pages.

If you want to implement your own tool, you could base it of the
extraction that is done by puppet-strings. It is actually not that
difficult to write a ruby snippet that parses a .pp file (with the
future parser) and extracts documentation.

I can imagine accepting a PR with a command that extracts text from source.

Note that puppet-strings requires that the source can be parsed
with the future parser.

Regards
- henrik

>
> Thanks,
>
> Raphaël
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-dev+...@googlegroups.com
> <mailto:puppet-dev+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-dev/26e8c57e-f6c5-49ea-ad8c-7ece042b8ffd%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-dev/26e8c57e-f6c5-49ea-ad8c-7ece042b8ffd%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Raphaël Pinson

unread,
Mar 17, 2015, 12:34:53 PM3/17/15
to puppe...@googlegroups.com
Thanks for the answer Henrik. That is kind of what it looked to me.

I think if I have to go this way, i'll probably make a gem for this, since that would be easier to plug into modulesync than a Puppet module actually.

Henrik Lindberg

unread,
Mar 17, 2015, 1:47:17 PM3/17/15
to puppe...@googlegroups.com
On 2015-17-03 17:34, Raphaël Pinson wrote:
> Thanks for the answer Henrik. That is kind of what it looked to me.
>
> I think if I have to go this way, i'll probably make a gem for this,
> since that would be easier to plug into modulesync than a Puppet module
> actually.
>
>
Note that puppet-strings will be available as a gem as well.
Reply all
Reply to author
Forward
0 new messages