shinmun 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/.gitignore +1 -0
  2. data/LICENSE +18 -0
  3. data/README.md +249 -0
  4. data/Rakefile +60 -0
  5. data/bin/shinmun +12 -0
  6. data/example/posts/2008/9/example.md +19 -0
  7. data/example/posts/blog.yml +10 -0
  8. data/example/posts/uuid.state +3 -0
  9. data/example/public/controllers/comments.php +56 -0
  10. data/example/public/images/loading.gif +0 -0
  11. data/example/public/javascripts/comments.js +60 -0
  12. data/example/public/javascripts/highlight.js +505 -0
  13. data/example/public/javascripts/images/bg-fill.png +0 -0
  14. data/example/public/javascripts/images/bg.png +0 -0
  15. data/example/public/javascripts/images/blockquote.png +0 -0
  16. data/example/public/javascripts/images/bold.png +0 -0
  17. data/example/public/javascripts/images/code.png +0 -0
  18. data/example/public/javascripts/images/h1.png +0 -0
  19. data/example/public/javascripts/images/hr.png +0 -0
  20. data/example/public/javascripts/images/img.png +0 -0
  21. data/example/public/javascripts/images/italic.png +0 -0
  22. data/example/public/javascripts/images/link.png +0 -0
  23. data/example/public/javascripts/images/ol.png +0 -0
  24. data/example/public/javascripts/images/redo.png +0 -0
  25. data/example/public/javascripts/images/separator.png +0 -0
  26. data/example/public/javascripts/images/ul.png +0 -0
  27. data/example/public/javascripts/images/undo.png +0 -0
  28. data/example/public/javascripts/images/wmd-on.png +0 -0
  29. data/example/public/javascripts/images/wmd.png +0 -0
  30. data/example/public/javascripts/jquery-form.js +869 -0
  31. data/example/public/javascripts/jquery.js +3383 -0
  32. data/example/public/javascripts/languages/1c.js +82 -0
  33. data/example/public/javascripts/languages/axapta.js +52 -0
  34. data/example/public/javascripts/languages/bash.js +80 -0
  35. data/example/public/javascripts/languages/diff.js +64 -0
  36. data/example/public/javascripts/languages/dos.js +33 -0
  37. data/example/public/javascripts/languages/dynamic.js +460 -0
  38. data/example/public/javascripts/languages/ini.js +36 -0
  39. data/example/public/javascripts/languages/javascript.js +38 -0
  40. data/example/public/javascripts/languages/lisp.js +86 -0
  41. data/example/public/javascripts/languages/mel.js +50 -0
  42. data/example/public/javascripts/languages/profile.js +50 -0
  43. data/example/public/javascripts/languages/renderman.js +71 -0
  44. data/example/public/javascripts/languages/smalltalk.js +53 -0
  45. data/example/public/javascripts/languages/sql.js +50 -0
  46. data/example/public/javascripts/languages/static.js +175 -0
  47. data/example/public/javascripts/languages/vbscript.js +25 -0
  48. data/example/public/javascripts/languages/www.js +245 -0
  49. data/example/public/javascripts/prettyDate.js +36 -0
  50. data/example/public/javascripts/showdown.js +421 -0
  51. data/example/public/javascripts/template.js +165 -0
  52. data/example/public/javascripts/wmd-base.js +1799 -0
  53. data/example/public/javascripts/wmd-plus.js +311 -0
  54. data/example/public/javascripts/wmd.js +73 -0
  55. data/example/public/stylesheets/grid.css +243 -0
  56. data/example/public/stylesheets/grid.png +0 -0
  57. data/example/public/stylesheets/highlight/ascetic.css +38 -0
  58. data/example/public/stylesheets/highlight/dark.css +96 -0
  59. data/example/public/stylesheets/highlight/default.css +91 -0
  60. data/example/public/stylesheets/highlight/far.css +95 -0
  61. data/example/public/stylesheets/highlight/idea.css +75 -0
  62. data/example/public/stylesheets/highlight/sunburst.css +112 -0
  63. data/example/public/stylesheets/highlight/zenburn.css +108 -0
  64. data/example/public/stylesheets/print.css +76 -0
  65. data/example/public/stylesheets/reset.css +45 -0
  66. data/example/public/stylesheets/style.css +141 -0
  67. data/example/public/stylesheets/typography.css +59 -0
  68. data/example/templates/feed.rxml +21 -0
  69. data/example/templates/layout.rhtml +54 -0
  70. data/example/templates/page.rhtml +4 -0
  71. data/example/templates/post.rhtml +57 -0
  72. data/example/templates/posts.rhtml +10 -0
  73. data/lib/shinmun.rb +420 -0
  74. metadata +151 -0
@@ -0,0 +1,82 @@
1
+ hljs.IDENT_RE_RU = '[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*';
2
+ hljs.OneS_KEYWORDS = {'процедура':1,'функция':1,'экспорт':1,'перем':1,'конецфункции':1,'конецпроцедуры':1,'если':1,'тогда':1,'иначе':1,'иначеесли':1,'конецесли':1,'попытка':1,'исключение':1,'конецпопытки':1,'ложь':1,'истина':1,'неопределено':1,'и':1,'или':1,'не':1,'null':1,'для':1,'каждого':1,'из':1,'по':1,'цикл':1,'конеццикла':1};
3
+
4
+ hljs.LANGUAGES['1c'] = {
5
+ defaultMode: {
6
+ lexems: [hljs.IDENT_RE_RU],
7
+ contains: ['comment', 'string', 'function', 'preprocessor', 'number'],
8
+ keywords: hljs.OneS_KEYWORDS
9
+ },
10
+ case_insensitive: true,
11
+ modes: [
12
+ hljs.C_LINE_COMMENT_MODE,
13
+ {
14
+ className: 'string',
15
+ begin: '"', end: '"',
16
+ contains: ['dquote'],
17
+ relevance: 0
18
+ },
19
+ {
20
+ className: 'string',
21
+ begin: '"', end: '$',
22
+ contains: ['dquote']
23
+ },
24
+ {
25
+ className: 'string',
26
+ begin: '\\|', end: '$',
27
+ contains: ['dquote']
28
+ },
29
+ {
30
+ className: 'string',
31
+ begin: '\\|', end: '"',
32
+ contains: ['dquote']
33
+ },
34
+ {
35
+ className: 'dquote',
36
+ begin: '""', end: '^'
37
+ },
38
+ {
39
+ className: 'number',
40
+ begin: hljs.NUMBER_RE, end: '^',
41
+ relevance: 0
42
+ },
43
+ {
44
+ className: 'title',
45
+ lexems: [hljs.IDENT_RE_RU],
46
+ begin: hljs.IDENT_RE_RU, end: '^'
47
+ },
48
+ {
49
+ className: 'params',
50
+ begin: '\\(', end: '\\)',
51
+ lexems: [hljs.IDENT_RE_RU],
52
+ keywords: {'знач':1},
53
+ contains: ['string']
54
+ },
55
+ {
56
+ className: 'function',
57
+ begin: '(процедура|функция)', end: '$',
58
+ lexems: [hljs.IDENT_RE_RU],
59
+ keywords: {'процедура': 1, 'экспорт':1, 'функция': 1},
60
+ contains: ['title','tail','comment'],
61
+ relevance: 0
62
+ },
63
+ {
64
+ className: 'tail',
65
+ begin: '^', endsWithParent: true,
66
+ lexems: [hljs.IDENT_RE_RU],
67
+ contains: ['params', 'export']
68
+ },
69
+ {
70
+ className: 'export',
71
+ begin: 'экспорт', endsWithParent: true,
72
+ lexems: [hljs.IDENT_RE_RU],
73
+ keywords: {'экспорт': 1},
74
+ contains: ['comment']
75
+ },
76
+ {
77
+ className: 'preprocessor',
78
+ begin: '#', end: '$',
79
+ lexems: [hljs.IDENT_RE_RU]
80
+ }
81
+ ]
82
+ };
@@ -0,0 +1,52 @@
1
+ /*
2
+
3
+ Axapta definition (с) Dmitri Roudakov <dmitri@roudakov.ru>
4
+
5
+ */
6
+ hljs.LANGUAGES.axapta = {
7
+ defaultMode: {
8
+ lexems: [hljs.UNDERSCORE_IDENT_RE],
9
+ contains: ['comment', 'string', 'class', 'number', 'preprocessor'],
10
+ keywords: {'false': 1, 'int': 1, 'abstract': 1, 'private': 1, 'char': 1, 'interface': 1, 'boolean': 1, 'static': 1, 'null': 1, 'if': 1, 'for': 1, 'true': 1, 'while': 1, 'long': 1, 'throw': 1, 'finally': 1, 'protected': 1, 'extends': 1, 'final': 1, 'implements': 1, 'return': 1, 'void': 1, 'enum': 1, 'else': 1, 'break': 1, 'new': 1, 'catch': 1, 'byte': 1, 'super': 1, 'class': 1, 'case': 1, 'short': 1, 'default': 1, 'double': 1, 'public': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1,
11
+ 'reverse':1, 'firstfast':1,'firstonly':1,'forupdate':1,'nofetch':1, 'sum':1, 'avg':1, 'minof':1, 'maxof':1, 'count':1, 'order':1, 'group':1, 'by':1, 'asc':1, 'desc':1, 'index':1, 'hint':1, 'like':1,
12
+ 'dispaly':1, 'edit':1, 'client':1, 'server':1, 'ttsbegin':1, 'ttscommit':1,
13
+ 'str':1, 'real':1, 'date':1, 'container':1, 'anytype':1, 'common':1, 'div':1,'mod':1
14
+ }
15
+ },
16
+ modes: [
17
+ {
18
+ className: 'class',
19
+ lexems: [hljs.UNDERSCORE_IDENT_RE],
20
+ begin: '(class |interface )', end: '{',
21
+ illegal: ':',
22
+ keywords: {'class': 1, 'interface': 1},
23
+ contains: ['inheritance', 'title']
24
+ },
25
+ {
26
+ className: 'inheritance',
27
+ begin: '(implements|extends)', end: '^',
28
+ lexems: [hljs.IDENT_RE],
29
+ keywords: {'extends': 1, 'implements': 1},
30
+ relevance: 10
31
+ },
32
+ {
33
+ className: 'title',
34
+ begin: hljs.UNDERSCORE_IDENT_RE, end: '^'
35
+ },
36
+ {
37
+ className: 'params',
38
+ begin: '\\(', end: '\\)',
39
+ contains: ['string', 'annotation']
40
+ },
41
+ hljs.C_NUMBER_MODE,
42
+ hljs.APOS_STRING_MODE,
43
+ hljs.QUOTE_STRING_MODE,
44
+ hljs.BACKSLASH_ESCAPE,
45
+ hljs.C_LINE_COMMENT_MODE,
46
+ hljs.C_BLOCK_COMMENT_MODE,
47
+ {
48
+ className: 'preprocessor',
49
+ begin: '#', end: '$'
50
+ }
51
+ ]
52
+ };
@@ -0,0 +1,80 @@
1
+ /*
2
+
3
+ Bash Scripts by vah <vahtenberg@gmail.com>
4
+
5
+ */
6
+ hljs.BASH_LITERAL = {'true' : 1, 'false' : 1}
7
+ hljs.LANGUAGES.bash = {
8
+ defaultMode: {
9
+ lexems: [hljs.IDENT_RE],
10
+ contains: ['string', 'shebang', 'comment', 'number', 'test_condition', 'string', 'variable'],
11
+ keywords: {
12
+ 'keyword': {'if' : 1, 'then' : 1, 'else' : 1, 'fi' : 1, 'for' : 1, 'break' : 1, 'continue' : 1, 'while' : 1, 'in' : 1, 'do' : 1, 'done' : 1, 'echo' : 1, 'exit' : 1, 'return' : 1, 'set' : 1, 'declare' : 1},
13
+ 'literal': hljs.BASH_LITERAL
14
+ }
15
+ },
16
+ case_insensitive: false,
17
+ modes: [
18
+ {
19
+ className: 'shebang',
20
+ begin: '(#!\\/bin\\/bash)|(#!\\/bin\\/sh)',
21
+ end: '^',
22
+ relevance: 10
23
+ },
24
+ hljs.HASH_COMMENT_MODE,
25
+ {
26
+ className: 'test_condition',
27
+ begin: '\\[ ',
28
+ end: ' \\]',
29
+ contains: ['string', 'variable', 'number'],
30
+ lexems: [hljs.IDENT_RE],
31
+ keywords: {
32
+ 'literal': hljs.BASH_LITERAL
33
+ },
34
+ relevance: 0
35
+ },
36
+ {
37
+ className: 'test_condition',
38
+ begin: '\\[\\[ ',
39
+ end: ' \\]\\]',
40
+ contains: ['string', 'variable', 'number'],
41
+ lexems: [hljs.IDENT_RE],
42
+ keywords: {
43
+ 'literal': hljs.BASH_LITERAL
44
+ }
45
+ },
46
+ {
47
+ className: 'variable',
48
+ begin: '\\$([a-zA-Z0-9_]+)\\b',
49
+ end: '^'
50
+ },
51
+ {
52
+ className: 'variable',
53
+ begin: '\\$\\{(([^}])|(\\\\}))+\\}',
54
+ end: '^',
55
+ contains: ['number']
56
+ },
57
+ {
58
+ className: 'string',
59
+ begin: '"', end: '"',
60
+ illegal: '\\n',
61
+ contains: ['escape', 'variable'],
62
+ relevance: 0
63
+ },
64
+ {
65
+ className: 'string',
66
+ begin: '"', end: '"',
67
+ illegal: '\\n',
68
+ contains: ['escape', 'variable'],
69
+ relevance: 0
70
+ },
71
+ hljs.BACKSLASH_ESCAPE,
72
+ hljs.C_NUMBER_MODE,
73
+ {
74
+ className: 'comment',
75
+ begin: '\\/\\/', end: '$',
76
+ illegal: '.'
77
+ }
78
+ ]
79
+ };
80
+
@@ -0,0 +1,64 @@
1
+ /*
2
+
3
+ Unified and context diff definition (c) Vasily Polovnyov <vast@whiteants.net>
4
+
5
+ */
6
+ hljs.LANGUAGES.diff = {
7
+ case_insensitive: true,
8
+ defaultMode: {
9
+ contains: ['chunk', 'header', 'addition', 'deletion', 'change']
10
+ },
11
+ modes: [
12
+ {
13
+ className: 'chunk',
14
+ begin: '^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$', end:'^',
15
+ relevance: 10
16
+ },
17
+ {
18
+ className: 'chunk',
19
+ begin: '^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$', end: '^',
20
+ relevance: 10
21
+ },
22
+ {
23
+ className: 'chunk',
24
+ begin: '^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$', end: '^',
25
+ relevance: 10
26
+ },
27
+ {
28
+ className: 'header',
29
+ begin: 'Index: ', end: '$'
30
+ },
31
+ {
32
+ className: 'header',
33
+ begin: '=====', end: '=====$'
34
+ },
35
+ {
36
+ className: 'header',
37
+ begin: '^\\-\\-\\-', end: '$'
38
+ },
39
+ {
40
+ className: 'header',
41
+ begin: '^\\*{3} ', end: '$'
42
+ },
43
+ {
44
+ className: 'header',
45
+ begin: '^\\+\\+\\+', end: '$'
46
+ },
47
+ {
48
+ className: 'header',
49
+ begin: '\\*{5}', end: '\\*{5}$'
50
+ },
51
+ {
52
+ className: 'addition',
53
+ begin: '^\\+', end: '$'
54
+ },
55
+ {
56
+ className: 'deletion',
57
+ begin: '^\\-', end: '$'
58
+ },
59
+ {
60
+ className: 'change',
61
+ begin: '^\\!', end: '$'
62
+ }
63
+ ]
64
+ }
@@ -0,0 +1,33 @@
1
+ /*
2
+ DOS definition. Alexander Makarov (http://rmcreative.ru/)
3
+ */
4
+ hljs.DOS_KEYWORDS = {
5
+ 'flow': {'if':1, 'else':1, 'goto':1, 'for':1, 'in':1, 'do':1, 'call':1, 'exit':1, 'not':1, 'exist':1, 'errorlevel':1, 'defined':1, 'equ':1, 'neq':1, 'lss':1, 'leq':1, 'gtr':1, 'geq':1},
6
+ 'keyword':{'shift':1, 'cd':1, 'dir':1, 'echo':1, 'setlocal':1, 'endlocal':1, 'set':1, 'pause':1, 'copy':1},
7
+ 'stream':{'prn':1, 'nul':1, 'lpt3':1, 'lpt2':1, 'lpt1':1, 'con':1, 'com4':1, 'com3':1, 'com2':1, 'com1':1, 'aux':1},
8
+ 'winutils':{'ping':1, 'net':1, 'ipconfig':1, 'taskkill':1, 'xcopy':1, 'ren':1, 'del':1}
9
+ };
10
+
11
+ hljs.LANGUAGES.dos = {
12
+ case_insensitive: true,
13
+ defaultMode: {
14
+ lexems: [hljs.IDENT_RE],
15
+ contains: ['envvar', 'number', 'comment'],
16
+ keywords: hljs.DOS_KEYWORDS
17
+ },
18
+ modes: [
19
+ {
20
+ className: 'number',
21
+ begin: '\\b\\d+', end: '^',
22
+ relevance: 0
23
+ },
24
+ {
25
+ className: 'comment',
26
+ begin: '@?rem', end: '$'
27
+ },
28
+ {
29
+ className: 'envvar',
30
+ begin: '%[^ ]+?%', end: '^'
31
+ }
32
+ ]
33
+ };