Tomdoc uses a simple structure to document code:
- Public: or Internal: tag
- A description of what the code does.
- Arguments (if any).
- Examples (if applicable).
- Return value.
A concise cheat sheet for Tomdoc, a documentation style emphasizing clarity through simple conventions. This guide covers syntax, tags, and best practices for generating understandable and maintainable documentation.
Tomdoc uses a simple structure to document code:
|
The key is to keep it concise and focused on what the code does, not how it does it. |
|
Indicates the method or class is part of the public API and intended for external use. |
|
Indicates the method or class is for internal use only and not part of the public API. |
|
Marks the method as deprecated, optionally including information about alternatives. |
List arguments with their descriptions and types.
|
Provide clear examples of how to use the code.
|
Describe the return value, including its type and meaning.
|
|
Document options hashes, including keys, types, and descriptions.
|
Describe what the code yields, including the type of yielded values.
|
Document any exceptions that may be raised.
|
Use signatures to describe the syntax of DSLs.
|
|
This is bad because it doesn’t specify argument types and lacks an example |