Tagging Files

To enable Cartara to generate documentation from your codebase, you’ll need to tag the files you want it to process. Tagging is a simple, lightweight way to indicate which files or sections of code should be included in your documentation. Tags are added as a comment at the top of your code and consist of comma-separated values.

All attributes must appear on a single line and be separated by commas. Required attributes
// @cartara id: [ID], name: [NAME]
Optional attributes
// @cartara id: [ID], name: [NAME], diagramType: [DIAGRAM], context: [CONTEXT], folderId: [FOLDER], spaceId: [SPACE]
Example:
// @cartara id: HF4563S1, name: API Docs, diagramType: component

Using Multiple Files for a Single Document

In most projects, code is distributed across multiple files to maintain structure and readability. Cartara supports this by allowing you to link several related files together and generate a single, cohesive document. This ensures your documentation accurately reflects how your code is organized and functions across modules.

In the primary (or parent) file, add the standard tag as described above. To include additional related files, tag them using the following format:

// @cartara parentId: [PARENT ID]

If your parent file has an id of 123456, you would use that value as the parentId in any additional files you want to associate with the same document. You do not need to add any additional attributes to child tags.


Adding additional context

You may include additional context to enhance your documentation and make it more accurate for your specific use case. For example, if you are generating API documentation intended for internal teams, you could provide context such as:

// @cartara id: HF4563S1, name: API Docs, context: This is for internal teams. Show only API endpoints.

By using this context, Cartara will display only the relevant API endpoints, making them easy for internal teams to reference. It also leverages this additional context and guidance to tailor your documentation more precisely, ensuring the best possible results.

The context attribute must appear on a single line and should not contain any commas.