Guest User

Untitled

a guest
Jul 17th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. # pugjs snippets for atom ide, copy this and paste it in your snippets.cson
  2. '.source.pug':
  3. 'style CSS pug':
  4. 'prefix':'pugcss'
  5. 'body':
  6. """
  7. link(rel='stylesheet', href='$1')
  8. $2
  9. """
  10. 'script JS pug':
  11. 'prefix':'pugjs'
  12. 'body':
  13. """
  14. script(type='text/javascript', src='$1')
  15. $2
  16. """
  17. 'table pug':
  18. 'prefix':'pugtable'
  19. 'body':
  20. """
  21. table
  22. thead
  23. tr $1
  24. td $2
  25. tbody
  26. tr $3
  27. td $4
  28. """
  29. 'for pug':
  30. 'prefix':'pugfor'
  31. 'body':
  32. """
  33. - for (var ${1:i} = ${2:0}; ${3:i} < ${4:5}; ${5:i}++)
  34. ${6://-content}
  35. """
  36. 'each pug':
  37. 'prefix':'pugeach'
  38. 'body':
  39. """
  40. each ${1:item} in ${2:itens}
  41. ${3://-content}
  42. """
  43. 'mixin pug':
  44. 'prefix':'pugmixin'
  45. 'body':
  46. """
  47. mixin ${1:item}
  48. ${2:p= item}
  49.  
  50. +${3:item}
  51. +${4:item}
  52. """
  53. 'mixin-block pug':
  54. 'prefix':'pugmixinblock'
  55. 'body':
  56. """
  57. mixin ${1:item}(${2:x})
  58. h1= ${3:x}
  59. if block
  60. block
  61. else
  62. ${4:else content}
  63.  
  64. +${5:item}('Hello world')
  65.  
  66. +${6:item}('Hello world')
  67. p Awesome item content
  68. """
  69. 'mixin-attr pug':
  70. 'prefix':'pugmixinattr'
  71. 'body':
  72. """
  73. mixin ${1:link}(${2:href}, ${3:name})
  74. a(class!=attributes.class href=${4:href} name!=${5:name})= ${6:name}
  75.  
  76. +${7:link}('/foo', 'foo')(class="btn")
  77. """
  78. 'mixin-args pug':
  79. 'prefix':'pugmixinargs'
  80. 'body':
  81. """
  82. mixin ${1:list}(${2:id}, ...items)
  83. ul(id=${3:id})
  84. each item in items
  85. li= ${4:item}
  86.  
  87. +${5:list}('list_id', 1, 2, 3, 4)
  88. """
  89. 'case pug':
  90. 'prefix':'pugcase'
  91. 'body':
  92. """
  93. case ${1:item}
  94. when ${2:1}
  95. ${3://-content}
  96. when ${4:2}
  97. ${5:- break}
  98. when ${6:3}
  99. when ${7:4}
  100. ${8://-content for 3 & 4}
  101. default
  102. ${9://-default}
  103. """
  104. 'if pug':
  105. 'prefix':'pugif'
  106. 'body':
  107. """
  108. if ${1:true}
  109. ${2://-content for true}
  110. else
  111. ${3://-content for false}
  112. """
  113. 'if pug complete':
  114. 'prefix':'pugifc'
  115. 'body':
  116. """
  117. if ${1:true}
  118. ${2://-content for true}
  119. else ${3:otherTrue}
  120. ${4://-content for other true}
  121. else
  122. ${5://-content for false}
  123. """
  124. 'var use pug':
  125. 'prefix':'pugvar'
  126. 'body':
  127. """
  128. - var ${1:msg} = ${2://-content for msg};
  129. p This is \#{${3:msg}${4:.toUpperCase()}}
  130. """
  131. 'while pug':
  132. 'prefix':'pugwhile'
  133. 'body':
  134. """
  135. - var ${1:item} = ${2:1};
  136. ul
  137. while ${3:item} < ${4:3}
  138. li= ${5:item}++
  139. """
  140. 'piped-text pug':
  141. 'prefix':'pugpiped'
  142. 'body':
  143. """
  144. p
  145. | ${1:this text},
  146. | ${2:is in one line.}
  147. """
Add Comment
Please, Sign In to add comment