documentation-guide.mdx 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. ---
  2. title: "Documentation Guide"
  3. sidebarTitle: "Documentation Guide"
  4. description: "How to write and contribute to Cline documentation"
  5. ---
  6. Cline's documentation lives in the `docs/` directory and uses [Mintlify](https://mintlify.com) for rendering. This guide covers how to write docs that match Cline's established style.
  7. ## Using the Documentation Workflow
  8. The fastest way to create documentation is using the `/write-docs` workflow. Type `/write-docs` in Cline and describe what you want to document. Cline guides you through a 4-step process:
  9. 1. **Research**: Examine existing docs structure and patterns
  10. 2. **Scope**: Clarify audience, doc type, and key use cases
  11. 3. **Outline**: Select a template and create structure
  12. 4. **Write**: Generate documentation following style guidelines
  13. The workflow file lives at `.clinerules/workflows/write-docs.md` and contains templates, style rules, and examples.
  14. ## Documentation Principles
  15. ### Write for Developers
  16. Your audience is developers who value their time. Get to the point. Every sentence should either help them understand something or help them do something.
  17. ```markdown
  18. # Good
  19. Switch to bash in Cline Settings → Terminal → Default Terminal Profile.
  20. # Bad
  21. Users who are experiencing issues may find it helpful to navigate to the
  22. Cline settings menu where they can locate the terminal configuration
  23. options and subsequently modify the default terminal profile setting.
  24. ```
  25. ### Show Real Examples
  26. Abstract descriptions don't help anyone. Show actual code, real file paths, and concrete implementations.
  27. ```markdown
  28. # Good
  29. I use `/deep-planning` whenever I'm building features that touch multiple
  30. parts of the codebase. For example, when adding authentication, Cline
  31. mapped every endpoint and created a migration plan that avoided breaking changes.
  32. # Bad
  33. The deep planning feature can be utilized for various complex tasks
  34. that may require careful consideration and planning.
  35. ```
  36. ### Use Active Voice
  37. Cline does things. Files don't get created by Cline, Cline creates files.
  38. ```markdown
  39. # Good
  40. Cline reads your project files and builds context automatically.
  41. # Bad
  42. Project files are read and context is built automatically.
  43. ```
  44. ### Use Neutral Pronouns for Cline
  45. Refer to Cline as "it" not "he". Cline is software, not a person.
  46. ```markdown
  47. # Good
  48. When Cline encounters an error, it suggests fixes.
  49. # Bad
  50. When Cline encounters an error, he suggests fixes.
  51. ```
  52. ## File Format
  53. All documentation uses MDX format with YAML frontmatter:
  54. ```yaml
  55. ---
  56. title: "Full Page Title"
  57. sidebarTitle: "Shorter Nav Title" # optional
  58. description: "One sentence for SEO" # optional but recommended
  59. ---
  60. ```
  61. ### Adding New Pages
  62. After creating a new `.mdx` file, add it to `docs/docs.json` in the appropriate navigation group:
  63. ```json
  64. {
  65. "group": "Features",
  66. "pages": [
  67. "features/existing-page",
  68. "features/your-new-page"
  69. ]
  70. }
  71. ```
  72. ## Mintlify Components
  73. Use these components appropriately throughout your docs.
  74. ### Frame
  75. Wrap all images and videos:
  76. ```jsx
  77. <Frame>
  78. <img
  79. src="https://storage.googleapis.com/cline_public_images/docs/assets/filename.png"
  80. alt="Descriptive alt text"
  81. />
  82. </Frame>
  83. ```
  84. ### Callouts
  85. Use sparingly and purposefully:
  86. ```jsx
  87. <Tip>Helpful suggestions that improve the experience.</Tip>
  88. <Note>Important information the reader needs to know.</Note>
  89. <Warning>Something that could cause problems if ignored.</Warning>
  90. ```
  91. ### Steps
  92. For sequential procedures:
  93. ```jsx
  94. <Steps>
  95. <Step title="Install the Extension">
  96. Search for "Cline" in the VS Code marketplace.
  97. </Step>
  98. <Step title="Configure Your Model">
  99. Open settings and add your API key.
  100. </Step>
  101. </Steps>
  102. ```
  103. ### Cards
  104. For navigation and feature overviews:
  105. ```jsx
  106. <CardGroup cols={2}>
  107. <Card title="Getting Started" icon="rocket" href="/getting-started/installing-cline">
  108. Install Cline and set up your first project.
  109. </Card>
  110. <Card title="Features" icon="wand-magic-sparkles" href="/core-workflows/plan-and-act">
  111. Explore what Cline can do.
  112. </Card>
  113. </CardGroup>
  114. ```
  115. ## Style Rules
  116. Quick reference for consistent documentation:
  117. | Do | Don't |
  118. |---|---|
  119. | Use "use" | Use "utilize" |
  120. | Keep sentences under 25 words | Write run-on sentences |
  121. | Use bullet points for lists | Write walls of text |
  122. | Show where things are in the UI | Assume users can find features |
  123. | Cross-link related docs | Leave readers stranded |
  124. | Use code blocks with language tags | Use inline code for long snippets |
  125. ### Avoid These Patterns
  126. - Em dashes and emojis
  127. - Starting with "This document explains..."
  128. - The **Bold Text**: description pattern
  129. - Explaining obvious things
  130. - Passive voice
  131. ## Previewing Changes
  132. Run the docs locally to preview your changes:
  133. ```bash
  134. cd docs
  135. npm install # first time only
  136. npm run dev
  137. ```
  138. Open `http://localhost:3000` to see your changes in real time.
  139. ## Related Resources
  140. <CardGroup cols={2}>
  141. <Card title="Documentation Templates" icon="file-lines" href="/contributing/doc-templates">
  142. Templates for different documentation types.
  143. </Card>
  144. <Card title="Workflows" icon="diagram-project" href="/customization/workflows">
  145. Learn about Cline's workflow system.
  146. </Card>
  147. </CardGroup>