Documentation: Difference between revisions

Rename Perl 6 -> Raku, alphabetize, minor clean-up
(→‎{{header|Perl 6}}: Add more info. Also Perl 6 -> Raku.)
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 98:
}
</lang>
 
=={{header|C sharp|C#}}==
This documentation method will work perfectly with the built in object browser in Visual Studio. The object browser can then show detailed information for each component. To make documentation that can be parsed, a triple slash (///) must be used. Further information can be found in [http://aspalliance.com/696 this tutorial]. A list of available xml elements for use in documentation [http://aspalliance.com/696_Code_Documentation_in_NET.2 is here].
 
<lang csharp>/// <summary>
/// The XMLSystem class is here to help handle XML items in this site.
/// </summary>
public static class XMLSystem
{
static XMLSystem()
{
// Constructor
}
 
/// <summary>
/// A function to get the contents of an XML document.
/// </summary>
/// <param name="name">A valid name of an XML document in the data folder</param>
/// <returns>An XmlDocument containing the contents of the XML file</returns>
public static XmlDocument GetXML(string name)
{
return null;
}
}</lang>
 
=={{header|Clojure}}==
Line 245 ⟶ 269:
CL-USER 88 > (documentation 'person 'type)
"the person class"
 
=={{header|C sharp|C#}}==
This documentation method will work perfectly with the built in object browser in Visual Studio. The object browser can then show detailed information for each component. To make documentation that can be parsed, a triple slash (///) must be used. Further information can be found in [http://aspalliance.com/696 this tutorial]. A list of available xml elements for use in documentation [http://aspalliance.com/696_Code_Documentation_in_NET.2 is here].
 
<lang csharp>/// <summary>
/// The XMLSystem class is here to help handle XML items in this site.
/// </summary>
public static class XMLSystem
{
static XMLSystem()
{
// Constructor
}
 
/// <summary>
/// A function to get the contents of an XML document.
/// </summary>
/// <param name="name">A valid name of an XML document in the data folder</param>
/// <returns>An XmlDocument containing the contents of the XML file</returns>
public static XmlDocument GetXML(string name)
{
return null;
}
}</lang>
 
=={{header|D}}==
Line 512:
 
This view was produced by [[EiffelStudio]] which also supports an '''Interface''' view which is similar to the Contract view above, but also includes contracts for any inherited routines, and the complete inherited class invariant. EiffelStudio can publish these and other documentation view in HTML and other formats suitable for sharing.
 
 
=={{header|Elixir}}==
Line 581 ⟶ 580:
Foo docstring println # prints docstring Foo class
Foo instance_method: 'a_method . docstring println # prints method's docstring</lang>
 
=={{header|Forth}}==
Common comments in the source code is lines starting by "\ " do not forget the space
 
example :
 
<lang>\ this is a comment</lang>
 
Another good practice is describing the stack use of a function : function ( stack before -- stack at end )
 
example :
 
<lang>: cubed ( n -- n^3 ) dup dup * * ; </lang>
 
=={{header|Fortran}}==
Line 611 ⟶ 623:
 
But none of this is within the Fortran language definition itself.
 
=={{header|Forth}}==
Common comments in the source code is lines starting by "\ " do not forget the space
 
example :
 
<lang>\ this is a comment</lang>
 
Another good practice is describing the stack use of a function : function ( stack before -- stack at end )
 
example :
 
<lang>: cubed ( n -- n^3 ) dup dup * * ; </lang>
 
=={{header|FreeBASIC}}==
Line 708 ⟶ 707:
 
(See section "Simple New Command" in the GRI manual.)
 
 
=={{header|Haskell}}==
Line 989 ⟶ 987:
for i in 1..times:
echo "hello world"</lang>
 
=={{header|Objeck}}==
Documentation can be produced for bundles, classes and methods/functions.
 
<lang objeck>#~
Sets the named row value
@param name name
@param value value
@return true of value was set, false otherwise
~#
method : public : Set(name : String, value : String) ~ Bool {
return Set(@table->GetRowId(name), value);
}
</lang>
 
=={{header|Objective-C}}==
Line 1,005 ⟶ 1,017:
return a + b;
}</lang>
 
=={{header|Objeck}}==
Documentation can be produced for bundles, classes and methods/functions.
 
<lang objeck>#~
Sets the named row value
@param name name
@param value value
@return true of value was set, false otherwise
~#
method : public : Set(name : String, value : String) ~ Bool {
return Set(@table->GetRowId(name), value);
}
</lang>
 
=={{header|OCaml}}==
Line 1,030 ⟶ 1,028:
=={{header|Perl}}==
Perl's documentation mechanism is called [http://perldoc.perl.org/perlpod.html POD (Plain Old Documentation)]. Basically, any line that starts with an equal sign followed by a word (e.g. <tt>=head1</tt>) starts a documentation comment; and it lasts until a line that begins with <tt>=cut</tt>. Many formatting commands are recognized; for example, a line beginning with <tt>=item</tt> starts a section for an item, text wrapped in <tt>I< ... ></tt> is italicized, text wrapped in <tt>C< ... ></tt> is formatted as code, etc. See the [http://perldoc.perl.org/perlpod.html perlpod] and [http://perldoc.perl.org/perlpodspec.html perlpodspec] manuals for more details about the format.
 
=={{header|Perl 6}}==
Similarly to Perl 5, Raku is documented using [https://docs.raku.org/language/pod Pod] (a redesigned version of POD). However, it's not simply ignored by the parser as in Perl 5, it's an internal part of the language spec and can be used to attach documentation objects to almost any part of the code.
 
<lang perl6>
#= it's yellow
sub marine { ... }
say &marine.WHY; # "it's yellow"
 
#= a shaggy little thing
class Sheep {
#= not too scary
method roar { 'roar!' }
}
say Sheep.WHY; # "a shaggy little thing"
say Sheep.^find_method('roar').WHY; # "not too scary"</lang>
 
A compiler has a built-in <code>--doc</code> switch that will generate documentation from a given source file. An output format can be specified in the switch. For example, <code>--doc=Markdown</code> will generate Markdown from Pod provided that the <code>Pod::To::Markdown</code> is installed.
 
=={{header|Phix}}==
Line 1,246 ⟶ 1,226:
<tt>scribble/srcdoc</tt> or <tt>scribble/lp</tt> (literate programming)
libraries.
 
=={{header|Raku}}==
(formerly Perl 6)
Similarly to Perl 5, Raku is documented using [https://docs.raku.org/language/pod Pod] (a redesigned version of POD). However, it's not simply ignored by the parser as in Perl 5, it's an internal part of the language spec and can be used to attach documentation objects to almost any part of the code.
 
<lang perl6>
#= it's yellow
sub marine { ... }
say &marine.WHY; # "it's yellow"
 
#= a shaggy little thing
class Sheep {
#= not too scary
method roar { 'roar!' }
}
say Sheep.WHY; # "a shaggy little thing"
say Sheep.^find_method('roar').WHY; # "not too scary"</lang>
 
A compiler has a built-in <code>--doc</code> switch that will generate documentation from a given source file. An output format can be specified in the switch. For example, <code>--doc=Markdown</code> will generate Markdown from Pod provided that the <code>Pod::To::Markdown</code> is installed.
 
=={{header|REBOL}}==
Line 1,615 ⟶ 1,614:
}
}</lang>
 
=={{header|Smalltalk}}==
(Squeak/Pharo)
10,333

edits