atom_snippets.adoc 3.4 KB

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