Jump to content

Documentation: Difference between revisions

Line 1,047:
 
A compiler has a built-in <code>--doc</code> switch that will generate documentation from a given source file.
 
=={{header|Phix}}==
When running Edita/Edix, pressing F1 when on a builtin opens up the expected page in phix.chm.
The latter is painstakingly hand-crafted, and I think all the better for it.<br>
When on an application-specific routine, F1 opens up a window showing the actual definition, titled either
"Locally defined in this source" or fullpath & "[n/m]" with an "Examine code" button to directly edit it.
The "[n/m]" collects all possible (m) routines, as kept on a database of globals maintained via a periodic
background scan, combined with a quick re-scan of the current file, and defaults (n) to the most likely
from the project tree of the last run/file being edited. Pressing F1 again cycles through them.<br>
Ideally any routine-specific comments should be placed within the routine itself, eg (from pmain.e):
<lang Phix>procedure StoreVar(integer N, integer NTyp)
--
-- Store a variable, applying any final operator as needed.
-- If N is zero, PopFactor (ie store in a new temporary variable of
-- the specified type). Otherwise N should be an index to symtab.
-- If storeConst is 1, NTyp is ignored/overridden, otherwise it
-- should usually be the declared or local type of N.
--
...
end procedure</lang>
Note: As I understand it, tools such as Doxygen usually expect their markup to precede the actual definitions.
 
Obviously the above is targetted at programmers, rather than paying application-specific end-users.
 
=={{header|PHP}}==
7,820

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.