Documentation: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) (obsolete) |
(→{{header|D}}: add crystal's docs tool as a solution) |
||
Line 251:
CL-USER 88 > (documentation 'person 'type)
"the person class"
=={{header|Crystal}}==
The Crystal compiler comes with the <code>crystal docs</code> tool, which generates documentation from markdown embedded in source comments. The language's [https://crystal-lang.org/reference/conventions/documenting_code.html reference] goes into detail about the intricacies of the tool
<lang ruby># Any block of comments *directly* before (no blank lines) a module, class, or method is used as a doc comment
# This one is for a module
module Documentation
# This comment documents a class, *and* it uses markdown
class Foo
# This comment doesn't do anything, because it isn't directly above a module, class, or method
# Finally, this comment documents a method
def initialize
end
end
end</lang>
=={{header|D}}==
|