vim_printer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +5 -0
  5. data/.yardopts +2 -0
  6. data/01-seoul256-input.png +0 -0
  7. data/01-seoul256-output.png +0 -0
  8. data/02-Tomorrow-Night-input.png +0 -0
  9. data/02-Tomorrow-Night-output.png +0 -0
  10. data/Gemfile +7 -0
  11. data/Guardfile +15 -0
  12. data/LICENSE +22 -0
  13. data/README.md +192 -0
  14. data/Rakefile +19 -0
  15. data/bin/vim_printer +4 -0
  16. data/lib/vim_printer/cli.rb +119 -0
  17. data/lib/vim_printer/core_ext/hash.rb +56 -0
  18. data/lib/vim_printer/logger.rb +10 -0
  19. data/lib/vim_printer/utility.rb +87 -0
  20. data/lib/vim_printer/version.rb +3 -0
  21. data/lib/vim_printer.rb +7 -0
  22. data/test/fixtures/inputs/demo1.xxx.rb +1 -0
  23. data/test/fixtures/inputs/demo1.yyy.rb +1 -0
  24. data/test/fixtures/inputs/demo2.xxx.rb +1 -0
  25. data/test/fixtures/inputs/demo2.yyy.rb +1 -0
  26. data/test/fixtures/inputs/java/demo3.xxx.java +1 -0
  27. data/test/fixtures/inputs/java/demo3.yyy.java +1 -0
  28. data/test/fixtures/inputs/java/demo4.xxx.java +1 -0
  29. data/test/fixtures/inputs/java/demo4.yyy.java +1 -0
  30. data/test/fixtures/inputs/noexts1_zzz +1 -0
  31. data/test/fixtures/inputs/noexts2_zzz +1 -0
  32. data/test/fixtures/outputs/demo1.xxx.rb.xhtml +91 -0
  33. data/test/fixtures/outputs/demo1.yyy.rb.xhtml +91 -0
  34. data/test/fixtures/outputs/demo2.xxx.rb.xhtml +91 -0
  35. data/test/fixtures/outputs/demo2.yyy.rb.xhtml +91 -0
  36. data/test/fixtures/outputs/java/demo3.xxx.java.xhtml +91 -0
  37. data/test/fixtures/outputs/java/demo3.yyy.java.xhtml +91 -0
  38. data/test/fixtures/outputs/java/demo4.xxx.java.xhtml +91 -0
  39. data/test/fixtures/outputs/java/demo4.yyy.java.xhtml +91 -0
  40. data/test/lib/vim_printer/test_utility.rb +48 -0
  41. data/test/test_helper.rb +12 -0
  42. data/vim_printer.gemspec +34 -0
  43. metadata +289 -0
@@ -0,0 +1,91 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title>~/Dropbox/spikes/vim_printer/test/fixtures/demo1.xxx.rb.xhtml</title>
6
+ <meta name="Generator" content="Vim/7.4" />
7
+ <meta name="plugin-version" content="vim7.4_v1" />
8
+ <meta name="syntax" content="ruby" />
9
+ <meta name="settings" content="no_progress,number_lines,dynamic_folds,no_pre,use_xhtml,use_css,expand_tabs,line_ids,prevent_copy=" />
10
+ <meta name="colorscheme" content="Tomorrow-Night" />
11
+ <style type="text/css">
12
+
13
+ body { color: #bcbcbc; background-color: #262626; font-family: monospace; }
14
+ * { font-size: 1em; }
15
+ .LineNr { color: #4e4e4e; }
16
+ .Comment { color: #8a8a8a; }
17
+ .FoldColumn { color: #00ffff; background-color: #262626; padding-bottom: 1px; }
18
+ .FoldColumn { text-decoration: none; white-space: pre; }
19
+ .open-fold .Folded { display: none; }
20
+ .open-fold .fulltext { display: inline; }
21
+ .open-fold .toggle-open { display: none; }
22
+ .closed-fold .toggle-closed { display: inline; }
23
+
24
+ .closed-fold .fulltext { display: none; }
25
+ .closed-fold .Folded { display: inline; }
26
+ .closed-fold .toggle-open { display: inline; }
27
+ .closed-fold .toggle-closed { display: none; }
28
+
29
+ </style>
30
+
31
+ <script type='text/javascript'>
32
+ //<![CDATA[
33
+
34
+ function toggleFold(objID)
35
+ {
36
+ var fold;
37
+ fold = document.getElementById(objID);
38
+ if(fold.className == 'closed-fold')
39
+ {
40
+ fold.className = 'open-fold';
41
+ }
42
+ else if (fold.className == 'open-fold')
43
+ {
44
+ fold.className = 'closed-fold';
45
+ }
46
+ }
47
+
48
+ /* function to open any folds containing a jumped-to line before jumping to it */
49
+ function JumpToLine()
50
+ {
51
+ var lineNum;
52
+ lineNum = window.location.hash;
53
+ lineNum = lineNum.substr(1); /* strip off '#' */
54
+
55
+ if (lineNum.indexOf('L') == -1) {
56
+ lineNum = 'L'+lineNum;
57
+ }
58
+ lineElem = document.getElementById(lineNum);
59
+
60
+ /* navigate upwards in the DOM tree to open all folds containing the line */
61
+ var node = lineElem;
62
+ while (node && node.id != 'vimCodeElement')
63
+ {
64
+ if (node.className == 'closed-fold')
65
+ {
66
+ node.className = 'open-fold';
67
+ }
68
+ node = node.parentNode;
69
+ }
70
+ /* Always jump to new location even if the line was hidden inside a fold, or
71
+ * we corrected the raw number to a line ID.
72
+ */
73
+ if (lineElem) {
74
+ lineElem.scrollIntoView(true);
75
+ }
76
+ return true;
77
+ }
78
+ if ('onhashchange' in window) {
79
+ window.onhashchange = JumpToLine;
80
+ }
81
+
82
+ //]]>
83
+ </script>
84
+ </head>
85
+ <body onload='JumpToLine();'>
86
+ <div id='vimCodeElement'>
87
+ <span id="L1" class="LineNr">1&#160;</span><span class="Comment"># file: spec/fixtures/demo1.xxx.rb</span><br />
88
+ </div>
89
+ </body>
90
+ </html>
91
+ <!-- vim: set foldmethod=manual : -->
@@ -0,0 +1,91 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title>~/Dropbox/spikes/vim_printer/test/fixtures/demo1.yyy.rb.xhtml</title>
6
+ <meta name="Generator" content="Vim/7.4" />
7
+ <meta name="plugin-version" content="vim7.4_v1" />
8
+ <meta name="syntax" content="ruby" />
9
+ <meta name="settings" content="no_progress,number_lines,dynamic_folds,no_pre,use_xhtml,use_css,expand_tabs,line_ids,prevent_copy=" />
10
+ <meta name="colorscheme" content="Tomorrow-Night" />
11
+ <style type="text/css">
12
+
13
+ body { color: #bcbcbc; background-color: #262626; font-family: monospace; }
14
+ * { font-size: 1em; }
15
+ .LineNr { color: #4e4e4e; }
16
+ .Comment { color: #8a8a8a; }
17
+ .FoldColumn { color: #00ffff; background-color: #262626; padding-bottom: 1px; }
18
+ .FoldColumn { text-decoration: none; white-space: pre; }
19
+ .open-fold .Folded { display: none; }
20
+ .open-fold .fulltext { display: inline; }
21
+ .open-fold .toggle-open { display: none; }
22
+ .closed-fold .toggle-closed { display: inline; }
23
+
24
+ .closed-fold .fulltext { display: none; }
25
+ .closed-fold .Folded { display: inline; }
26
+ .closed-fold .toggle-open { display: inline; }
27
+ .closed-fold .toggle-closed { display: none; }
28
+
29
+ </style>
30
+
31
+ <script type='text/javascript'>
32
+ //<![CDATA[
33
+
34
+ function toggleFold(objID)
35
+ {
36
+ var fold;
37
+ fold = document.getElementById(objID);
38
+ if(fold.className == 'closed-fold')
39
+ {
40
+ fold.className = 'open-fold';
41
+ }
42
+ else if (fold.className == 'open-fold')
43
+ {
44
+ fold.className = 'closed-fold';
45
+ }
46
+ }
47
+
48
+ /* function to open any folds containing a jumped-to line before jumping to it */
49
+ function JumpToLine()
50
+ {
51
+ var lineNum;
52
+ lineNum = window.location.hash;
53
+ lineNum = lineNum.substr(1); /* strip off '#' */
54
+
55
+ if (lineNum.indexOf('L') == -1) {
56
+ lineNum = 'L'+lineNum;
57
+ }
58
+ lineElem = document.getElementById(lineNum);
59
+
60
+ /* navigate upwards in the DOM tree to open all folds containing the line */
61
+ var node = lineElem;
62
+ while (node && node.id != 'vimCodeElement')
63
+ {
64
+ if (node.className == 'closed-fold')
65
+ {
66
+ node.className = 'open-fold';
67
+ }
68
+ node = node.parentNode;
69
+ }
70
+ /* Always jump to new location even if the line was hidden inside a fold, or
71
+ * we corrected the raw number to a line ID.
72
+ */
73
+ if (lineElem) {
74
+ lineElem.scrollIntoView(true);
75
+ }
76
+ return true;
77
+ }
78
+ if ('onhashchange' in window) {
79
+ window.onhashchange = JumpToLine;
80
+ }
81
+
82
+ //]]>
83
+ </script>
84
+ </head>
85
+ <body onload='JumpToLine();'>
86
+ <div id='vimCodeElement'>
87
+ <span id="L1" class="LineNr">1&#160;</span><span class="Comment"># file: spec/fixtures/demo1.yyy.rb</span><br />
88
+ </div>
89
+ </body>
90
+ </html>
91
+ <!-- vim: set foldmethod=manual : -->
@@ -0,0 +1,91 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title>~/Dropbox/spikes/vim_printer/test/fixtures/demo2.xxx.rb.xhtml</title>
6
+ <meta name="Generator" content="Vim/7.4" />
7
+ <meta name="plugin-version" content="vim7.4_v1" />
8
+ <meta name="syntax" content="ruby" />
9
+ <meta name="settings" content="no_progress,number_lines,dynamic_folds,no_pre,use_xhtml,use_css,expand_tabs,line_ids,prevent_copy=" />
10
+ <meta name="colorscheme" content="Tomorrow-Night" />
11
+ <style type="text/css">
12
+
13
+ body { color: #bcbcbc; background-color: #262626; font-family: monospace; }
14
+ * { font-size: 1em; }
15
+ .LineNr { color: #4e4e4e; }
16
+ .Comment { color: #8a8a8a; }
17
+ .FoldColumn { color: #00ffff; background-color: #262626; padding-bottom: 1px; }
18
+ .FoldColumn { text-decoration: none; white-space: pre; }
19
+ .open-fold .Folded { display: none; }
20
+ .open-fold .fulltext { display: inline; }
21
+ .open-fold .toggle-open { display: none; }
22
+ .closed-fold .toggle-closed { display: inline; }
23
+
24
+ .closed-fold .fulltext { display: none; }
25
+ .closed-fold .Folded { display: inline; }
26
+ .closed-fold .toggle-open { display: inline; }
27
+ .closed-fold .toggle-closed { display: none; }
28
+
29
+ </style>
30
+
31
+ <script type='text/javascript'>
32
+ //<![CDATA[
33
+
34
+ function toggleFold(objID)
35
+ {
36
+ var fold;
37
+ fold = document.getElementById(objID);
38
+ if(fold.className == 'closed-fold')
39
+ {
40
+ fold.className = 'open-fold';
41
+ }
42
+ else if (fold.className == 'open-fold')
43
+ {
44
+ fold.className = 'closed-fold';
45
+ }
46
+ }
47
+
48
+ /* function to open any folds containing a jumped-to line before jumping to it */
49
+ function JumpToLine()
50
+ {
51
+ var lineNum;
52
+ lineNum = window.location.hash;
53
+ lineNum = lineNum.substr(1); /* strip off '#' */
54
+
55
+ if (lineNum.indexOf('L') == -1) {
56
+ lineNum = 'L'+lineNum;
57
+ }
58
+ lineElem = document.getElementById(lineNum);
59
+
60
+ /* navigate upwards in the DOM tree to open all folds containing the line */
61
+ var node = lineElem;
62
+ while (node && node.id != 'vimCodeElement')
63
+ {
64
+ if (node.className == 'closed-fold')
65
+ {
66
+ node.className = 'open-fold';
67
+ }
68
+ node = node.parentNode;
69
+ }
70
+ /* Always jump to new location even if the line was hidden inside a fold, or
71
+ * we corrected the raw number to a line ID.
72
+ */
73
+ if (lineElem) {
74
+ lineElem.scrollIntoView(true);
75
+ }
76
+ return true;
77
+ }
78
+ if ('onhashchange' in window) {
79
+ window.onhashchange = JumpToLine;
80
+ }
81
+
82
+ //]]>
83
+ </script>
84
+ </head>
85
+ <body onload='JumpToLine();'>
86
+ <div id='vimCodeElement'>
87
+ <span id="L1" class="LineNr">1&#160;</span><span class="Comment"># file: spec/fixtures/demo2.xxx.rb</span><br />
88
+ </div>
89
+ </body>
90
+ </html>
91
+ <!-- vim: set foldmethod=manual : -->
@@ -0,0 +1,91 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title>~/Dropbox/spikes/vim_printer/test/fixtures/demo2.yyy.rb.xhtml</title>
6
+ <meta name="Generator" content="Vim/7.4" />
7
+ <meta name="plugin-version" content="vim7.4_v1" />
8
+ <meta name="syntax" content="ruby" />
9
+ <meta name="settings" content="no_progress,number_lines,dynamic_folds,no_pre,use_xhtml,use_css,expand_tabs,line_ids,prevent_copy=" />
10
+ <meta name="colorscheme" content="Tomorrow-Night" />
11
+ <style type="text/css">
12
+
13
+ body { color: #bcbcbc; background-color: #262626; font-family: monospace; }
14
+ * { font-size: 1em; }
15
+ .LineNr { color: #4e4e4e; }
16
+ .Comment { color: #8a8a8a; }
17
+ .FoldColumn { color: #00ffff; background-color: #262626; padding-bottom: 1px; }
18
+ .FoldColumn { text-decoration: none; white-space: pre; }
19
+ .open-fold .Folded { display: none; }
20
+ .open-fold .fulltext { display: inline; }
21
+ .open-fold .toggle-open { display: none; }
22
+ .closed-fold .toggle-closed { display: inline; }
23
+
24
+ .closed-fold .fulltext { display: none; }
25
+ .closed-fold .Folded { display: inline; }
26
+ .closed-fold .toggle-open { display: inline; }
27
+ .closed-fold .toggle-closed { display: none; }
28
+
29
+ </style>
30
+
31
+ <script type='text/javascript'>
32
+ //<![CDATA[
33
+
34
+ function toggleFold(objID)
35
+ {
36
+ var fold;
37
+ fold = document.getElementById(objID);
38
+ if(fold.className == 'closed-fold')
39
+ {
40
+ fold.className = 'open-fold';
41
+ }
42
+ else if (fold.className == 'open-fold')
43
+ {
44
+ fold.className = 'closed-fold';
45
+ }
46
+ }
47
+
48
+ /* function to open any folds containing a jumped-to line before jumping to it */
49
+ function JumpToLine()
50
+ {
51
+ var lineNum;
52
+ lineNum = window.location.hash;
53
+ lineNum = lineNum.substr(1); /* strip off '#' */
54
+
55
+ if (lineNum.indexOf('L') == -1) {
56
+ lineNum = 'L'+lineNum;
57
+ }
58
+ lineElem = document.getElementById(lineNum);
59
+
60
+ /* navigate upwards in the DOM tree to open all folds containing the line */
61
+ var node = lineElem;
62
+ while (node && node.id != 'vimCodeElement')
63
+ {
64
+ if (node.className == 'closed-fold')
65
+ {
66
+ node.className = 'open-fold';
67
+ }
68
+ node = node.parentNode;
69
+ }
70
+ /* Always jump to new location even if the line was hidden inside a fold, or
71
+ * we corrected the raw number to a line ID.
72
+ */
73
+ if (lineElem) {
74
+ lineElem.scrollIntoView(true);
75
+ }
76
+ return true;
77
+ }
78
+ if ('onhashchange' in window) {
79
+ window.onhashchange = JumpToLine;
80
+ }
81
+
82
+ //]]>
83
+ </script>
84
+ </head>
85
+ <body onload='JumpToLine();'>
86
+ <div id='vimCodeElement'>
87
+ <span id="L1" class="LineNr">1&#160;</span><span class="Comment"># file: spec/fixtures/demo2.yyy.rb</span><br />
88
+ </div>
89
+ </body>
90
+ </html>
91
+ <!-- vim: set foldmethod=manual : -->
@@ -0,0 +1,91 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title>~/Dropbox/spikes/vim_printer/test/fixtures/java/demo3.xxx.java.xhtml</title>
6
+ <meta name="Generator" content="Vim/7.4" />
7
+ <meta name="plugin-version" content="vim7.4_v1" />
8
+ <meta name="syntax" content="java" />
9
+ <meta name="settings" content="no_progress,number_lines,dynamic_folds,no_pre,use_xhtml,use_css,expand_tabs,line_ids,prevent_copy=" />
10
+ <meta name="colorscheme" content="Tomorrow-Night" />
11
+ <style type="text/css">
12
+
13
+ body { color: #bcbcbc; background-color: #262626; font-family: monospace; }
14
+ * { font-size: 1em; }
15
+ .LineNr { color: #4e4e4e; }
16
+ .Comment { color: #8a8a8a; }
17
+ .FoldColumn { color: #00ffff; background-color: #262626; padding-bottom: 1px; }
18
+ .FoldColumn { text-decoration: none; white-space: pre; }
19
+ .open-fold .Folded { display: none; }
20
+ .open-fold .fulltext { display: inline; }
21
+ .open-fold .toggle-open { display: none; }
22
+ .closed-fold .toggle-closed { display: inline; }
23
+
24
+ .closed-fold .fulltext { display: none; }
25
+ .closed-fold .Folded { display: inline; }
26
+ .closed-fold .toggle-open { display: inline; }
27
+ .closed-fold .toggle-closed { display: none; }
28
+
29
+ </style>
30
+
31
+ <script type='text/javascript'>
32
+ //<![CDATA[
33
+
34
+ function toggleFold(objID)
35
+ {
36
+ var fold;
37
+ fold = document.getElementById(objID);
38
+ if(fold.className == 'closed-fold')
39
+ {
40
+ fold.className = 'open-fold';
41
+ }
42
+ else if (fold.className == 'open-fold')
43
+ {
44
+ fold.className = 'closed-fold';
45
+ }
46
+ }
47
+
48
+ /* function to open any folds containing a jumped-to line before jumping to it */
49
+ function JumpToLine()
50
+ {
51
+ var lineNum;
52
+ lineNum = window.location.hash;
53
+ lineNum = lineNum.substr(1); /* strip off '#' */
54
+
55
+ if (lineNum.indexOf('L') == -1) {
56
+ lineNum = 'L'+lineNum;
57
+ }
58
+ lineElem = document.getElementById(lineNum);
59
+
60
+ /* navigate upwards in the DOM tree to open all folds containing the line */
61
+ var node = lineElem;
62
+ while (node && node.id != 'vimCodeElement')
63
+ {
64
+ if (node.className == 'closed-fold')
65
+ {
66
+ node.className = 'open-fold';
67
+ }
68
+ node = node.parentNode;
69
+ }
70
+ /* Always jump to new location even if the line was hidden inside a fold, or
71
+ * we corrected the raw number to a line ID.
72
+ */
73
+ if (lineElem) {
74
+ lineElem.scrollIntoView(true);
75
+ }
76
+ return true;
77
+ }
78
+ if ('onhashchange' in window) {
79
+ window.onhashchange = JumpToLine;
80
+ }
81
+
82
+ //]]>
83
+ </script>
84
+ </head>
85
+ <body onload='JumpToLine();'>
86
+ <div id='vimCodeElement'>
87
+ <span id="L1" class="LineNr">1&#160;</span><span class="Comment">// file: test/fixtures/java/demo3.xxx.java</span><br />
88
+ </div>
89
+ </body>
90
+ </html>
91
+ <!-- vim: set foldmethod=manual : -->
@@ -0,0 +1,91 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title>~/Dropbox/spikes/vim_printer/test/fixtures/java/demo3.yyy.java.xhtml</title>
6
+ <meta name="Generator" content="Vim/7.4" />
7
+ <meta name="plugin-version" content="vim7.4_v1" />
8
+ <meta name="syntax" content="java" />
9
+ <meta name="settings" content="no_progress,number_lines,dynamic_folds,no_pre,use_xhtml,use_css,expand_tabs,line_ids,prevent_copy=" />
10
+ <meta name="colorscheme" content="Tomorrow-Night" />
11
+ <style type="text/css">
12
+
13
+ body { color: #bcbcbc; background-color: #262626; font-family: monospace; }
14
+ * { font-size: 1em; }
15
+ .LineNr { color: #4e4e4e; }
16
+ .Comment { color: #8a8a8a; }
17
+ .FoldColumn { color: #00ffff; background-color: #262626; padding-bottom: 1px; }
18
+ .FoldColumn { text-decoration: none; white-space: pre; }
19
+ .open-fold .Folded { display: none; }
20
+ .open-fold .fulltext { display: inline; }
21
+ .open-fold .toggle-open { display: none; }
22
+ .closed-fold .toggle-closed { display: inline; }
23
+
24
+ .closed-fold .fulltext { display: none; }
25
+ .closed-fold .Folded { display: inline; }
26
+ .closed-fold .toggle-open { display: inline; }
27
+ .closed-fold .toggle-closed { display: none; }
28
+
29
+ </style>
30
+
31
+ <script type='text/javascript'>
32
+ //<![CDATA[
33
+
34
+ function toggleFold(objID)
35
+ {
36
+ var fold;
37
+ fold = document.getElementById(objID);
38
+ if(fold.className == 'closed-fold')
39
+ {
40
+ fold.className = 'open-fold';
41
+ }
42
+ else if (fold.className == 'open-fold')
43
+ {
44
+ fold.className = 'closed-fold';
45
+ }
46
+ }
47
+
48
+ /* function to open any folds containing a jumped-to line before jumping to it */
49
+ function JumpToLine()
50
+ {
51
+ var lineNum;
52
+ lineNum = window.location.hash;
53
+ lineNum = lineNum.substr(1); /* strip off '#' */
54
+
55
+ if (lineNum.indexOf('L') == -1) {
56
+ lineNum = 'L'+lineNum;
57
+ }
58
+ lineElem = document.getElementById(lineNum);
59
+
60
+ /* navigate upwards in the DOM tree to open all folds containing the line */
61
+ var node = lineElem;
62
+ while (node && node.id != 'vimCodeElement')
63
+ {
64
+ if (node.className == 'closed-fold')
65
+ {
66
+ node.className = 'open-fold';
67
+ }
68
+ node = node.parentNode;
69
+ }
70
+ /* Always jump to new location even if the line was hidden inside a fold, or
71
+ * we corrected the raw number to a line ID.
72
+ */
73
+ if (lineElem) {
74
+ lineElem.scrollIntoView(true);
75
+ }
76
+ return true;
77
+ }
78
+ if ('onhashchange' in window) {
79
+ window.onhashchange = JumpToLine;
80
+ }
81
+
82
+ //]]>
83
+ </script>
84
+ </head>
85
+ <body onload='JumpToLine();'>
86
+ <div id='vimCodeElement'>
87
+ <span id="L1" class="LineNr">1&#160;</span><span class="Comment">// file: test/fixtures/java/demo3.yyy.java</span><br />
88
+ </div>
89
+ </body>
90
+ </html>
91
+ <!-- vim: set foldmethod=manual : -->
@@ -0,0 +1,91 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title>~/Dropbox/spikes/vim_printer/test/fixtures/java/demo4.xxx.java.xhtml</title>
6
+ <meta name="Generator" content="Vim/7.4" />
7
+ <meta name="plugin-version" content="vim7.4_v1" />
8
+ <meta name="syntax" content="java" />
9
+ <meta name="settings" content="no_progress,number_lines,dynamic_folds,no_pre,use_xhtml,use_css,expand_tabs,line_ids,prevent_copy=" />
10
+ <meta name="colorscheme" content="Tomorrow-Night" />
11
+ <style type="text/css">
12
+
13
+ body { color: #bcbcbc; background-color: #262626; font-family: monospace; }
14
+ * { font-size: 1em; }
15
+ .LineNr { color: #4e4e4e; }
16
+ .Comment { color: #8a8a8a; }
17
+ .FoldColumn { color: #00ffff; background-color: #262626; padding-bottom: 1px; }
18
+ .FoldColumn { text-decoration: none; white-space: pre; }
19
+ .open-fold .Folded { display: none; }
20
+ .open-fold .fulltext { display: inline; }
21
+ .open-fold .toggle-open { display: none; }
22
+ .closed-fold .toggle-closed { display: inline; }
23
+
24
+ .closed-fold .fulltext { display: none; }
25
+ .closed-fold .Folded { display: inline; }
26
+ .closed-fold .toggle-open { display: inline; }
27
+ .closed-fold .toggle-closed { display: none; }
28
+
29
+ </style>
30
+
31
+ <script type='text/javascript'>
32
+ //<![CDATA[
33
+
34
+ function toggleFold(objID)
35
+ {
36
+ var fold;
37
+ fold = document.getElementById(objID);
38
+ if(fold.className == 'closed-fold')
39
+ {
40
+ fold.className = 'open-fold';
41
+ }
42
+ else if (fold.className == 'open-fold')
43
+ {
44
+ fold.className = 'closed-fold';
45
+ }
46
+ }
47
+
48
+ /* function to open any folds containing a jumped-to line before jumping to it */
49
+ function JumpToLine()
50
+ {
51
+ var lineNum;
52
+ lineNum = window.location.hash;
53
+ lineNum = lineNum.substr(1); /* strip off '#' */
54
+
55
+ if (lineNum.indexOf('L') == -1) {
56
+ lineNum = 'L'+lineNum;
57
+ }
58
+ lineElem = document.getElementById(lineNum);
59
+
60
+ /* navigate upwards in the DOM tree to open all folds containing the line */
61
+ var node = lineElem;
62
+ while (node && node.id != 'vimCodeElement')
63
+ {
64
+ if (node.className == 'closed-fold')
65
+ {
66
+ node.className = 'open-fold';
67
+ }
68
+ node = node.parentNode;
69
+ }
70
+ /* Always jump to new location even if the line was hidden inside a fold, or
71
+ * we corrected the raw number to a line ID.
72
+ */
73
+ if (lineElem) {
74
+ lineElem.scrollIntoView(true);
75
+ }
76
+ return true;
77
+ }
78
+ if ('onhashchange' in window) {
79
+ window.onhashchange = JumpToLine;
80
+ }
81
+
82
+ //]]>
83
+ </script>
84
+ </head>
85
+ <body onload='JumpToLine();'>
86
+ <div id='vimCodeElement'>
87
+ <span id="L1" class="LineNr">1&#160;</span><span class="Comment">// file: test/fixtures/java/demo4.xxx.java</span><br />
88
+ </div>
89
+ </body>
90
+ </html>
91
+ <!-- vim: set foldmethod=manual : -->