1+
2+ ---
3+
4+ Markdown Best Practices
5+ =======================
6+
7+ Document Structure
8+ ------------------
9+ - Use a single `# Title` at the top
10+ - Follow with a brief description
11+ - Organize content with hierarchical headings (`##`, `###`)
12+ - Include a TOC for documents longer than 3 sections
13+
14+ Formatting
15+ ----------
16+ - Keep lines under 120 characters for readability
17+ - Break long lines at natural points (after periods, commas, or logical breaks)
18+ - Use **bold** for emphasis, *italics* for terminology
19+ - Code blocks: Triple backticks with language identifier (REQUIRED - prevents MD040)
20+ - Inline code: Single backticks for commands, variables
21+ - Horizontal rules (`---`) only to separate major sections
22+
23+ Lists
24+ -----
25+ - Use ordered lists (1. 2. 3.) for sequential steps
26+ - Use unordered lists (- or *) for non-sequential items
27+ - Maintain consistent indentation for nested lists
28+
29+ Links and References
30+ --------------------
31+ - Use descriptive link text: `[descriptive text](mdc:URL)`
32+ - Prefer relative links for project files
33+ - Group related references at document bottom
34+
35+ Images
36+ ------
37+ - Include alt text: ``
38+ - Keep width under 900px for readability
39+ - Store images in dedicated `/assets` or `/images` folder
40+
41+ Tables
42+ ------
43+ - Use tables for structured data comparisons
44+ - Include header row and alignment indicators
45+ - Keep tables simple; avoid nested tables
46+
47+ Common Lint Errors to Avoid
48+ ---------------------------
49+ - MD040: Always specify a language for fenced code blocks
50+ - MD013: Keep line length under 120 characters
51+ - MD022: Headers must be surrounded by blank lines
52+ - MD023: Headers must start at beginning of line
53+ - MD032: Lists should be surrounded by blank lines
54+ - MD041: First line should be a top-level header
55+
56+ ---
57+
58+ Shell Command Context Specification
59+ -----------------------------------
60+
61+ Precede command blocks requiring a specific starting directory or shell
62+ environment with a single comment line specifying the required shell(s)
63+ and starting path.
64+
65+ **Starting Path**
66+ - Default: Relative paths from `repo-root` (top-level dir, e.g., with `.git`).
67+ - Use the most specific relevant directory (e.g., `repo-root/src/project`).
68+ - Allowed: Absolute paths if necessary (e.g., `C:\Tools`).
69+ - Use `.` for the specified root/absolute directory itself.
70+
71+ **Shell**
72+ - Default: Generic names (`PS`, `Bash`).
73+ - Specify versions (`PS7`) or types (`GitBash`, `Cmd`) ONLY if command depends on them.
74+
75+ Assume user is in the specified directory with the appropriate shell.
76+
77+ **Format**
78+ `# <ShellSpecifier>: <PathSpecifier>`
79+ - `<ShellSpecifier>`: Target shell(s) (`PS`, `Bash`, `Bash/GitBash`, `PS7`).
80+ - `<PathSpecifier>`: Starting path (relative or absolute). Use `\` or `/` matching shell/OS.
81+
82+ Commands in the block should use paths relative to the specified starting directory.
83+
84+ **Examples**
85+
86+ **Generic PS Command (from project dir):**
87+ ```powershell
88+ # PS: repo-root\code\MatureWeb\Northwind.DataContext
89+ dotnet user-secrets list --project .\Northwind.DataContext.csproj
90+ ```
91+
92+ **Generic Bash Command (from repo root):**
93+ ```bash
94+ # Bash: repo-root/.
95+ git submodule update --init
96+ ```
97+
98+ **PowerShell 7 Specific Command:**
99+ ```powershell
100+ # PS7: repo-root\scripts
101+ Get-ChildItem .\*.log | ForEach-Object -Parallel { Remove-Item $_.FullName } -ThrottleLimit 4
102+ ```
103+
104+ **GitBash Specific Scenario:**
105+ ```bash
106+ # GitBash: repo-root/.
107+ # Assumes a specific credential helper configured only for GitBash
108+ git push origin main
109+ ```
110+
111+ **Absolute Path Example (Windows):**
112+ ```powershell
113+ # PS: C:\ProgramData\MyTool
114+ .\mytool-config.exe --update-settings
115+ ```
0 commit comments