Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
66 changes: 66 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,69 @@ The site uses a **modular JSON navigation system** instead of fumadocs meta.json
- PascalCase for React components and interfaces
- camelCase for variables and functions
- kebab-case for file names in content directories

## Markdown Link Cleanup Strategy

### Problem
Legacy markdown files often contain complex, unreadable link syntax that creates URL-encoded URLs like:
```
http://localhost:3000/api/access#has_role(role:-felt252,-account:-contractaddress)-%E2%86%92-bool-external
```

### Solution Approach
When cleaning up markdown files with complex link syntax, follow this systematic approach:

#### 1. Identify Complex Link Patterns
Look for these problematic patterns:
- **Function list links**: `[`+function_name+`](#`[.contract-item-name]#`function_name`#`(params)``-[.item-kind]#external#)`
- **Event list links**: `[`+EventName+`](#`[.contract-item-name]#`eventname`#`(params)``-[.item-kind]#event#)`
- **Function headings**: `#### `[.contract-item-name]#`function_name`#`(params)`` [.item-kind]#external#`

#### 2. Create Clean Link Strategy
Replace with simple, readable format:
- **Clean list links**: `[`function_name`](#prefix-function_name)`
- **Clean headings with anchors**:
```markdown
<a id="prefix-function_name"></a>
#### `function_name(params) → return_type`
```

#### 3. Anchor ID Naming Convention
Use descriptive prefixes to avoid conflicts:
- `iaccesscontrol-` for interface functions/events
- `component-` for component functions/events
- `extension-` for extension functions/events

#### 4. Implementation Process
1. **Use Task agent** for systematic fixes across large files
2. **Fix by section** - group related functions/events together
3. **Update both links and targets** - ensure table of contents links point to correct anchors
4. **Verify no complex patterns remain** - search for `[.contract-item-name]#` and `[.item-kind]#`

#### 5. Benefits
- ✅ Clean, readable URLs
- ✅ Better SEO and user experience
- ✅ Easier maintenance and debugging
- ✅ Consistent markdown formatting

### Example Before/After

**Before (Complex):**
```markdown
* [`+has_role(role, account)+`](#`[.contract-item-name]#`has_role`#`(role:-felt252,-account:-contractaddress)-→-bool``-[.item-kind]#external#)

#### `[.contract-item-name]#`has_role`#`(role: felt252, account: ContractAddress) → bool`` [.item-kind]#external#
```

**After (Clean):**
```markdown
* [`has_role(role, account)`](#iaccesscontrol-has_role)

<a id="iaccesscontrol-has_role"></a>
#### `has_role(role: felt252, account: ContractAddress) → bool`
```

### Framework Compatibility Notes
- **DO NOT use `{#anchor}` syntax** - breaks the framework parser
- **USE HTML anchor tags** - `<a id="anchor-name"></a>` format is safe
- **Test locally** to ensure links work properly after changes
11 changes: 11 additions & 0 deletions cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"aliases": {
"uiDir": "./components/ui",
"componentsDir": "./components",
"blockDir": "./components",
"cssDir": "./styles",
"libDir": "./lib"
},
"baseDir": "src",
"commands": {}
}
1 change: 0 additions & 1 deletion content/cairo-contracts/access.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Access
description: Access
---

Access control--that is, "who is allowed to do this thing"—is incredibly important in the world of smart contracts.
Expand Down
1 change: 0 additions & 1 deletion content/cairo-contracts/accounts.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Accounts
description: Accounts
---

Unlike Ethereum where accounts are derived from a private key, all Starknet accounts are contracts. This means there’s no Externally Owned Account (EOA)
Expand Down
1,239 changes: 1,239 additions & 0 deletions content/cairo-contracts/api/access.mdx

Large diffs are not rendered by default.

Loading