mvz-dnote 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/COPYING.rdoc +31 -0
  3. data/HISTORY.rdoc +171 -0
  4. data/README.rdoc +113 -0
  5. data/bin/dnote +4 -0
  6. data/lib/dnote.rb +4 -0
  7. data/lib/dnote.yml +1 -0
  8. data/lib/dnote/core_ext.rb +92 -0
  9. data/lib/dnote/format.rb +173 -0
  10. data/lib/dnote/note.rb +150 -0
  11. data/lib/dnote/notes.rb +320 -0
  12. data/lib/dnote/rake/dnotetask.rb +116 -0
  13. data/lib/dnote/session.rb +269 -0
  14. data/lib/dnote/templates/html.erb +49 -0
  15. data/lib/dnote/templates/html/file.erb +48 -0
  16. data/lib/dnote/templates/html/label.erb +49 -0
  17. data/lib/dnote/templates/html/list.erb +42 -0
  18. data/lib/dnote/templates/json.erb +8 -0
  19. data/lib/dnote/templates/json/file.erb +8 -0
  20. data/lib/dnote/templates/json/label.erb +8 -0
  21. data/lib/dnote/templates/json/list.erb +8 -0
  22. data/lib/dnote/templates/md.erb +19 -0
  23. data/lib/dnote/templates/md/file.erb +14 -0
  24. data/lib/dnote/templates/md/label.erb +19 -0
  25. data/lib/dnote/templates/md/list.erb +10 -0
  26. data/lib/dnote/templates/rdoc.erb +12 -0
  27. data/lib/dnote/templates/rdoc/file.erb +10 -0
  28. data/lib/dnote/templates/rdoc/label.erb +12 -0
  29. data/lib/dnote/templates/rdoc/list.erb +7 -0
  30. data/lib/dnote/templates/soap.erb +4 -0
  31. data/lib/dnote/templates/soap/file.erb +4 -0
  32. data/lib/dnote/templates/soap/label.erb +4 -0
  33. data/lib/dnote/templates/soap/list.erb +4 -0
  34. data/lib/dnote/templates/text.erb +12 -0
  35. data/lib/dnote/templates/text/file.erb +11 -0
  36. data/lib/dnote/templates/text/label.erb +11 -0
  37. data/lib/dnote/templates/text/list.erb +8 -0
  38. data/lib/dnote/templates/xml.erb +23 -0
  39. data/lib/dnote/templates/xml/file.erb +23 -0
  40. data/lib/dnote/templates/xml/label.erb +23 -0
  41. data/lib/dnote/templates/xml/list.erb +14 -0
  42. data/lib/dnote/templates/xoxo.erb +4 -0
  43. data/lib/dnote/templates/xoxo/file.erb +4 -0
  44. data/lib/dnote/templates/xoxo/label.erb +4 -0
  45. data/lib/dnote/templates/xoxo/list.erb +6 -0
  46. data/lib/dnote/templates/yaml.erb +1 -0
  47. data/lib/dnote/templates/yaml/file.erb +1 -0
  48. data/lib/dnote/templates/yaml/label.erb +1 -0
  49. data/lib/dnote/templates/yaml/list.erb +1 -0
  50. data/lib/dnote/version.rb +17 -0
  51. data/test/notes_case.rb +59 -0
  52. data/try/sample.bas +7 -0
  53. data/try/sample.js +11 -0
  54. data/try/sample.rb +11 -0
  55. metadata +131 -0
@@ -0,0 +1,49 @@
1
+ <html>
2
+ <head>
3
+ <title><%= title %></title>
4
+ <style>
5
+ body { margin: 0; padding: 0; font-size: 0.8em; }
6
+ .main {
7
+ width: 800px;
8
+ margin: 0 auto;
9
+ border: 0px solid #ccc;
10
+ padding: 0 20px 20px 20px;
11
+ }
12
+ h1 { margin: 25px 0; font-size: 3em; }
13
+ h2,h3,h4 { margin: 5px 0; padding: 0; color: #444; }
14
+ h2 { letter-spacing: 2px; border-top: 4px solid #ddd; padding: 5px 0; }
15
+ ul { margin: 0; padding: 0; text-align: left; }
16
+ li { margin: 0; padding: 0; text-align: left; }
17
+ a { color: #4488ff; }
18
+ sup { font-size: 0.8em; }
19
+ </style>
20
+ <link rel="stylesheet" href="notes.css" type="text/css">
21
+ </head>
22
+ <body>
23
+ <div class="main">
24
+ <h1><%= title %></h1>
25
+ <div class="notes">
26
+ <% notes.by_label_file.each do |label, per_file| %>
27
+ <h2><%= label %></h2>
28
+ <ol class="set <%= label.downcase %>">
29
+ <% per_file.each do |file, line_notes| %>
30
+ <li><h3><a href="<%= file %>"><%= file %></a></h3><ol class="file" href="<%= file %>">
31
+ <% line_notes.sort!{ |a,b| a.line <=> b.line } %>
32
+ <% line_notes.each do |note| %>
33
+ <li class="note <%= label.downcase %>" ref="<%= note.line %>">
34
+ <%= h note.text %> <sup><a href="<%= note.url %>"><%= note.line %></a></sup>
35
+ <% if note.code? %>
36
+ <pre>
37
+ <%= note.code %>
38
+ </pre>
39
+ <% end %>
40
+ </li>
41
+ <% end %>
42
+ </ol></li>
43
+ <% end %>
44
+ </ol>
45
+ <% end %>
46
+ </div>
47
+ </div>
48
+ </body>
49
+ </html>
@@ -0,0 +1,42 @@
1
+ <html>
2
+ <head>
3
+ <title><%= title %></title>
4
+ <style>
5
+ body { margin: 0; padding: 0; font-size: 0.8em; }
6
+ .main {
7
+ width: 800px;
8
+ margin: 0 auto;
9
+ border: 0px solid #ccc;
10
+ padding: 0 20px 20px 20px;
11
+ }
12
+ h1 { margin: 25px 0; font-size: 3em; }
13
+ h2,h3,h4 { margin: 5px 0; padding: 0; color: #444; }
14
+ h2 { letter-spacing: 2px; border-top: 4px solid #ddd; padding: 5px 0; }
15
+ ul { margin: 0; padding: 0; text-align: left; }
16
+ li { margin: 0; padding: 0; text-align: left; }
17
+ a { color: #4488ff; }
18
+ sup { font-size: 0.8em; }
19
+ </style>
20
+ <link rel="stylesheet" href="notes.css" type="text/css">
21
+ </head>
22
+ <body>
23
+ <div class="main">
24
+ <h1><%= title %></h1>
25
+ <div class="notes">
26
+ <ol>
27
+ <% notes.each do |note| %>
28
+ <li class="note <%= note.label.downcase %>" ref="<%= note.line %>">
29
+ <%= note.label %>: <%= h note.text %>
30
+ <sup><a href="<%= note.url %>"><%= note.file %>: <%= note.line %></a></sup>
31
+ <% if note.code? %>
32
+ <pre>
33
+ <%= note.code %>
34
+ </pre>
35
+ <$ end %>
36
+ </li>
37
+ <% end %>
38
+ </ol>
39
+ </div>
40
+ </div>
41
+ </body>
42
+ </html>
@@ -0,0 +1,8 @@
1
+ <%=
2
+ begin
3
+ require 'json'
4
+ rescue LoadError
5
+ require 'json_pure'
6
+ end
7
+ notes.map{ |n| n.to_h_raw }.to_json
8
+ %>
@@ -0,0 +1,8 @@
1
+ <%=
2
+ begin
3
+ require 'json'
4
+ rescue LoadError
5
+ require 'json_pure'
6
+ end
7
+ notes.by_file.to_json
8
+ %>
@@ -0,0 +1,8 @@
1
+ <%=
2
+ begin
3
+ require 'json'
4
+ rescue LoadError
5
+ require 'json_pure'
6
+ end
7
+ notes.by_label.to_json
8
+ %>
@@ -0,0 +1,8 @@
1
+ <%=
2
+ begin
3
+ require 'json'
4
+ rescue LoadError
5
+ require 'json_pure'
6
+ end
7
+ notes.map{ |n| n.to_h_raw }.to_json
8
+ %>
@@ -0,0 +1,19 @@
1
+ <%= title %>
2
+
3
+ <%= '=' * title.to_s.size %>
4
+
5
+ <% notes.by_label_file.each do |label, per_file| %>
6
+
7
+ <%= label %>
8
+
9
+ <%= '-' * (label.size) %>
10
+
11
+ <% per_file.each do |file, line_notes| %>
12
+
13
+ ### file://<%= file %>
14
+
15
+ <% line_notes.each do |note| %>
16
+ * <%= note %> (<%= note.line %>)
17
+ <% if note.code? %><%= "\n" + note.code.tabset(4).rstrip + "\n\n" %><% end %>
18
+ <% end; end; end %>
19
+
@@ -0,0 +1,14 @@
1
+ <%= title %>
2
+
3
+ <%= '=' * title.size %>
4
+
5
+ <% notes.by_file.each do |file, list| %>
6
+
7
+ file://<%= file %>
8
+ <%= '-' * (file.size + 7) %>
9
+
10
+ <% list.each do |note| %>
11
+ * <%= note %> (<%= note.line %>)
12
+ <% if note.code? %><%= "\n" + note.code.tabset(4).rstrip + "\n\n" %><% end %>
13
+ <% end; end %>
14
+
@@ -0,0 +1,19 @@
1
+ <%= title %>
2
+
3
+ <%= '=' * title.size %>
4
+
5
+ <% notes.by_label_file.each do |label, per_file| %>
6
+
7
+ <%= label %>
8
+
9
+ <%= '-' * (label.size) %>
10
+
11
+ <% per_file.each do |file, line_notes| %>
12
+
13
+ ### file://<%= file %>
14
+
15
+ <% line_notes.each do |note| %>
16
+ * <%= note %> (<%= note.line %>)
17
+ <% if note.code? %><%= "\n" + note.code.tabset(4).rstrip + "\n\n" %><% end %>
18
+ <% end; end; end %>
19
+
@@ -0,0 +1,10 @@
1
+ <%= title %>
2
+
3
+ <%= '=' * title.size %>
4
+
5
+
6
+ <% notes.each_with_index do |note, index| %>
7
+ <%= "%s" % [index+1] %>. <%= note.label %>: <%= h note.textline %> (<%= note.file %>: <%= note.line %>)
8
+ <% if note.code? %><%= "\n" + note.code.tabset(4).rstrip + "\n\n" %><% end %>
9
+ <% end %>
10
+
@@ -0,0 +1,12 @@
1
+ = <%= title %><% notes.by_label_file.each do |label, per_file| %>
2
+
3
+ == <%= label %>
4
+ <% per_file.each do |file, line_notes| %>
5
+
6
+ === file://<%= file %>
7
+
8
+ <% line_notes.each do |note| %>
9
+ * <%= note %> (<%= note.line %>)
10
+ <% if note.code? %><%= "\n" + note.code.tabset(4).rstrip + "\n\n" %><% end %>
11
+ <% end; end; end %>
12
+
@@ -0,0 +1,10 @@
1
+ = <%= title %>
2
+ <% notes.by_file.each do |file, list| %>
3
+
4
+ == file://<%= file %>
5
+
6
+ <% list.each do |note| %>
7
+ * <%= note %> (<%= note.line %>)
8
+ <% if note.code? %><%= "\n" + note.code.tabset(4).rstrip + "\n\n" %><% end %>
9
+ <% end; end %>
10
+
@@ -0,0 +1,12 @@
1
+ = <%= title %><% notes.by_label_file.each do |label, per_file| %>
2
+
3
+ == <%= label %>
4
+ <% per_file.each do |file, line_notes| %>
5
+
6
+ === file://<%= file %>
7
+
8
+ <% line_notes.each do |note| %>
9
+ * <%= note %> (<%= note.line %>)
10
+ <% if note.code? %><%= "\n" + note.code.tabset(4).rstrip + "\n\n" %><% end %>
11
+ <% end; end; end %>
12
+
@@ -0,0 +1,7 @@
1
+ = <%= title %>
2
+
3
+ <% notes.each_with_index do |note, index| %>
4
+ * <%= note.label %>: <%= h note.textline %> (<%= note.file %>: <%= note.line %>)
5
+ <% if note.code? %><%= "\n" + note.code.tabset(4).rstrip + "\n\n" %><% end %>
6
+ <% end %>
7
+
@@ -0,0 +1,4 @@
1
+ <%=
2
+ require 'soap/marshal'
3
+ ::SOAP::Marshal.marshal(notes.to_a)
4
+ %>
@@ -0,0 +1,4 @@
1
+ <%=
2
+ require 'soap/marshal'
3
+ ::SOAP::Marshal.marshal(notes.by_file)
4
+ %>
@@ -0,0 +1,4 @@
1
+ <%=
2
+ require 'soap/marshal'
3
+ ::SOAP::Marshal.marshal(notes.by_label)
4
+ %>
@@ -0,0 +1,4 @@
1
+ <%=
2
+ require 'soap/marshal'
3
+ ::SOAP::Marshal.marshal(notes.to_a)
4
+ %>
@@ -0,0 +1,12 @@
1
+ <%= title %>
2
+
3
+ <% notes.by_label.each do |label, line_notes| %>
4
+
5
+ <%= label %>
6
+
7
+
8
+ <% line_notes.each_with_index do |note, i| %>
9
+ <%= note.text.indent(6).sub(' ' * 6,(" %3s. " % [i+1])) %> (<%= note.file %>:<%= note.line %>)
10
+ <% if note.code? %><%= "\n" + note.code.tabset(8) + "\n" %><% end %>
11
+ <% end; end %>
12
+
@@ -0,0 +1,11 @@
1
+ <%= title %>
2
+
3
+ <% notes.by_file.each do |file, line_notes| %>
4
+
5
+ <%= file %>:
6
+
7
+ <% line_notes.sort!{ |a,b| a.line <=> b.line } %><% line_notes.each do |note| %>
8
+ <%= note.to_s.indent(4).sub(' ' * 4,' * ') %> (<%= note.line %>)
9
+ <% if note.code? %><%= "\n" + note.code.tabset(10) + "\n" %><% end %>
10
+ <% end; end %>
11
+
@@ -0,0 +1,11 @@
1
+ <%= title %>
2
+
3
+ <% notes.by_label.each do |label, line_notes| %>
4
+
5
+ <%= label %>
6
+
7
+
8
+ <% line_notes.each_with_index do |note, i| %>
9
+ <%= note.text.indent(6).sub(' ' * 6,(" %3s. " % [i+1])) %> (<%= note.file %>:<%= note.line %>)
10
+ <% end; end %>
11
+
@@ -0,0 +1,8 @@
1
+ <%= title %>
2
+
3
+
4
+ <% notes.each_with_index do |note, index| %>
5
+ <%= "%4s %s %s" % [index+1, note.label, note.text.gsub("\n", ' ')] %> (<%= note.file %>:<%= note.line %>)
6
+ <% if note.code? %><%= "\n" + note.code.tabset(8) + "\n" %><% end %>
7
+ <% end %>
8
+
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" ?>
2
+ <notes>
3
+ <% notes.by_label_file.each do |label, per_file| %>
4
+ <label name="<%= label %>">
5
+ <% per_file.each do |file, line_notes| %>
6
+ <file src="<%= file %>">
7
+ <% line_notes.sort!{ |a,b| a.line <=> b.line } %>
8
+ <% line_notes.each do |note| %>
9
+ <note line="<%= note.line %>" type="<%= label %>">
10
+ <%= h note.textline %>
11
+ <% if note.code? %>
12
+
13
+ <![CDATA[
14
+ <%= note.code %>
15
+ ]]>
16
+ <% end %>
17
+ </note>
18
+ <% end %>
19
+ </file>
20
+ <% end %>
21
+ </label>
22
+ <% end %>
23
+ </notes>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" ?>
2
+ <notes>
3
+ <% notes.by_file_label.each do |file, per_label| %>
4
+ <file src="<%= file %>">
5
+ <% per_label.each do |label, lnotes| %>
6
+ <label name="<%= label %>">
7
+ <% line_notes.sort!{ |a,b| a.line <=> b.line } %>
8
+ <% line_notes.each do |note| %>
9
+ <note line="<%= note.line %>" type="<%= label %>">
10
+ <%= h note.textline %>
11
+ <% if note.code? %>
12
+
13
+ <![CDATA[
14
+ <%= note.code %>
15
+ ]]>
16
+ <% end %>
17
+ </note>
18
+ <% end %>
19
+ </label>
20
+ <% end %>
21
+ </file>
22
+ <% end %>
23
+ </notes>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" ?>
2
+ <notes>
3
+ <% notes.by_label_file.each do |label, per_file| %>
4
+ <label name="<%= label %>">
5
+ <% per_file.each do |file, line_notes| %>
6
+ <file src="<%= file %>">
7
+ <% line_notes.sort!{ |a,b| a.line <=> b.line } %>
8
+ <% line_notes.each do |note| %>
9
+ <note line="<%= note.line %>" type="<%= label %>">
10
+ <%= h note.textline %>
11
+ <% if note.code? %>
12
+
13
+ <![CDATA[
14
+ <%= note.code %>
15
+ ]]>
16
+ <% end %>
17
+ </note>
18
+ <% end %>
19
+ </file>
20
+ <% end %>
21
+ </label>
22
+ <% end %>
23
+ </notes>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" ?>
2
+ <notes>
3
+ <% notes.each do |note| %>
4
+ <note file="<%= note.file %>" line="<%= note.line %>" type="<%= label %>">
5
+ <%= h note.textline %>
6
+ <% if note.code? %>
7
+
8
+ <![CDATA[
9
+ <%= note.code %>
10
+ ]]>
11
+ <% end %>
12
+ </note>
13
+ <% end %>
14
+ </notes>
@@ -0,0 +1,4 @@
1
+ <%=
2
+ require 'xoxo'
3
+ notes.by_label.to_xoxo
4
+ %>
@@ -0,0 +1,4 @@
1
+ <%=
2
+ require 'xoxo'
3
+ notes.by_file.to_xoxo
4
+ %>
@@ -0,0 +1,4 @@
1
+ <%=
2
+ require 'xoxo'
3
+ notes.by_label.to_xoxo
4
+ %>
@@ -0,0 +1,6 @@
1
+ <%=
2
+ require 'xoxo'
3
+ notes.map{ |n|
4
+ { 'label'=>n.label, 'text'=>n.textline, 'file'=>n.file, 'line'=>n.line }
5
+ }.to_xoxo
6
+ %>
@@ -0,0 +1 @@
1
+ <%= require 'yaml'; notes.map{ |n| n.to_h_raw }.to_yaml %>
@@ -0,0 +1 @@
1
+ <%= require 'yaml'; notes.by_file.to_yaml %>
@@ -0,0 +1 @@
1
+ <%= require 'yaml'; notes.by_label.to_yaml %>