alchi-snippets.code-snippets 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {
  2. "paragraph": {
  3. "scope": "html",
  4. "prefix": [
  5. "para",
  6. ],
  7. "body": [
  8. "<div class=\"para\">\n $1\n</div>",
  9. ],
  10. "description": "",
  11. },
  12. "split-paragraph": {
  13. "scope": "html",
  14. "prefix": [
  15. "splitpara",
  16. ],
  17. "body": [
  18. "</div>\n\n<div class=\"para\">",
  19. ],
  20. "description": "split a paragraph in two paragraphs",
  21. },
  22. "xcenter": {
  23. "scope": "html",
  24. "prefix": [
  25. "xcenter",
  26. "centerx",
  27. ],
  28. "body": [
  29. "<div class=\"xcenter\">\n $1\n</div>",
  30. ],
  31. "description": "add a horizontally-centered element. useful to wrap <svg> elements",
  32. },
  33. "annotation": {
  34. "scope": "html",
  35. "prefix": [
  36. "annotate",
  37. "annotation",
  38. ],
  39. "body": [
  40. "<div class=\"annotation\" onClick=\"clickAnnotation(this)\" title='\n $2\n'>\n $1\n</div>",
  41. ],
  42. "description": "add a clickable annotation",
  43. },
  44. "fourtable": {
  45. "scope": "html",
  46. "prefix": [
  47. "fourtable",
  48. "fivetable",
  49. ],
  50. "body": [
  51. "\n\n<table style=\"margin:auto; margin-top:0.5em; border:solid 1px black\">\n <tr>\n <td>1. $1</td>\n <td></td>\n <td>3. $3</td>\n </tr>\n <tr>\n <td></td>\n <td>$5</td>\n <td></td>\n </tr>\n <tr>\n <td>4. $4</td>\n <td></td>\n <td>2. $2</td>\n </tr>\n</table>"
  52. ],
  53. "description": "add table with four elements + fifth element in center",
  54. },
  55. }
  56. /*
  57. string to json string in bash
  58. s="$(cat <<'EOF'
  59. hello
  60. world
  61. EOF
  62. )"
  63. echo '""' | jq '$x' --arg x "$s"
  64. */