source2md 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +106 -29
  3. data/Rakefile +1 -0
  4. data/doc/0100_top.rb +7 -0
  5. data/doc/0110_code_small.rb +4 -1
  6. data/doc/0120_code_long.rb +2 -1
  7. data/doc/0130_hidden.rb +19 -0
  8. data/doc/0140_code_include.rb +26 -0
  9. data/doc/0150_raw_include.rb +16 -0
  10. data/doc/{0130_title.rb → 0160_title.rb} +8 -5
  11. data/doc/{0140_md_like_title.rb → 0170_md_like_title.rb} +9 -6
  12. data/doc/{0150_table.rb → 0180_table.rb} +2 -1
  13. data/doc/{0160_method.rb → 0190_method.rb} +2 -1
  14. data/doc/{0170_alert.rb → 0200_alert.rb} +2 -1
  15. data/doc/0210_text.rb +18 -0
  16. data/doc/0220_text_oneline.rb +18 -0
  17. data/doc/0230_parse_include.rb +18 -0
  18. data/examples/cli.rb +1 -0
  19. data/examples/element_text.rb +2 -1
  20. data/examples/scanner.rb +1 -0
  21. data/examples/{element_alert.rb → type_alert.rb} +6 -5
  22. data/examples/type_code_include.rb +26 -0
  23. data/examples/{element_md_header.rb → type_hidden.rb} +2 -1
  24. data/examples/{element_md_title.rb → type_md_title.rb} +2 -1
  25. data/examples/{element_method.rb → type_method.rb} +2 -1
  26. data/examples/{element_partial_code.rb → type_partial_code.rb} +2 -1
  27. data/examples/{element_deep_comment.rb → type_source_block.rb} +10 -9
  28. data/examples/{element_table.rb → type_table.rb} +1 -0
  29. data/examples/type_text.rb +24 -0
  30. data/examples/{element_title.rb → type_title.rb} +2 -1
  31. data/examples/{element_warn.rb → type_warn.rb} +2 -1
  32. data/lib/source2md/code_block.rb +12 -6
  33. data/lib/source2md/element.rb +17 -16
  34. data/lib/source2md/{type → formatter}/base.rb +4 -5
  35. data/lib/source2md/{type/element_alert.rb → formatter/type_alert.rb} +4 -4
  36. data/lib/source2md/{type/element_include.rb → formatter/type_code_include.rb} +5 -5
  37. data/lib/source2md/{type/element_else.rb → formatter/type_else.rb} +2 -2
  38. data/lib/source2md/{type/element_reject.rb → formatter/type_hidden.rb} +4 -3
  39. data/lib/source2md/{type/element_md_title.rb → formatter/type_md_title.rb} +2 -2
  40. data/lib/source2md/formatter/type_method.rb +24 -0
  41. data/lib/source2md/formatter/type_parse_include.rb +13 -0
  42. data/lib/source2md/{type/element_partial_code.rb → formatter/type_partial_code.rb} +2 -2
  43. data/lib/source2md/formatter/type_raw_include.rb +13 -0
  44. data/lib/source2md/{type/element_source_block.rb → formatter/type_source_block.rb} +9 -2
  45. data/lib/source2md/{type/element_table.rb → formatter/type_table.rb} +2 -2
  46. data/lib/source2md/formatter/type_text.rb +31 -0
  47. data/lib/source2md/{type/element_title.rb → formatter/type_title.rb} +2 -2
  48. data/lib/source2md/{type/element_warn.rb → formatter/type_warn.rb} +4 -4
  49. data/lib/source2md/generator.rb +3 -3
  50. data/lib/source2md/scanner.rb +11 -11
  51. data/lib/source2md/text_helper.rb +5 -1
  52. data/lib/source2md/version.rb +1 -1
  53. data/spec/code_block_spec.rb +1 -1
  54. data/spec/formatter/sample.yml +1 -0
  55. data/spec/{type/element_include_spec.rb → formatter/type_code_include_spec.rb} +6 -6
  56. data/spec/{type/element_reject_spec.rb → formatter/type_hidden_spec.rb} +3 -2
  57. data/spec/formatter/type_parse_include_spec.rb +16 -0
  58. data/spec/{type/element_md_header_spec.rb → formatter/type_raw_include_spec.rb} +2 -6
  59. data/spec/{type/element_source_block_spec.rb → formatter/type_source_block_spec.rb} +9 -0
  60. data/spec/{type/element_text_spec.rb → formatter/type_text_spec.rb} +14 -2
  61. metadata +67 -62
  62. data/doc/0180_text.rb +0 -15
  63. data/doc/0190_raw.rb +0 -19
  64. data/examples/element_include.rb +0 -20
  65. data/examples/element_reject.rb +0 -17
  66. data/examples/element_source_block.rb +0 -28
  67. data/lib/source2md/type/element_deep_comment.rb +0 -19
  68. data/lib/source2md/type/element_md_header.rb +0 -13
  69. data/lib/source2md/type/element_method.rb +0 -24
  70. data/lib/source2md/type/element_uncomment.rb +0 -24
  71. data/spec/type/sample.yml +0 -1
  72. /data/spec/{type/element_alert_spec.rb → formatter/type_alert_spec.rb} +0 -0
  73. /data/spec/{type/element_md_title_spec.rb → formatter/type_md_title_spec.rb} +0 -0
  74. /data/spec/{type/element_method_spec.rb → formatter/type_method_spec.rb} +0 -0
  75. /data/spec/{type/element_partial_code_spec.rb → formatter/type_partial_code_spec.rb} +0 -0
  76. /data/spec/{type/element_table_spec.rb → formatter/type_table_spec.rb} +0 -0
  77. /data/spec/{type/element_title_spec.rb → formatter/type_title_spec.rb} +0 -0
  78. /data/spec/{type/element_warn_spec.rb → formatter/type_warn_spec.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f611630d43ae94215b726f34b9eb21058b116fc5cd680ba1349888183b0568d
4
- data.tar.gz: b77b99e4e0fed12a8ecc1d2b8fec203b9caa88866a25d3649f8c89d0c09bcc28
3
+ metadata.gz: 45ea284efbf369a44f443d19ad9efef483c50d71b7d0a6a3061e22fd0a844ab4
4
+ data.tar.gz: f5e5ae8ac1275e92d6a09161f6561e3ca3ed39e13b821d69a3b5ceae53d23467
5
5
  SHA512:
6
- metadata.gz: e8fa08c336da0fb2873eddc88d114219cd2bde1d1857c637cf9d3fa42ea93a17fa3e724748bdd00e82c9bb8ca97964a6872040f04d99f6a876d71d2f3af9a0c6
7
- data.tar.gz: 250194de04ec0531337df28e83d5f7931ddee724fdf375d617a38e9c51e7217a53715f0cfbc2e05a88b220a48841ee86fb412f2e57d8c3f47aa0697077f85202
6
+ metadata.gz: 9b801b23ca8be860c0f76bbc6e3184b79ee9872b424108b83598dc23362667e00c21eb857c2995698addee97f85bd2995dc421b4f2d6dadd871e7f3db80eb6d0
7
+ data.tar.gz: 4972b72106e655da9078ce8962eb4bd32fbecccd520c1d7d0bd24b7e1029b6d9fa1aa2775ce9b9a4a980fd7af9d373d35be8c1666d67868eb1a04d5589f036cf
data/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Source2MD: Markdown generator from source code #
2
2
 
3
+ ## Logic ##
4
+
5
+ 1. Divide the source code into paragraphs using blank lines as separations.
6
+ 1. Remove comments from the comment blocks.
7
+ 1. Include the code within the code block.
8
+
3
9
  ## Install ##
4
10
 
5
11
  ```
@@ -14,7 +20,9 @@ $ source2md generate -o README.md README.rb
14
20
 
15
21
  ## Rules ##
16
22
 
17
- ### Embedding Of Small Code ###
23
+ ### Code snippet ###
24
+
25
+ Separated by blank lines.
18
26
 
19
27
  ```ruby
20
28
  puts Source2MD::Section.new(<<~EOS).to_md
@@ -36,7 +44,7 @@ EOS
36
44
  > hello.call
37
45
  > ```
38
46
 
39
- ### Source Block ###
47
+ ### Source block with many lines ###
40
48
 
41
49
  ```ruby
42
50
  puts Source2MD::Section.new(<<~EOS).to_md
@@ -58,6 +66,55 @@ EOS
58
66
  > hello.call
59
67
  > ```
60
68
 
69
+ ### Hide paragraph ###
70
+
71
+ ```ruby
72
+ puts Source2MD::Section.new(<<~EOS).to_md
73
+ #+hidden: true
74
+ p "This paragraph is not displayed"
75
+ EOS
76
+ ```
77
+
78
+ ### Code include ###
79
+
80
+ ```ruby
81
+ Insert inside the code block.
82
+ ```
83
+
84
+ ```ruby
85
+ File.write("/tmp/hello.html", "<p>Hello</p>")
86
+
87
+ puts Source2MD::Section.new(<<~EOS).to_md
88
+ #+code_include: /tmp/hello.html
89
+
90
+ #+code_include: /tmp/hello.html xml:OUTPUT
91
+ EOS
92
+ ```
93
+
94
+ > ````
95
+ > ```html:hello.html
96
+ > <p>Hello</p>
97
+ > ```
98
+ >
99
+ > ```xml:OUTPUT
100
+ > <p>Hello</p>
101
+ > ```
102
+ > ````
103
+
104
+ ### Raw include ###
105
+
106
+ ```ruby
107
+ File.write("/tmp/hello.html", "<p>Hello</p>")
108
+
109
+ puts Source2MD::Section.new(<<~EOS).to_md
110
+ #+raw_include: /tmp/hello.html
111
+ EOS
112
+ ```
113
+
114
+ > ```
115
+ > <p>Hello</p>
116
+ > ```
117
+
61
118
  ### Title ###
62
119
 
63
120
  No number limit.
@@ -72,13 +129,15 @@ puts Source2MD::Section.new(<<~EOS).to_md
72
129
  EOS
73
130
  ```
74
131
 
75
- > # Title Level 1 # #
76
- >
77
- > ## Title Level 2 # ##
78
- >
79
- > ### Title Level 3 # ###
132
+ ```
133
+ # Title Level 1 #
80
134
 
81
- ### Markdown Style Title ###
135
+ ## Title Level 2 ##
136
+
137
+ ### Title Level 3 ###
138
+ ```
139
+
140
+ ### Markdown style title ###
82
141
 
83
142
  The condition is that there are the same number of sharps on the back.
84
143
 
@@ -92,13 +151,15 @@ puts Source2MD::Section.new(<<~EOS).to_md
92
151
  EOS
93
152
  ```
94
153
 
95
- > # Title Level 1 #
96
- >
97
- > ## Title Level 2 ##
98
- >
99
- > ### Title Level 3 ###
154
+ ```
155
+ # Title Level 1 #
156
+
157
+ ## Title Level 2 ##
158
+
159
+ ### Title Level 3 ###
160
+ ```
100
161
 
101
- ### Org-mode Table Style ###
162
+ ### Org-mode table style ###
102
163
 
103
164
  ```ruby
104
165
  puts Source2MD::Section.new(<<~EOS).to_md
@@ -132,7 +193,7 @@ EOS
132
193
  > | C++ | 1983 | Bjarne Stroustrup |
133
194
  > | Python | 1989 | Guido van Rossum |
134
195
 
135
- ### Explain the method simply ###
196
+ ### Explain method simply ###
136
197
 
137
198
  ```ruby
138
199
  puts Source2MD::Section.new(<<~EOS).to_md
@@ -168,7 +229,7 @@ EOS
168
229
  >
169
230
  > Comments about reverse
170
231
 
171
- ### Warning, Alert Message ###
232
+ ### Warning and Alert message ###
172
233
 
173
234
  Exclusive to Zenn
174
235
 
@@ -192,34 +253,50 @@ EOS
192
253
  > :::
193
254
  > ```
194
255
 
195
- ### Text ###
256
+ ### Raw Text ###
196
257
 
197
258
  If no rule applies and the text begins with `#`, remove the `#`.
198
259
 
199
260
  ```ruby
200
261
  puts Source2MD::Section.new(<<~EOS).to_md
201
- # Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
202
- # Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
262
+ # Lorem ipsum dolor sit amet, consectetur adipisicing elit,
263
+ # sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
203
264
  EOS
204
265
  ```
205
266
 
206
- > Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
207
- > Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
267
+ > ```
268
+ > Lorem ipsum dolor sit amet, consectetur adipisicing elit,
269
+ > sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
270
+ > ```
208
271
 
209
- ### Raw Text ###
272
+ ### Oneline Text ###
210
273
 
211
- Same rule as when writing text, simply remove the leading `#`.
274
+ Using this option allows you to split a line regardless of the markdown library.
212
275
 
213
276
  ```ruby
214
277
  puts Source2MD::Section.new(<<~EOS).to_md
215
- # <hr>
216
- #
217
- # <hr>
278
+ #+oneline: true
279
+ # Lorem ipsum dolor sit amet, consectetur adipisicing elit,
280
+ # sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
218
281
  EOS
219
282
  ```
220
283
 
221
284
  > ```
222
- > <hr>
223
- >
224
- > <hr>
285
+ > Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
225
286
  > ```
287
+
288
+ ### Parse include ###
289
+
290
+ Paste the results of processing other files with the same rules.
291
+
292
+ ```ruby
293
+ File.write("/tmp/hello.rb", <<~EOS)
294
+ # foo
295
+ EOS
296
+
297
+ puts Source2MD::Section.new(<<~EOS).to_md
298
+ #+parse_include: /tmp/hello.rb
299
+ EOS
300
+ ```
301
+
302
+ > foo
data/Rakefile CHANGED
@@ -9,6 +9,7 @@ task :o => "open"
9
9
  namespace :doc do
10
10
  desc "[g] generate README.md"
11
11
  task "generate" do
12
+ Rake::Task["doc:renum"].execute
12
13
  system "sh", "-vec", <<~EOT, exception: true
13
14
  .bin/source2md generate --no-debug --no-xmp-out-exclude -o README.md doc/0*
14
15
  EOT
data/doc/0100_top.rb CHANGED
@@ -1,7 +1,14 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  # Source2MD: Markdown generator from source code #
4
5
 
6
+ ## Logic ##
7
+
8
+ # 1. Divide the source code into paragraphs using blank lines as separations.
9
+ # 1. Remove comments from the comment blocks.
10
+ # 1. Include the code within the code block.
11
+
5
12
  ## Install ##
6
13
 
7
14
  # ```
@@ -1,6 +1,9 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
- ### Embedding Of Small Code ###
4
+ ### Code snippet ###
5
+
6
+ # Separated by blank lines.
4
7
 
5
8
  #+BEGIN_SRC
6
9
  puts Source2MD::Section.new(<<~EOS).to_md
@@ -1,6 +1,7 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
- ### Source Block ###
4
+ ### Source block with many lines ###
4
5
 
5
6
  #+BEGIN_SRC
6
7
  puts Source2MD::Section.new(<<~EOS).to_md
@@ -0,0 +1,19 @@
1
+ #+hidden: true
2
+ require "./setup"
3
+
4
+ ### Hide paragraph ###
5
+
6
+ #+BEGIN_SRC
7
+ puts Source2MD::Section.new(<<~EOS).to_md
8
+ #+hidden: true
9
+ p "This paragraph is not displayed"
10
+ EOS
11
+ #+END_SRC
12
+
13
+ #+BEGIN_SRC
14
+ puts Source2MD::Section.new(<<~EOS).to_md
15
+ #+BEGIN_SRC hidden!
16
+ p "This paragraph is not displayed"
17
+ #+END_SRC
18
+ EOS
19
+ #+END_SRC
@@ -0,0 +1,26 @@
1
+ #+hidden: true
2
+ require "./setup"
3
+
4
+ ### Code include ###
5
+
6
+ Insert inside the code block.
7
+
8
+ #+BEGIN_SRC
9
+ File.write("/tmp/hello.html", "<p>Hello</p>")
10
+
11
+ puts Source2MD::Section.new(<<~EOS).to_md
12
+ #+code_include: /tmp/hello.html
13
+
14
+ #+code_include: /tmp/hello.html xml:OUTPUT
15
+ EOS
16
+ #+END_SRC
17
+
18
+ # > ````
19
+ # > ```html:hello.html
20
+ # > <p>Hello</p>
21
+ # > ```
22
+ # >
23
+ # > ```xml:OUTPUT
24
+ # > <p>Hello</p>
25
+ # > ```
26
+ # > ````
@@ -0,0 +1,16 @@
1
+ #+hidden: true
2
+ require "./setup"
3
+
4
+ ### Raw include ###
5
+
6
+ #+BEGIN_SRC
7
+ File.write("/tmp/hello.html", "<p>Hello</p>")
8
+
9
+ puts Source2MD::Section.new(<<~EOS).to_md
10
+ #+raw_include: /tmp/hello.html
11
+ EOS
12
+ #+END_SRC
13
+
14
+ # > ```
15
+ # > <p>Hello</p>
16
+ # > ```
@@ -1,3 +1,4 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  ### Title ###
@@ -14,8 +15,10 @@ puts Source2MD::Section.new(<<~EOS).to_md
14
15
  EOS
15
16
  #+END_SRC
16
17
 
17
- # > # Title Level 1 # #
18
- # >
19
- # > ## Title Level 2 # ##
20
- # >
21
- # > ### Title Level 3 # ###
18
+ # ```
19
+ # # Title Level 1 #
20
+ #
21
+ # ## Title Level 2 ##
22
+ #
23
+ # ### Title Level 3 ###
24
+ # ```
@@ -1,6 +1,7 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
- ### Markdown Style Title ###
4
+ ### Markdown style title ###
4
5
 
5
6
  # The condition is that there are the same number of sharps on the back.
6
7
 
@@ -14,8 +15,10 @@ puts Source2MD::Section.new(<<~EOS).to_md
14
15
  EOS
15
16
  #+END_SRC
16
17
 
17
- # > # Title Level 1 #
18
- # >
19
- # > ## Title Level 2 ##
20
- # >
21
- # > ### Title Level 3 ###
18
+ # ```
19
+ # # Title Level 1 #
20
+ #
21
+ # ## Title Level 2 ##
22
+ #
23
+ # ### Title Level 3 ###
24
+ # ```
@@ -1,6 +1,7 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
- ### Org-mode Table Style ###
4
+ ### Org-mode table style ###
4
5
 
5
6
  #+BEGIN_SRC
6
7
  puts Source2MD::Section.new(<<~EOS).to_md
@@ -1,6 +1,7 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
- ### Explain the method simply ###
4
+ ### Explain method simply ###
4
5
 
5
6
  #+BEGIN_SRC
6
7
  puts Source2MD::Section.new(<<~EOS).to_md
@@ -1,6 +1,7 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
- ### Warning, Alert Message ###
4
+ ### Warning and Alert message ###
4
5
 
5
6
  # Exclusive to Zenn
6
7
 
data/doc/0210_text.rb ADDED
@@ -0,0 +1,18 @@
1
+ #+hidden: true
2
+ require "./setup"
3
+
4
+ ### Raw Text ###
5
+
6
+ # If no rule applies and the text begins with `#`, remove the `#`.
7
+
8
+ #+BEGIN_SRC
9
+ puts Source2MD::Section.new(<<~EOS).to_md
10
+ # Lorem ipsum dolor sit amet, consectetur adipisicing elit,
11
+ # sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
12
+ EOS
13
+ #+END_SRC
14
+
15
+ # > ```
16
+ # > Lorem ipsum dolor sit amet, consectetur adipisicing elit,
17
+ # > sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
18
+ # > ```
@@ -0,0 +1,18 @@
1
+ #+hidden: true
2
+ require "./setup"
3
+
4
+ ### Oneline Text ###
5
+
6
+ # Using this option allows you to split a line regardless of the markdown library.
7
+
8
+ #+BEGIN_SRC
9
+ puts Source2MD::Section.new(<<~EOS).to_md
10
+ #+oneline: true
11
+ # Lorem ipsum dolor sit amet, consectetur adipisicing elit,
12
+ # sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
13
+ EOS
14
+ #+END_SRC
15
+
16
+ # > ```
17
+ # > Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
18
+ # > ```
@@ -0,0 +1,18 @@
1
+ #+hidden: true
2
+ require "./setup"
3
+
4
+ ### Parse include ###
5
+
6
+ # Paste the results of processing other files with the same rules.
7
+
8
+ #+BEGIN_SRC
9
+ File.write("/tmp/hello.rb", <<~EOS)
10
+ # foo
11
+ EOS
12
+
13
+ puts Source2MD::Section.new(<<~EOS).to_md
14
+ #+parse_include: /tmp/hello.rb
15
+ EOS
16
+ #+END_SRC
17
+
18
+ # > foo
data/examples/cli.rb CHANGED
@@ -1,3 +1,4 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  Source2MD::Generator.new(files: ["input.rb"], output_file: "output.md").call
@@ -1,3 +1,4 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  puts Source2MD::Element.new(<<~EOS).to_md
@@ -5,7 +6,7 @@ puts Source2MD::Element.new(<<~EOS).to_md
5
6
  # https://example.com/
6
7
  EOS
7
8
  # >> --------------------------------------------------------------------------------
8
- # >> Source2MD::Type::ElementUncomment
9
+ # >> Source2MD::Part::TypeText
9
10
  # >>
10
11
  # >> head:
11
12
  # >> {}
data/examples/scanner.rb CHANGED
@@ -1,3 +1,4 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  Source2MD::Scanner.new(<<~EOS).to_a # => ["foo", "#+BEGIN_SRC\n\nfoo\n\n#+END_SRC", "foo"]
@@ -1,17 +1,18 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  puts Source2MD::Element.new(<<~EOS).to_md
4
5
  #+alert: (foo)
5
6
  EOS
6
7
  # >> --------------------------------------------------------------------------------
7
- # >> Source2MD::Type::ElementAlert
8
- # >>
8
+ # >> Source2MD::Part::TypeAlert
9
+ # >>
9
10
  # >> head:
10
11
  # >> {:alert=>"(foo)"}
11
- # >>
12
+ # >>
12
13
  # >> in:
13
- # >>
14
- # >>
14
+ # >>
15
+ # >>
15
16
  # >> out:
16
17
  # >> :::message alert
17
18
  # >> (foo)
@@ -0,0 +1,26 @@
1
+ #+hidden: true
2
+ require "./setup"
3
+
4
+ puts Source2MD::Element.new(<<~EOS).to_md
5
+
6
+ #+code_include: input.yml
7
+ #+name:
8
+
9
+ EOS
10
+ # >> > -------------------------------------------------------------------------------- Source2MD::Formatter::TypeCodeInclude
11
+ # >> > {"code_include"=>"input.yml", "name"=>""}
12
+ # >> > ------------------------------------------------------------ in
13
+ # >> >
14
+ # >> >
15
+ # >> > ------------------------------------------------------------ out
16
+ # >> > ```yml:
17
+ # >> > ---
18
+ # >> > one:
19
+ # >> > foo: 1
20
+ # >> > ```
21
+ # >> > ------------------------------------------------------------
22
+ # >> ```yml:
23
+ # >> ---
24
+ # >> one:
25
+ # >> foo: 1
26
+ # >> ```
@@ -1,3 +1,4 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  puts Source2MD::Element.new(<<~EOS).to_md
@@ -6,7 +7,7 @@ puts Source2MD::Element.new(<<~EOS).to_md
6
7
  ---
7
8
  EOS
8
9
  # >> --------------------------------------------------------------------------------
9
- # >> Source2MD::Type::ElementMdHeader
10
+ # >> Source2MD::Part::TypeHidden
10
11
  # >>
11
12
  # >> head:
12
13
  # >> {}
@@ -1,9 +1,10 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  puts Source2MD::Element.new(<<~EOS).to_md
4
5
  ## foo ##
5
6
  EOS
6
- # >> > -------------------------------------------------------------------------------- Source2MD::Type::ElementMdTitle
7
+ # >> > -------------------------------------------------------------------------------- Source2MD::Part::TypeMdTitle
7
8
  # >> > {}
8
9
  # >> > ------------------------------------------------------------ in
9
10
  # >> > ## foo ##
@@ -1,3 +1,4 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  puts Source2MD::Element.new(<<~EOS).to_md
@@ -9,7 +10,7 @@ code1
9
10
  code2
10
11
  EOS
11
12
  # >> --------------------------------------------------------------------------------
12
- # >> Source2MD::Type::ElementMethod
13
+ # >> Source2MD::Part::TypeMethod
13
14
  # >>
14
15
  # >> head:
15
16
  # >> {:name=>"(name)", :desc=>"(desc)", :comment=>"(comment)"}
@@ -1,10 +1,11 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  puts Source2MD::Element.new(<<~EOS).to_md
4
5
  (foo)
5
6
  EOS
6
7
  # >> --------------------------------------------------------------------------------
7
- # >> Source2MD::Type::ElementPartialCode
8
+ # >> Source2MD::Part::TypePartialCode
8
9
  # >>
9
10
  # >> head:
10
11
  # >> {}
@@ -1,18 +1,19 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  puts Source2MD::Element.new(<<~EOS).to_md
4
- ## (foo)
5
+ #+BEGIN_SRC diff xxx:yyy hidden!
6
+ (foo)
7
+ #+END_SRC
5
8
  EOS
6
- # >> > -------------------------------------------------------------------------------- Source2MD::Type::ElementPartialCode
9
+ # >> > -------------------------------------------------------------------------------- Source2MD::Formatter::TypeSourceBlock
7
10
  # >> > {}
8
11
  # >> > ------------------------------------------------------------ in
9
- # >> > ## (foo)
12
+ # >> > #+BEGIN_SRC diff xxx:yyy hidden!
13
+ # >> > (foo)
14
+ # >> > #+END_SRC
10
15
  # >> >
11
16
  # >> > ------------------------------------------------------------ out
12
- # >> > ```ruby
13
- # >> > ## (foo)
14
- # >> > ```
17
+ # >> >
15
18
  # >> > ------------------------------------------------------------
16
- # >> ```ruby
17
- # >> ## (foo)
18
- # >> ```
19
+ # >>
@@ -1,3 +1,4 @@
1
+ #+hidden: true
1
2
  require "./setup"
2
3
 
3
4
  puts Source2MD::Element.new(<<~EOS).to_md
@@ -0,0 +1,24 @@
1
+ #+hidden: true
2
+ require "./setup"
3
+
4
+ puts Source2MD::Element.new(<<~EOS).to_md
5
+ #+oneline: true
6
+ # a
7
+ # b
8
+ #
9
+ # c
10
+ # d
11
+ EOS
12
+ # >> > -------------------------------------------------------------------------------- Source2MD::Formatter::TypeText
13
+ # >> > {"oneline"=>"true"}
14
+ # >> > ------------------------------------------------------------ in
15
+ # >> > # a
16
+ # >> > # b
17
+ # >> > #
18
+ # >> > # c
19
+ # >> > # d
20
+ # >> >
21
+ # >> > ------------------------------------------------------------ out
22
+ # >> > abcd
23
+ # >> > ------------------------------------------------------------
24
+ # >> abcd