summaryrefslogtreecommitdiffstats
path: root/docs/doc-system.md
diff options
context:
space:
mode:
authorMatthew Moulton <30711895+mmoult@users.noreply.github.com>2024-06-07 10:47:17 -0500
committerGitHub <noreply@github.com>2024-06-07 08:47:17 -0700
commit78d34f3b3cec6222f87fc69eddfe66f3fc91b1cf (patch)
tree3e3b2596e401c722de7c84b1e35a923d2051d0a7 /docs/doc-system.md
parent7c6faf62158eed309f01bbef8a7b88e0c36459c7 (diff)
Improve documentation and example formatting consistency (#4299)
* Improve doc and example consistency Improve consistency of formatting in example shaders and remove trailing spaces in documentation files. Fix minor typos.
Diffstat (limited to 'docs/doc-system.md')
-rw-r--r--docs/doc-system.md34
1 files changed, 17 insertions, 17 deletions
diff --git a/docs/doc-system.md b/docs/doc-system.md
index 1b331117c..56635e4ed 100644
--- a/docs/doc-system.md
+++ b/docs/doc-system.md
@@ -1,4 +1,4 @@
-Slang Doc System
+Slang Doc System
================
Slang contains a rudimentary documentation generation system. The mechanism used to mark up source is similar to [doxygen](https://www.doxygen.nl/manual/docblocks.html). Namely
@@ -7,24 +7,24 @@ Slang contains a rudimentary documentation generation system. The mechanism used
/**
... text ... (JavaDoc style)
*/
-void someFunctionA() {}
-
+void someFunctionA() {}
+
/*!
.. text .. (QT style)
another line
- */
-void someFunctionB() {}
-
+ */
+void someFunctionB() {}
+
/// ... text ... (Multi line)
/// another line
void someFunctionC() {}
-
+
//!... text ... (QT Multi line)
//! another line
void someFunctionD() {}
-
+
```
-
+
All of the above examples will add the documentation for the declaration that appears after them. Also note that this slightly diverges from doxygen in that an empty line before and after in a multi line comment is *not* required.
We can also document the parameters to a function similarly
@@ -32,8 +32,8 @@ We can also document the parameters to a function similarly
```
/// My function
void myFunction(
- /// The A parameter
- int a,
+ /// The A parameter
+ int a,
/// The B parameter
int b);
```
@@ -43,12 +43,12 @@ If you just need a single line comment to describe something, you can place the
```
/// My function
-void myFunction( int a, //< The A parameter
+void myFunction( int a, //< The A parameter
int b) //< The B parameter
{}
```
-This same mechanisms work for other kinds of common situations such as with enums
+This same mechanisms work for other kinds of common situations such as with enums
```
/// An enum
@@ -69,7 +69,7 @@ enum AnEnum
{
Value, ///< A value
///< Some more information about `Value`
-
+
/// Another value
/// With a multi-line comment
AnotherValue,
@@ -79,9 +79,9 @@ enum AnEnum
-To actually get Slang to output documentation you can use the `-doc` option from the `slangc` command line, or pass it in as parameter to `spProcessCommandLineArguments` or `processCommandLineArguments`. The documentation is currently output by default to the same `ISlangWriter` stream as diagnostics. So for `slangc` this will generally mean the terminal/stderr.
+To actually get Slang to output documentation you can use the `-doc` option from the `slangc` command line, or pass it in as parameter to `spProcessCommandLineArguments` or `processCommandLineArguments`. The documentation is currently output by default to the same `ISlangWriter` stream as diagnostics. So for `slangc` this will generally mean the terminal/stderr.
-Currently the Slang doc system does not support any of the 'advanced' doxygen documentation features. If you add documentation to a declaration it is expected to be in [markdown](https://guides.github.com/features/mastering-markdown/).
+Currently the Slang doc system does not support any of the 'advanced' doxygen documentation features. If you add documentation to a declaration it is expected to be in [markdown](https://guides.github.com/features/mastering-markdown/).
Currently the only documentation style supported is a single file 'markdown' output. Future versions will support splitting into multiple files and linking between them. Also future versions may also support other documentation formats/standards.
@@ -93,7 +93,7 @@ slangc -doc -compile-stdlib
The documentation will be written to a file `stdlib-doc.md`.
-It should be noted that it is not necessary to add markup to a declaration for the documentation system to output documentation for it. Without the markup the documentation is going to be very limited, in essence saying the declaration exists and other aspects that are available from the source. This may not be very helpful. For this reason and other reasons there is a mechanism to control the visibility of items in your source.
+It should be noted that it is not necessary to add markup to a declaration for the documentation system to output documentation for it. Without the markup the documentation is going to be very limited, in essence saying the declaration exists and other aspects that are available from the source. This may not be very helpful. For this reason and other reasons there is a mechanism to control the visibility of items in your source.
There are 3 visibility levels 'public', 'internal' and 'hidden'/'private'. There is a special comment that controls visibility for subsequent lines. The special comment starts with `//@` as shown below.