FANDOM


  • With templates, it's easy, just create a /doc page and transclude it.

    Now with a Module, everything under the Module: namespace appears to be code.

    Is there a standard way to document how to use a module, and how to edit the data when there is? The 'most useful' place would be in the code directly, but that's not allowing for pretty documentation.

    Thanks!

      Loading editor
    • in the code. if you want some prettization, you can put the docs on the template or template/doc page. if you have a template for your module, of course. (you supposed to have at least one, just to shorten #invoke: call)

        Loading editor
    • Fngplg wrote:

      you supposed to have at least one, just to shorten #invoke: call

      Ah, I don't have that at the moment; it makes sense though.

      Thanks for the info!

        Loading editor
    • Wikipedia has added /doc support for Modules (see Module:Bananas/doc at Wikipedia), but FANDOM is still running on an old engine, so it doesn't. It is possible FANDOM will inherit that mechanism when it modernizes, but putting documentation in the primary #invoke template is the best way for now.

        Loading editor
    • Ok, so I guess I'll have:

      • Template:Infobox pet which will contain the 'invoke' part
      • Module:Pets which will be invoked by Template:Infobox pet and contain the code that will produce the 'infobox string'
      • Module:Pets/data which will contain the data, and describe how to edit the data
      • Template:Infobox pet/implementation which will contain the actual infobox XML
      • Template:Infobox pet/doc which will describe all of this
      • A call to {{Infobox pet|{{PAGENAME}}}} on each of the 38 pet pages...

      Lots of parts!

      This is the site on which I work.

        Loading editor
    • I would just add the Module:Pets documentation to Template:Infobox pet/doc.

        Loading editor
    • Yeah, I think I'll still add a small intro there (on Module:Pets), and redirect the user to read the /doc page.

      It's pretty much all there already but hidden (for now), I'm waiting a bit as I have a couple of things to still figure out.

      Thanks!

        Loading editor
    • Hunter789 wrote:

      Yeah, I think I'll still add a small intro there (on Module:Pets), and redirect the user to read the /doc page.

      Excellent idea.

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.