atom_snippets.adoc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. = Atom Snippets
  2. :author: mitm
  3. :revnumber: 1.1
  4. :revdate: 2020/07/25
  5. Copy and paste this text into your Atom Editor menu:File[Snippets...] page to add some useful shortcuts. Feel free to contribute any changes so other editors can benifit by selecting the "`Edit this Page`" link in the header of this page and submitting a pull request in the wiki repo.
  6. ```
  7. # Your snippets
  8. #
  9. # Atom snippets allow you to enter a simple prefix in the editor and hit tab to
  10. # expand the prefix into a larger code block with templated values.
  11. #
  12. # You can create a new snippet in this file by typing "snip" and then hitting
  13. # tab.
  14. #
  15. # An example CoffeeScript snippet to expand log to console.log:
  16. #
  17. # '.source.coffee':
  18. # 'Console log':
  19. # 'prefix': 'log'
  20. # 'body': 'console.log $1'
  21. #
  22. # Each scope (e.g. '.source.coffee' above) can only be declared once.
  23. #
  24. # This file uses CoffeeScript Object Notation (CSON).
  25. # If you are unfamiliar with CSON, you can read more about it in the
  26. # Atom Flight Manual:
  27. # http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
  28. '.source.asciidoc':
  29. 'Cross reference internal element, same page':
  30. 'prefix': 'xrefI'
  31. 'body': '<<${1:reference-a-section-in-the-same-page},${2:label text}>>'
  32. 'Cross reference internal element, same module':
  33. 'prefix': 'xrefIsm'
  34. 'body': '<<${1:target-page-filename}.adoc#${2:reference-section},${3:label text}>>'
  35. 'Cross reference internal element, named module':
  36. 'prefix': 'xrefInm'
  37. 'body': '<<${1:module-name}:${2:target-page-filename}.adoc#${3:reference-section},${4:label text}>>'
  38. 'Cross reference page, same module':
  39. 'prefix': 'xrefPsm'
  40. 'body': 'xref:${1:target-page-filename}.adoc[${2:link text}]'
  41. 'Cross reference page, named module':
  42. 'prefix': 'xrefPnm'
  43. 'body': 'xref:${1:module-name}:${2:target-page-filename}.adoc[${3:link text}]'
  44. 'Cross reference page, ROOT module':
  45. 'prefix': 'xrefPrm'
  46. 'body': 'xref:ROOT:${1:target-page-filename}.adoc[${2:link text}]'
  47. 'Admonition Block':
  48. 'prefix': 'admonB'
  49. 'body': """
  50. [${1:NOTE}${2:TIP}${3:IMPORTANT}${4:CAUTION}${5:WARNING}]
  51. ====
  52. $6
  53. ====
  54. $7
  55. """
  56. 'Admonition Block with Title':
  57. 'prefix': 'admonBwT'
  58. 'body': """
  59. [${1:NOTE}${2:TIP}${3:IMPORTANT}${4:CAUTION}${5:WARNING}]
  60. .${6:Optional Title}
  61. ====
  62. $7
  63. ====
  64. $8
  65. """
  66. 'Admonition Paragraph':
  67. 'prefix': 'admonP'
  68. 'body': """
  69. ${1:NOTE}${2:TIP}${3:IMPORTANT}${4:CAUTION}${5:WARNING}: $6
  70. """
  71. 'Admonition Paragraph with Title':
  72. 'prefix': 'admonPwT'
  73. 'body': """
  74. .${1:Optional Title}
  75. ${2:NOTE}${3:TIP}${4:IMPORTANT}${5:CAUTION}${6:WARNING}: $7
  76. """
  77. 'Include partial same module':
  78. 'prefix': 'part'
  79. 'body': 'include::partial$${1:partial-filename}.adoc[${3:line=}${4:tag=}${5:tags=}]'
  80. 'Include partial different module':
  81. 'prefix': 'partM'
  82. 'body': 'include::${1:module}:partial$${2:partial-filename}.adoc[${3:line=}${4:tag=}${5:tags=}]'
  83. 'Include partial ROOT':
  84. 'prefix': 'partR'
  85. 'body': 'include::ROOT:partial$${1:partial-filename}.adoc[${2:line=}${3:tag=}${4:tags=}]'
  86. 'Module inline image':
  87. 'prefix': 'imgMI'
  88. 'body': 'image:${1:module}:${2:target-resource-filename.ext}[${3:}]'
  89. 'Module block image':
  90. 'prefix': 'imgMB'
  91. 'body': 'image::${1:module}:${2:target-resource-filename.ext}[${3:}]'
  92. 'ROOT inline image':
  93. 'prefix': 'imgRI'
  94. 'body': 'image:ROOT:${1:target-resource-filename.ext}[${2:}]'
  95. 'ROOT block image':
  96. 'prefix': 'imgRB'
  97. 'body': 'image::ROOT:${1:target-resource-filename.ext}[${2:}]'
  98. ```