init.lua 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. local M = {}
  2. --[[ This comment is for LuaDoc.
  3. ---
  4. -- Some mods for little things in other modules
  5. -- for my personal convenience.
  6. module('_M.mods')]]
  7. events.connect(events.LEXER_LOADED, function(str)
  8. if type(snippets) == 'table' then
  9. -- Additions to Global snippets (works in any file)
  10. snippets['lorem'] = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
  11. ---
  12. -- Additions to HTML-specific snippets.
  13. -- @class table
  14. -- @name _G.snippets.html
  15. snippets.html = {
  16. ['a'] = '<a href="%1">%2</a>%0',
  17. ['br'] = '<br/>%0',
  18. ['code'] = '<code>%1</code>%0',
  19. ['div'] = '<div>%1</div>%0',
  20. ['form'] = '<form class="%1" action="%2(index.html)" method="%3(post)">\n\t%3\n</form>%0',
  21. ['h1'] = '<h1>%1</h1>%0',
  22. ['h2'] = '<h2>%1</h2>%0',
  23. ['h3'] = '<h3>%1</h3>%0',
  24. ['h4'] = '<h4>%1</h4>%0',
  25. ['h5'] = '<h5>%1</h5>%0',
  26. ['h6'] = '<h6>%1</h6>%0',
  27. ['html'] = '<!DOCTYPE html>\n<html>\n\t<head>\n\t\t<meta charset="utf-8">\n\t\t<title>%1</title>\n\t</head>\n\t<body>\n\t\t%0\n\t</body>\n</html>',
  28. ['img'] = '<img src="%1" />%0',
  29. ['input'] = '<input type="%1(text)" name="%2" value="%3" />%0',
  30. ['label'] = '<label>%1</label>%0',
  31. ['li'] = '<li>%1</li>%0',
  32. ['link'] = '<link rel="%1(stylesheet)" href="%2(/css/master.css)">%0',
  33. ['loremp'] = '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>%0',
  34. ['ol'] = '<ol>%1</ol>%0',
  35. ['p'] = '<p>%1</p>%0',
  36. ['pre'] = '<pre>%1</pre>%0',
  37. ['strong'] = '<strong>%1</strong>%0',
  38. ['span'] = '<span>%1</span>%0',
  39. ['script'] = '<script type="text/javascript">\n\t%1\n</script>%0',
  40. ['scriptsrc'] = '<script src="%1" type="text/javascript"></script>%0',
  41. ['table'] = '<table>\n\t%1\n</table>%0',
  42. ['tbody'] = '<tbody>\n\t%1\n</tbody>%0',
  43. ['td'] = '<td>%1</td>%0',
  44. ['textarea'] = '<textarea name="%1(name)" rows="%2(8)" cols="%3(80)">%4</textarea>%0',
  45. ['th'] = '<th>%1</th>%0',
  46. ['tr'] = '<tr>%1</tr>%0',
  47. ['ul'] = '<ul>%1</ul>%0',
  48. }
  49. end
  50. end)
  51. return M