codesnippet 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6f60a5743af819195ef9baad99ad977f165caedb
4
+ data.tar.gz: 2167ee4bf16b3d045210e26eaeb3c25acb1c412d
5
+ SHA512:
6
+ metadata.gz: f076bd359745779bb552abc0dda200258934fb953d48d2620def5a9244f0491721ec0daac4d39cb825b89882653644d90f536be596296a2e81539c48b33791d8
7
+ data.tar.gz: f5b91c619035ac4d1cf405e52ecc8573bd214e281ed4d686382f0a033718042fe5688876c69618c38b1a66ff193bc79148aed408bdb188718d804b07cd29af8a
@@ -0,0 +1,5 @@
1
+
2
+ require 'compass'
3
+
4
+ extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
5
+ Compass::Frameworks.register('codesnippet', :path => extension_path)
@@ -0,0 +1,29 @@
1
+
2
+ $codesnippet-common-font-size: 1.2em !default;
3
+ $codesnippet-common-font-family: "DejaVu Sans Mono", "Monaco", "Courier New", "monospace" !default;
4
+ $codesnippet-common-line-height: 1.4em !default;
5
+
6
+ @mixin codesnippet-common () {
7
+ font-family: $codesnippet-common-font-family;
8
+ font-size: $codesnippet-common-font-size;
9
+ line-height: $codesnippet-common-line-height;
10
+
11
+ table,
12
+ thead,
13
+ tbody,
14
+ tfoot,
15
+ tr,
16
+ th,
17
+ td,
18
+ code,
19
+ pre,
20
+ tt {
21
+ font-family: $codesnippet-common-font-family;
22
+ font-size: 1em;
23
+ }
24
+
25
+ tr:hover,
26
+ td:hover {
27
+ background-color: inherit;
28
+ }
29
+ }
@@ -0,0 +1,75 @@
1
+
2
+ @mixin codesnippet-highlighter-geshi-theme ($prefix) {
3
+
4
+ $token-selectors: (
5
+ 'comment': '.co1, .co2, .co3, .co4',
6
+ 'comment-multiline': '.coMULTI',
7
+ 'keyword': '.kw1, .kw2',
8
+ 'keyword-constant': '.kw3, .kw4',
9
+ 'operator': '.br0, .sy0, .sy1',
10
+ 'literal-string-double': '.st0',
11
+ 'literal-string-single': '.st_h',
12
+ 'literal-number': '.nu0',
13
+ 'literal-number-oct': '.nu8',
14
+ 'literal-number-hex': '.nu12',
15
+ 'literal-number-float': '.nu19',
16
+ 'name-variable': '.re0',
17
+ // '': '.de1',
18
+ // '': '.imp',
19
+ // '': '.ln',
20
+ // '': '.li2',
21
+ // '': '.es0',
22
+ // '': '.es1',
23
+ // '': '.es2',
24
+ // '': '.es3',
25
+ // '': '.es4',
26
+ // '': '.es5',
27
+ // '': '.es6',
28
+ // '': '.es_h',
29
+ // '': '.st_h',
30
+ // '': '.me1',
31
+ // '': '.me2',
32
+ );
33
+
34
+ @extend %#{$prefix}-default;
35
+
36
+ @each $suffix, $selectors in $token-selectors {
37
+ #{$selectors} {
38
+ @extend %#{$prefix}-#{$suffix};
39
+ }
40
+ }
41
+ }
42
+
43
+ @mixin codesnippet-highlighter-geshi-layout () {
44
+ padding: 0.5em;
45
+
46
+ pre {
47
+ margin: 0;
48
+ padding: 0;
49
+ overflow: inherit;
50
+ }
51
+
52
+ ol {
53
+ display: table;
54
+ padding-left: 0;
55
+ list-style: none;
56
+
57
+ li {
58
+ display: table-row;
59
+ counter-increment: table-ol;
60
+
61
+ &:before {
62
+ display: table-cell;
63
+ padding-right: 0.5em;
64
+ text-align: right;
65
+ content: counter(table-ol) ".";
66
+ }
67
+
68
+ &:after {
69
+ display: block;
70
+ content: "";
71
+ }
72
+ }
73
+ }
74
+
75
+ }
@@ -0,0 +1,85 @@
1
+
2
+ @mixin codesnippet-highlighter-gnushl-theme($prefix) {
3
+
4
+ @extend %#{$prefix}-default;
5
+
6
+ $token-selectors: (
7
+ 'comment': '.comment',
8
+ 'keyword': '.keyword',
9
+ 'keyword-declaration': '.preproc',
10
+ 'literal-number': '.number',
11
+ 'literal-string-single': '.string',
12
+ 'name-variable': '.variable',
13
+ 'name-tag': '.type',
14
+ 'operator': '.symbol, .cbracket',
15
+ 'punctuation': '.cbracket',
16
+ //'name-variable-class': '.variable',
17
+ //'name-variable-global': '.variable',
18
+ //'name-variable-instance': '.variable',
19
+ //'': '.argument',
20
+ //'': '.atom',
21
+ //'': '.attribute',
22
+ //'': '.bibtex',
23
+ //'': '.bold',
24
+ //'': '.cbracket',
25
+ //'': '.classname',
26
+ //'': '.code',
27
+ //'': '.comment',
28
+ //'': '.date',
29
+ //'': '.difflines',
30
+ //'': '.error',
31
+ //'': '.file',
32
+ //'': '.fixed',
33
+ //'': '.function',
34
+ //'': '.ip',
35
+ //'': '.italics',
36
+ //'': '.keyword',
37
+ //'': '.label',
38
+ //'': '.math',
39
+ //'': '.meta',
40
+ //'': '.name',
41
+ //'': '.named ',subexps
42
+ //'': '.newfile',
43
+ //'': '.normal',
44
+ //'': '.number',
45
+ //'': '.oldfile',
46
+ //'': '.optionalargument',
47
+ //'': '.paren',
48
+ //'': '.path',
49
+ //'': '.port',
50
+ //'': '.predef_func',
51
+ //'': '.predef_var',
52
+ //'': '.property',
53
+ //'': '.regex',
54
+ //'': '.regexp',
55
+ //'': '.section',
56
+ //'': '.selector',
57
+ //'': '.specialchar',
58
+ //'': '.string',
59
+ //'': '.symbol',
60
+ //'': '.time',
61
+ //'': '.todo',
62
+ //'': '.twonumbers',
63
+ //'': '.underline',
64
+ //'': '.url',
65
+ //'': '.usertype',
66
+ //'': '.value',
67
+ //'': '.variable',
68
+ //'': '.warning',
69
+ //'': '.webmethod',
70
+ //'': '.whitespace',
71
+ );
72
+
73
+ @each $suffix, $selectors in $token-selectors {
74
+ #{$selectors} {
75
+ @extend %#{$prefix}-#{$suffix};
76
+ }
77
+ }
78
+ }
79
+
80
+ @mixin codesnippet-highlighter-gnushl-layout () {
81
+ pre {
82
+ margin: 0;
83
+ padding: 0.5em;
84
+ }
85
+ }
@@ -0,0 +1,44 @@
1
+
2
+ @mixin codesnippet-highlighter-highlightjs-theme ($prefix, $class-prefix: "hljs-") {
3
+
4
+ @extend %#{$prefix}-default;
5
+
6
+ $token-selectors: (
7
+ 'comment': '.#{$class-prefix}comment',
8
+ 'keyword': '.#{$class-prefix}keyword',
9
+ 'operator': '.#{$class-prefix}symbol',
10
+ 'literal-string': '.#{$class-prefix}string',
11
+ 'literal-number': '.#{$class-prefix}number',
12
+ 'name-variable': '.#{$class-prefix}variable',
13
+ //'': '.de1',
14
+ //'': '.imp',
15
+ //'': '.ln',
16
+ //'': '.li2',
17
+ //'': '.es0',
18
+ //'': '.es1',
19
+ //'': '.es2',
20
+ //'': '.es3',
21
+ //'': '.es4',
22
+ //'': '.es5',
23
+ //'': '.es6',
24
+ //'': '.es_h',
25
+ //'': '.br0',
26
+ //'': '.st_h',
27
+ //'': '.me1',
28
+ //'': '.me2',
29
+ );
30
+
31
+ @each $suffix, $selectors in $token-selectors {
32
+ #{$selectors} {
33
+ @extend %#{$prefix}-#{$suffix};
34
+ }
35
+ }
36
+
37
+ }
38
+
39
+ @mixin codesnippet-highlighter-highlightjs-layout () {
40
+ pre {
41
+ margin: 0;
42
+ padding: 0.5em;
43
+ }
44
+ }
@@ -0,0 +1,89 @@
1
+
2
+ @mixin codesnippet-highlighter-pygments-theme($prefix) {
3
+ @extend %#{$prefix}-default;
4
+
5
+ $token-selectors: (
6
+ 'comment': '.c',
7
+ 'comment-multiline': '.cm, .sd',
8
+ 'comment-preproc': '.cp',
9
+ 'comment-single': '.c1',
10
+ 'comment-special': '.cs',
11
+ 'error': '.err',
12
+ 'generic-emph': '.ge',
13
+ 'generic-strong': '.gs',
14
+ 'keyword': '.k',
15
+ 'keyword-constant': '.kc',
16
+ 'keyword-declaration': '.kd',
17
+ 'keyword-namespace': '.kn',
18
+ 'keyword-pseudo': '.kp',
19
+ 'keyword-reserved': '.kr',
20
+ 'keyword-type': '.kt',
21
+ 'literal': '.l',
22
+ 'literal-date': '.ld',
23
+ 'literal-number': '.m',
24
+ 'literal-string': '.s',
25
+ 'literal-number-float': '.mf',
26
+ 'literal-number-hex': '.mh',
27
+ 'literal-number-integer': '.mi',
28
+ 'literal-number-integer-long': '.il',
29
+ 'literal-number-oct': '.mo',
30
+ 'literal-string-backtick': '.sb',
31
+ 'literal-string-char': '.sc',
32
+ //'literal-string-doc': '',
33
+ 'literal-string-double': '.s2',
34
+ 'literal-string-escape': '.se',
35
+ 'literal-string-heredoc': '.sh',
36
+ 'literal-string-interpol': '.si',
37
+ 'literal-string-other': '.sx',
38
+ 'literal-string-regex': '.sr',
39
+ 'literal-string-single': '.s1',
40
+ 'literal-string-symbol': '.ss',
41
+ 'name': '.n',
42
+ 'name-attribute': '.na',
43
+ 'name-builtin': '.nb',
44
+ 'name-builtin-pseudo': '.bp',
45
+ 'name-class': '.nc',
46
+ 'name-constant': '.no',
47
+ 'name-decorator': '.nd',
48
+ 'name-entity': '.ni',
49
+ 'name-exception': '.ne',
50
+ 'name-function': '.nf',
51
+ 'name-label': '.nl',
52
+ 'name-namespace': '.nn',
53
+ 'name-other': '.nx',
54
+ 'name-property': '.py',
55
+ 'name-tag': '.nt',
56
+ 'name-variable': '.nv',
57
+ 'name-variable-class': '.vc',
58
+ 'name-variable-global': '.vg',
59
+ 'name-variable-instance': '.vi',
60
+ 'operator': '.o',
61
+ 'operator-word': '.ow',
62
+ 'punctuation': '.p',
63
+ 'text-whitespace': '.w',
64
+ );
65
+
66
+ @each $suffix, $selectors in $token-selectors {
67
+ #{$selectors} {
68
+ @extend %#{$prefix}-#{$suffix};
69
+ }
70
+ }
71
+ }
72
+
73
+ @mixin codesnippet-highlighter-pygments-layout() {
74
+ pre {
75
+ margin: 0;
76
+ padding: 0.5em;
77
+ }
78
+
79
+ td {
80
+ padding: 0;
81
+ vertical-align: top;
82
+
83
+ pre {
84
+ padding-right: 0;
85
+ white-space: pre;
86
+ }
87
+ }
88
+
89
+ }
@@ -0,0 +1,105 @@
1
+
2
+ @mixin codesnippet-highlighter-rouge-theme($prefix) {
3
+
4
+ $token-selectors: (
5
+ 'comment': '.c',
6
+ 'comment-multiline': '.cm, .sd',
7
+ 'comment-preproc': '.cp',
8
+ 'comment-single': '.c1',
9
+ 'comment-special': '.cs',
10
+ 'error': '.err',
11
+ 'generic-emph': '.ge',
12
+ 'generic-strong': '.gs',
13
+ 'keyword': '.k',
14
+ 'keyword-constant': '.kc',
15
+ 'keyword-declaration': '.kd',
16
+ 'keyword-namespace': '.kn',
17
+ 'keyword-pseudo': '.kp',
18
+ 'keyword-reserved': '.kr',
19
+ 'keyword-type': '.kt',
20
+ 'literal': '.l',
21
+ 'literal-date': '.ld',
22
+ 'literal-number': '.m',
23
+ 'literal-string': '.s',
24
+ 'literal-number-float': '.mf',
25
+ 'literal-number-hex': '.mh',
26
+ 'literal-number-integer': '.mi',
27
+ 'literal-number-integer-long': '.il',
28
+ 'literal-number-oct': '.mo',
29
+ 'literal-string-backtick': '.sb',
30
+ 'literal-string-char': '.sc',
31
+ //'literal-string-doc': '',
32
+ 'literal-string-double': '.s2',
33
+ 'literal-string-escape': '.se',
34
+ 'literal-string-heredoc': '.sh',
35
+ 'literal-string-interpol': '.si',
36
+ 'literal-string-other': '.sx',
37
+ 'literal-string-regex': '.sr',
38
+ 'literal-string-single': '.s1',
39
+ 'literal-string-symbol': '.ss',
40
+ 'name': '.n',
41
+ 'name-attribute': '.na',
42
+ 'name-builtin': '.nb',
43
+ 'name-builtin-pseudo': '.bp',
44
+ 'name-class': '.nc',
45
+ 'name-constant': '.no',
46
+ 'name-decorator': '.nd',
47
+ 'name-entity': '.ni',
48
+ 'name-exception': '.ne',
49
+ 'name-function': '.nf',
50
+ 'name-label': '.nl',
51
+ 'name-namespace': '.nn',
52
+ 'name-other': '.nx',
53
+ 'name-property': '.py',
54
+ 'name-tag': '.nt',
55
+ 'name-variable': '.nv',
56
+ 'name-variable-class': '.vc',
57
+ 'name-variable-global': '.vg',
58
+ 'name-variable-instance': '.vi',
59
+ 'operator': '.o',
60
+ 'operator-word': '.ow',
61
+ 'punctuation': '.p',
62
+ 'text-whitespace': '.w',
63
+ //'': '.de1',
64
+ //'': '.imp',
65
+ //'': '.ln',
66
+ //'': '.li2',
67
+ //'': '.es0',
68
+ //'': '.es1',
69
+ //'': '.es2',
70
+ //'': '.es3',
71
+ //'': '.es4',
72
+ //'': '.es5',
73
+ //'': '.es6',
74
+ //'': '.es_h',
75
+ //'': '.br0',
76
+ //'': '.st_h',
77
+ //'': '.me1',
78
+ //'': '.me2',
79
+ );
80
+
81
+ @extend %#{$prefix}-default;
82
+
83
+ @each $suffix, $selectors in $token-selectors {
84
+ #{$selectors} {
85
+ @extend %#{$prefix}-#{$suffix};
86
+ }
87
+ }
88
+ }
89
+
90
+ @mixin codesnippet-highlighter-rouge-layout () {
91
+ pre {
92
+ margin: 0;
93
+ padding: 0.5em;
94
+ }
95
+
96
+ td {
97
+ padding: 0;
98
+ vertical-align: top;
99
+
100
+ pre {
101
+ padding-right: 0;
102
+ white-space: pre;
103
+ }
104
+ }
105
+ }