This project uses JSDoc for comprehensive API documentation. The documentation is automatically generated from comments in the source code and provides detailed information about all classes, methods, and functions.
npm installnpm run docsnpm run docs:watchThe generated documentation is organized as follows:
docs/overview.html- Project overview and navigationdocs/index.html- Main JSDoc documentation indexdocs/UIController.html- Main UI controller documentationdocs/FileOperationsManager.html- File operations documentationdocs/TabManager.html- Tab management documentationdocs/SearchManager.html- Search functionality documentationdocs/EditorManager.html- Editor management documentationdocs/NotificationManager.html- Notification system documentation
main.js- Application entry pointipc/fileHandlers.js- File system IPC handlersipc/ctraceHandlers.js- CTrace execution handlersipc/editorHandlers.js- Editor-related handlersutils/fileUtils.js- File system utilities
UIController.js- Main UI coordinatormanagers/- Specialized manager classesutils/- Renderer utilities
/**
* Brief description of the class.
*
* Detailed description explaining the purpose and functionality.
*
* @class ClassName
* @author CTrace GUI Team
* @version 1.0.0
*
* @example
* const instance = new ClassName(param1, param2);
*/
class ClassName {
// ...
}/**
* Brief description of the method.
*
* Detailed description of what the method does.
*
* @async
* @memberof ClassName
* @param {string} param1 - Description of parameter 1
* @param {Object} param2 - Description of parameter 2
* @returns {Promise<Object>} Description of return value
*
* @example
* const result = await instance.methodName('value', {option: true});
*/
async methodName(param1, param2) {
// ...
}/**
* Description of the property
* @type {string}
* @private
*/
this.propertyName = 'value';{
"source": {
"include": ["./src/", "./README.md"],
"includePattern": "\\.(js)$",
"exclude": ["./node_modules/", "./dist/", "./build/"]
},
"opts": {
"destination": "./docs/",
"recurse": true,
"readme": "./README.md"
},
"plugins": ["plugins/markdown"],
"metadata": {
"title": "CTrace GUI Documentation",
"description": "Complete documentation for the CTrace GUI Electron application"
}
}Aim for documentation coverage of:
- ✅ All public classes - Complete with examples
- ✅ All public methods - Parameters, return values, examples
- ✅ Key private methods - Internal functionality
- ✅ Complex algorithms - Detailed explanations
- ✅ Configuration objects - Property descriptions
- Use descriptive summaries - First line should clearly explain the purpose
- Include examples - Show how to use classes and methods
- Document parameters thoroughly - Include types and descriptions
- Explain return values - What does the method return?
- Use @memberof - Clearly associate methods with classes
- Mark async methods - Use @async for Promise-returning methods
- Private vs Public - Use @private for internal methods
- Generate docs:
npm run docs - Open
docs/overview.htmlfor project overview - Open
docs/index.htmlfor complete API documentation - Navigate using the sidebar or search functionality
The documentation is fully self-contained HTML and can be:
- Viewed locally in any web browser
- Hosted on a web server
- Included in project releases
- Shared with team members
When adding new code:
- Add comprehensive JSDoc comments
- Include usage examples where appropriate
- Regenerate documentation:
npm run docs - Verify documentation renders correctly
- Update this guide if needed
Happy documenting! 📚