Replies: 1 comment
Markdown に Attribute Lists を追加するプロンプトVS Code release note の Markdown に対して Attribute Lists を追加する用途。 .github/prompts/add-attr-list.prompt.md ---
agent: agent
tools: ['read', 'agent', 'edit', 'search', 'todo']
---
For the following Markdown document, add a Kramdown-style Attribute List to every ATX heading line (lines starting with `#` through `######`). Only modify heading lines—do not change any other content, such as body text, lists, code blocks, or links.
Requirements:
1) The Attribute List must use this exact syntax (including spaces):
`{: #someid }`
Example:
`### Integrating agent sessions and chat {: #_integrating-agent-sessions-and-chat }`
2) How to determine the `someid` (matching the HTML generation rules for this document):
Generate a slug from the heading text as follows, then prefix it with `_` to form the `someid`:
- For inline code `` `...` ``, remove the backticks but keep the content (e.g., `` `classic` Microsoft ...`` → `classic Microsoft ...`)
- Convert the entire text to lowercase
- Remove all non-alphanumeric and non-space characters (e.g., `(`, `)`, `-`, `.`, `:` are removed; punctuation is not used as a separator)
- Replace consecutive spaces with a single `-`
- Final result: `someid = "_" + slug`
3) If a duplicate `someid` would occur (i.e., the same `someid` already exists in the file), append `-2`, `-3`, etc. to make it unique (e.g., `_foo`, `_foo-2`).
4) Heading level notes:
- For `#` through `######`, always add the Attribute List as above
Examples (from this document):
- `## Agents` → `## Agents {: #_agents }`
- `#### Side-by-side view` → `#### Side-by-side view {: #_sidebyside-view }` (hyphens are removed)
- `### Azure model provider: Entra ID as the default authentication` → `### Azure model provider: Entra ID as the default authentication {: #_azure-model-provider-entra-id-as-the-default-authentication }` (`:` is removed)
- `### TypeScript 7.0 preview` → `### TypeScript 7.0 preview {: #_typescript-70-preview }` (`.` is removed)
- ``### `classic` Microsoft authentication no longer available`` → ``### `classic` Microsoft authentication no longer available {: #_classic-microsoft-authentication-no-longer-available }`` (backticks removed) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Today I Learned ...
All reactions