DartDoc is the official documentation generator for Dart. It creates static HTML pages from specially formatted comments in the code, making it easy to generate and browse project documentation.
To create DartDoc-friendly comments, use triple slashes (///
) or block comments (/** ... */
).
Example:
/// This class handles user authentication.
class AuthManager {
/// Logs in a user with [email] and [password].
/// Returns a user token if successful.
Future<String> login(String email, String password) async {
// Implementation
}
}
Run the following command in your project directory:
dart doc .
This will create a doc/
folder containing the HTML documentation.
The GitLab CI/CD pipeline is set to trigger documentation deployment only on commits pushed to branches named sprint-*
.
Ensure you commit to one of these branches to update the GitLab Pages site automatically.