document module with YARD in separate file

asked 2017-01-08 15:56:33 -0600

updated 2017-01-09 18:20:50 -0600

How do I get the YARD rendered from another file?

# name: foo
# desc: blub
# auth: me

# two blank lines in front of docstring+class for YARD

# {include:file:yrd/init.yrd}
class foo (
  String $bar = undef,
) {

And init.yrd looks like this:

# name: foo YARD documentation
# auth: me

@param bar does cool stuff
  @example some badass example


Doing a puppet strings generate manifests/init.pp generates the documentation, but the included file is included verbatim. The @param reference and everything still stays there. If I'd copy the whole documentation into init.pp, too, the YARD-tags are recognized, but I want the class documentation to go separately. I hardly want 800 lines of documentation in front of my 400 line class. It's already big enough!

edit retag flag offensive close merge delete