docs: create a markdown code snippet file to make it easier for contributors (#15611)

adds snippets to make some of the docs markdown components a little
easier to use

- wraps selected text where it seems appropriate
- limits code block languages (these are suggestions, you can choose
from the list or enter anything)

tabs example:

![tabs
gif](https://github.com/user-attachments/assets/226b942e-4b34-4d3b-8561-84c5a17e2805)

---------

Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com>
This commit is contained in:
Edward Angert
2024-11-21 17:09:56 -05:00
committed by GitHub
parent 26438aa91f
commit 684e75e2a7
3 changed files with 42 additions and 0 deletions

2
.gitignore vendored
View File

@ -17,6 +17,8 @@ yarn-error.log
# Allow VSCode recommendations and default settings in project root.
!/.vscode/extensions.json
!/.vscode/settings.json
# Allow code snippets
!/.vscode/*.code-snippets
# Front-end ignore patterns.
.next/

View File

@ -20,6 +20,8 @@ yarn-error.log
# Allow VSCode recommendations and default settings in project root.
!/.vscode/extensions.json
!/.vscode/settings.json
# Allow code snippets
!/.vscode/*.code-snippets
# Front-end ignore patterns.
.next/

38
.vscode/markdown.code-snippets vendored Normal file
View File

@ -0,0 +1,38 @@
{
// For info about snippets, visit https://code.visualstudio.com/docs/editor/userdefinedsnippets
"admonition": {
"prefix": "#callout",
"body": [
"<blockquote class=\"admonition ${1|caution,important,note,tip,warning|}\">\n",
"${TM_SELECTED_TEXT:${2:add info here}}\n",
"</blockquote>\n"
],
"description": "callout admonition caution info note tip warning"
},
"fenced code block": {
"prefix": "#codeblock",
"body": ["```${1|apache,bash,console,diff,Dockerfile,env,go,hcl,ini,json,lisp,md,powershell,shell,sql,text,tf,tsx,yaml|}", "${TM_SELECTED_TEXT}$0", "```"],
"description": "fenced code block"
},
"image": {
"prefix": "#image",
"body": "![${TM_SELECTED_TEXT:${1:alt}}](${2:url})$0",
"description": "image"
},
"tabs": {
"prefix": "#tabs",
"body": [
"<div class=\"tabs\">\n",
"${1:optional description}\n",
"## ${2:tab title}\n",
"${TM_SELECTED_TEXT:${3:first tab content}}\n",
"## ${4:tab title}\n",
"${5:second tab content}\n",
"## ${6:tab title}\n",
"${7:third tab content}\n",
"</div>\n"
],
"description": "tabs"
}
}