@@ -50,3 +50,69 @@ The site uses a **modular JSON navigation system** instead of fumadocs meta.json
5050- PascalCase for React components and interfaces
5151- camelCase for variables and functions
5252- kebab-case for file names in content directories
53+
54+ ## Markdown Link Cleanup Strategy
55+
56+ ### Problem
57+ Legacy markdown files often contain complex, unreadable link syntax that creates URL-encoded URLs like:
58+ ```
59+ http://localhost:3000/api/access#has_role(role:-felt252,-account:-contractaddress)-%E2%86%92-bool-external
60+ ```
61+
62+ ### Solution Approach
63+ When cleaning up markdown files with complex link syntax, follow this systematic approach:
64+
65+ #### 1. Identify Complex Link Patterns
66+ Look for these problematic patterns:
67+ - ** Function list links** : ` [ ` +function_name+` ](# ` [ .contract-item-name] #` function_name ` #` (params)``-[.item-kind]#external#) `
68+ - ** Event list links** : ` [ ` +EventName+` ](# ` [ .contract-item-name] #` eventname ` #` (params)``-[.item-kind]#event#) `
69+ - ** Function headings** : ` #### ` [ .contract-item-name] #` function_name ` #` (params)`` [.item-kind]#external# `
70+
71+ #### 2. Create Clean Link Strategy
72+ Replace with simple, readable format:
73+ - ** Clean list links** : ` [ ` function_name` ](#prefix-function_name) `
74+ - ** Clean headings with anchors** :
75+ ``` markdown
76+ <a id =" prefix-function_name " ></a >
77+ #### ` function_name(params) → return_type `
78+ ```
79+
80+ #### 3. Anchor ID Naming Convention
81+ Use descriptive prefixes to avoid conflicts:
82+ - ` iaccesscontrol- ` for interface functions/events
83+ - ` component- ` for component functions/events
84+ - ` extension- ` for extension functions/events
85+
86+ #### 4. Implementation Process
87+ 1 . ** Use Task agent** for systematic fixes across large files
88+ 2 . ** Fix by section** - group related functions/events together
89+ 3 . ** Update both links and targets** - ensure table of contents links point to correct anchors
90+ 4 . ** Verify no complex patterns remain** - search for ` [.contract-item-name]# ` and ` [.item-kind]# `
91+
92+ #### 5. Benefits
93+ - ✅ Clean, readable URLs
94+ - ✅ Better SEO and user experience
95+ - ✅ Easier maintenance and debugging
96+ - ✅ Consistent markdown formatting
97+
98+ ### Example Before/After
99+
100+ ** Before (Complex):**
101+ ``` markdown
102+ * [ ` +has_role(role, account)+ ` ] ( #`[.contract-item-name]#`has_role`#`(role:-felt252,-account:-contractaddress)-→-bool``-[.item-kind]#external# )
103+
104+ #### ` [.contract-item-name]# ` has_role` # ` (role: felt252, account: ContractAddress) → bool`` [ .item-kind] #external#
105+ ```
106+
107+ ** After (Clean):**
108+ ``` markdown
109+ * [ ` has_role(role, account) ` ] ( #iaccesscontrol-has_role )
110+
111+ <a id =" iaccesscontrol-has_role " ></a >
112+ #### ` has_role(role: felt252, account: ContractAddress) → bool `
113+ ```
114+
115+ ### Framework Compatibility Notes
116+ - ** DO NOT use ` {#anchor} ` syntax** - breaks the framework parser
117+ - ** USE HTML anchor tags** - ` <a id="anchor-name"></a> ` format is safe
118+ - ** Test locally** to ensure links work properly after changes
0 commit comments