|
| 1 | +--- |
| 2 | +targets: |
| 3 | + - '*' |
| 4 | +root: false |
| 5 | +description: How to create a Diataxis Explanation page |
| 6 | +globs: [] |
| 7 | +cursor: |
| 8 | + alwaysApply: false |
| 9 | + description: How to create a Diataxis Explanation page |
| 10 | +--- |
| 11 | +# Diataxis Explanation Guide Format for Logseq |
| 12 | + |
| 13 | +This rule provides guidance on creating Explanation documentation in Logseq following the Diataxis documentation framework principles. |
| 14 | + |
| 15 | +<rule> |
| 16 | +name: diataxis_explanation_format |
| 17 | +description: Guidelines for creating effective Explanation documentation in Logseq following the Diataxis framework |
| 18 | +filters: |
| 19 | + - type: file_path |
| 20 | + pattern: ".*Concept.*\\.md$|.*Explanation.*\\.md$" |
| 21 | + |
| 22 | +actions: |
| 23 | + - type: suggest |
| 24 | + message: | |
| 25 | + # Creating Diataxis Explanation Documentation in Logseq |
| 26 | + |
| 27 | + ## Purpose |
| 28 | + |
| 29 | + Explanations are **understanding-oriented** guides that help users grasp concepts, ideas, and principles. They focus on building comprehension and insight rather than teaching specific skills or providing reference information. |
| 30 | + |
| 31 | + According to the Diataxis framework, Explanations: |
| 32 | + - Help users understand concepts, ideas, and principles |
| 33 | + - Build comprehension and insight |
| 34 | + - Focus on "why" and "how" rather than "what" or "when" |
| 35 | + - Provide context and reasoning behind decisions and approaches |
| 36 | + - Help users think about problems and solutions |
| 37 | + |
| 38 | + ## Key Principles |
| 39 | + |
| 40 | + 1. **Focus on Understanding** - Help users grasp concepts and principles |
| 41 | + 2. **Provide Context** - Explain the "why" behind concepts and decisions |
| 42 | + 3. **Build Insight** - Help users think about problems and solutions |
| 43 | + 4. **Use Examples** - Illustrate concepts with concrete examples |
| 44 | + 5. **Address Misconceptions** - Clarify common misunderstandings |
| 45 | + 6. **Link to Related Content** - Connect to tutorials, how-to guides, and reference material |
| 46 | + |
| 47 | + ## Structure for Logseq Explanation Documentation |
| 48 | + |
| 49 | + When creating Explanation documentation in Logseq, follow this structure using Logseq-Flavored Markdown (LFM): |
| 50 | + |
| 51 | + ``` |
| 52 | + tags:: [[ExistingTag1]], [[ExistingTag2]], [[Diataxis/Explanation]] |
| 53 | + |
| 54 | + - # [Topic Name] Conceptual Overview |
| 55 | + - ## Overview |
| 56 | + - Brief, clear description of the concept or topic |
| 57 | + - What it is and why it matters |
| 58 | + - ## Context |
| 59 | + - Historical background or current relevance |
| 60 | + - Why this concept exists or is important |
| 61 | + - Related problems or challenges it addresses |
| 62 | + - ## Key Principles |
| 63 | + - Core ideas and fundamental concepts |
| 64 | + - Important distinctions and relationships |
| 65 | + - Guiding principles or philosophies |
| 66 | + - ## Mechanism |
| 67 | + - How the concept works in practice |
| 68 | + - Technical details and implementation approaches |
| 69 | + - Components and their interactions |
| 70 | + - ## Examples |
| 71 | + - Concrete examples that illustrate the concept |
| 72 | + - Code snippets, diagrams, or case studies |
| 73 | + - Real-world applications |
| 74 | + - ## Misconceptions |
| 75 | + - Common misunderstandings about the concept |
| 76 | + - Clarifications and corrections |
| 77 | + - What it is NOT |
| 78 | + - ## Related |
| 79 | + - Links to related pages: [[Page1]], [[Page2]] |
| 80 | + ``` |
| 81 | + |
| 82 | + ## Naming Convention and File Paths |
| 83 | + |
| 84 | + Use the namespace pattern: `Topic/Subtopic/Concept/Specific Subject` |
| 85 | + |
| 86 | + **Note**: Following the official Diataxis framework, explanation titles should be able to be prefixed with "About". For example: "About Virtual Environments" or "About User Authentication". This reflects that explanations are _about_ a topic in the sense that they are _around_ it. |
| 87 | + |
| 88 | + Examples: |
| 89 | + - `[[Programming/Python/Concept/Virtual Environments]]` (About Virtual Environments) |
| 90 | + - `[[AI/Machine Learning/Concept/Overfitting]]` (About Overfitting) |
| 91 | + |
| 92 | + In Logseq, namespaces using `/` are translated into file paths using triple underscores `___`. For example: |
| 93 | + |
| 94 | + - The page `[[Programming/Python/Concept/Virtual Environments]]` will be stored as: |
| 95 | + `pages/Programming___Python___Concept___Virtual Environments.md` |
| 96 | + |
| 97 | + - The page `[[AI/Machine Learning/Concept/Overfitting]]` will be stored as: |
| 98 | + `pages/AI___Machine Learning___Concept___Overfitting.md` |
| 99 | + |
| 100 | + ## Required Tags |
| 101 | + |
| 102 | + **IMPORTANT**: All Diataxis Explanation pages MUST include the `[[Diataxis/Explanation]]` tag in the frontmatter. |
| 103 | + |
| 104 | + - If the page already has tags, add `[[Diataxis/Explanation]]` to the existing tags list |
| 105 | + - Example: `tags:: [[ExistingTag1]], [[ExistingTag2]], [[Diataxis/Explanation]]` |
| 106 | + - If the page has no tags yet, add: `tags:: [[Diataxis/Explanation]]` |
| 107 | + - Never remove existing tags when adding the Diataxis tag |
| 108 | + |
| 109 | + ## Language Guidelines |
| 110 | + |
| 111 | + - Use clear, accessible language |
| 112 | + - Explain concepts step by step |
| 113 | + - Use analogies and metaphors when helpful |
| 114 | + - Provide concrete examples |
| 115 | + - Address common questions and misconceptions |
| 116 | + - Link to related tutorials, how-to guides, and reference material |
| 117 | + - Focus on building understanding rather than providing instructions |
| 118 | + |
| 119 | + ## Explanation Writing Process |
| 120 | + |
| 121 | + 1. **Identify the Core Concept** |
| 122 | + - What fundamental idea needs to be understood? |
| 123 | + - What misconceptions commonly arise? |
| 124 | + - What context is needed for comprehension? |
| 125 | + |
| 126 | + 2. **Structure the Explanation** |
| 127 | + - Start with a clear overview |
| 128 | + - Provide necessary context |
| 129 | + - Explain key principles |
| 130 | + - Show how it works in practice |
| 131 | + - Include concrete examples |
| 132 | + - Address misconceptions |
| 133 | + |
| 134 | + 3. **Test for Understanding** |
| 135 | + - Can someone new to the topic follow the explanation? |
| 136 | + - Are common misconceptions addressed? |
| 137 | + - Are examples clear and relevant? |
| 138 | + - Does it build toward deeper understanding? |
| 139 | + |
| 140 | +examples: |
| 141 | + - input: | |
| 142 | + tags:: [[Python]], [[Programming]], [[Diataxis/Explanation]] |
| 143 | + |
| 144 | + - # Python Virtual Environments Conceptual Overview |
| 145 | + - ## Overview |
| 146 | + - Virtual environments are isolated Python environments that allow you to manage dependencies for different projects without conflicts. |
| 147 | + - ## Context |
| 148 | + - Python packages are installed globally by default, leading to version conflicts between projects. |
| 149 | + - Virtual environments solve this by creating isolated spaces with their own Python interpreter and package installations. |
| 150 | + - ## Key Principles |
| 151 | + - *Isolation* – Each environment has its own Python interpreter and packages |
| 152 | + - *Reproducibility* – Dependencies can be exactly specified and reproduced |
| 153 | + - *Project-specific* – Each project can have its own environment |
| 154 | + - ## Mechanism |
| 155 | + - Virtual environments create a directory with a Python interpreter and site-packages |
| 156 | + - The `venv` module creates environments: `python -m venv myenv` |
| 157 | + - Activation modifies PATH to use the environment's Python |
| 158 | + - `pip` installs packages into the active environment |
| 159 | + - ## Examples |
| 160 | + - ~~~bash |
| 161 | + # Create and activate a virtual environment |
| 162 | + python -m venv myproject |
| 163 | + source myproject/bin/activate # On Unix/macOS |
| 164 | + pip install requests |
| 165 | + ~~~ |
| 166 | + - ## Misconceptions |
| 167 | + - Virtual environments are only for large projects → **False**. Even small projects benefit from isolation. |
| 168 | + - You need to recreate environments frequently → **False**. Environments persist until deleted. |
| 169 | + - ## Related |
| 170 | + - [[Programming/Python/How To/Create Virtual Environment]] |
| 171 | + - [[Programming/Python/Ref/Pip Commands]] |
| 172 | + output: "Correctly formatted Diataxis Explanation in Logseq with proper tags" |
| 173 | + |
| 174 | +metadata: |
| 175 | + priority: high |
| 176 | + version: 1.0 |
| 177 | + related_rules: ["logseq-flavored-markdown.mdc"] |
| 178 | +</rule> |
| 179 | + |
| 180 | +## Implementation Guide |
| 181 | + |
| 182 | +When implementing Diataxis Explanation documentation in Logseq, follow these steps: |
| 183 | + |
| 184 | +1. **Identify the concept that needs explanation** |
| 185 | + - Focus on ideas that benefit from deeper understanding |
| 186 | + - Choose concepts that are commonly misunderstood |
| 187 | + - Ask: "What fundamental understanding will help users work more effectively?" |
| 188 | + |
| 189 | +2. **Create the page with the proper namespace** |
| 190 | + - Use `Topic/Subtopic/Concept/Specific Subject` format |
| 191 | + - This will create a file at ` |
0 commit comments