Catalog / Tomdoc Cheatsheet
Tomdoc Cheatsheet
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 Basics
General Structure
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. |
Tags
|
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. |
Arguments
List arguments with their descriptions and types.
|
Examples and Returns
Examples
Provide clear examples of how to use the code.
|
Returns
Describe the return value, including its type and meaning.
|
Putting it Together
|
Advanced Tomdoc
Options Hashes
Document options hashes, including keys, types, and descriptions.
|
Yields
Describe what the code yields, including the type of yielded values.
|
Raises
Document any exceptions that may be raised.
|
Signatures and Style
Signatures (for DSLs)
Use signatures to describe the syntax of DSLs.
|
Style Considerations
|
Example of Bad Tomdoc
This is bad because it doesn’t specify argument types and lacks an example |