source2md 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 563959d92fa1520a3e09544319ff3eb9a50ac0136cc68edb290b98dc6d005e4e
4
- data.tar.gz: 895fe538bd66ae956f5892b8278a4f7936140e78e07231d2cab7e6d926834b78
3
+ metadata.gz: 3477e280893742563cabf28b242a48d0efdc0943294c902a0fd7085950213b6a
4
+ data.tar.gz: 6a0c6f3b324fe3cd6b6d6e9fd1c038fba91dcbaf3aff742cf8f80ef2129c49a7
5
5
  SHA512:
6
- metadata.gz: 83fc8fd71c70f95f3ccdb05b3119ea21dd6a09df913b58b254783189fefd2a370bdffd4d9becf77285ab2c7594a95b8529271f6b1587e94977ee023e4ebffbfb
7
- data.tar.gz: 02d4b91d972ce7aeffb30dcd9af76001bbf2d2385e2082cc0db4e0e71d1e6e043930e404651dcff5e63606955b97c28b04d8d2f7b8b34963dd1426ca407528fe
6
+ metadata.gz: be3fb7b9ef5f24186a2b613fd10d42d5d0bbad7781d99b9ac72251dda336b13d50737febd993f6d5ecfc0dfe83fb87930c317b3dc21475afe593e1fecea5173b
7
+ data.tar.gz: 0e68f783920b8abb32a1e405cecc4f0f881cf9bc71f4b3b2f13fff444b8272b8361d37389f10c4085b55be51c67a439d6ddbc5061bda776a4255797a9ecf1cd3
data/README.md CHANGED
@@ -32,6 +32,7 @@ puts Source2MD::Section.new(<<~EOS).to_md
32
32
  "Hello, world!"
33
33
  }
34
34
 
35
+ #+code_block_name: (name)
35
36
  hello.call
36
37
  EOS
37
38
  ```
@@ -42,7 +43,7 @@ EOS
42
43
  > }
43
44
  > ```
44
45
 
45
- > ```ruby
46
+ > ```ruby:(name)
46
47
  > hello.call
47
48
  > ```
48
49
 
@@ -11,6 +11,7 @@ puts Source2MD::Section.new(<<~EOS).to_md
11
11
  "Hello, world!"
12
12
  }
13
13
 
14
+ #+code_block_name: (name)
14
15
  hello.call
15
16
  EOS
16
17
  #+END_SRC
@@ -21,9 +22,10 @@ EOS
21
22
  # > }
22
23
  # > ```
23
24
 
24
- # > ```ruby
25
+ # > ```ruby:(name)
25
26
  # > hello.call
26
27
  # > ```
28
+
27
29
  # >> ```ruby
28
30
  # >> hello = -> {
29
31
  # >> "Hello, world!"
@@ -31,6 +33,6 @@ EOS
31
33
  # >> ```
32
34
  # >>
33
35
  # >>
34
- # >> ```ruby
36
+ # >> ```ruby:(name)
35
37
  # >> hello.call
36
38
  # >> ```
@@ -4,13 +4,14 @@ require "./setup"
4
4
  Source2MD.data_block_exclude = true
5
5
 
6
6
  puts Source2MD::Element.new(<<~EOS).to_md
7
+ #+code_block_name: foo
7
8
  a
8
9
  b
9
10
  c
10
11
  __END__
11
12
  foo
12
13
  EOS
13
- # >> head: {}
14
+ # >> head: {"code_block_name"=>"foo"}
14
15
  # >> body: "a\n b\nc\n__END__\nfoo\n"
15
16
  # >> Source2MD::Formatter::TypeHidden => false
16
17
  # >> Source2MD::Formatter::TypeCodeInclude =>
@@ -25,7 +26,7 @@ EOS
25
26
  # >> Source2MD::Formatter::TypeText => false
26
27
  # >> Source2MD::Formatter::TypePartialCode => true
27
28
  # >> > -------------------------------------------------------------------------------- Source2MD::Formatter::TypePartialCode
28
- # >> > {}
29
+ # >> > {"code_block_name"=>"foo"}
29
30
  # >> > ------------------------------------------------------------ in
30
31
  # >> > a
31
32
  # >> > b
@@ -35,14 +36,14 @@ EOS
35
36
  # >> >
36
37
  # >> >
37
38
  # >> > ------------------------------------------------------------ out
38
- # >> > ```ruby
39
+ # >> > ```ruby:foo
39
40
  # >> > a
40
41
  # >> > b
41
42
  # >> > c
42
43
  # >> > ```
43
44
  # >> >
44
45
  # >> > ------------------------------------------------------------
45
- # >> ```ruby
46
+ # >> ```ruby:foo
46
47
  # >> a
47
48
  # >> b
48
49
  # >> c
@@ -6,7 +6,7 @@ module Source2MD
6
6
  end
7
7
 
8
8
  def to_md
9
- CodeBlock.new(body).to_md
9
+ CodeBlock.new(body, name: element.head["code_block_name"]).to_md
10
10
  end
11
11
 
12
12
  private
@@ -1,3 +1,3 @@
1
1
  module Source2MD
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
data/lib/source2md.rb CHANGED
@@ -1,5 +1,5 @@
1
+ require "active_support"
1
2
  require "active_support/logger"
2
- require "active_support/isolated_execution_state"
3
3
 
4
4
  require "active_support/core_ext/hash"
5
5
  require "active_support/core_ext/string"
@@ -4,13 +4,14 @@ module Source2MD
4
4
  describe do
5
5
  it "works" do
6
6
  actual = Element.new(<<~EOS).to_md
7
+ #+code_block_name: xxx
7
8
  (foo)
8
9
  __END__
9
10
  1
10
11
  2
11
12
  EOS
12
13
  actual.should == <<~EOS
13
- ```ruby
14
+ ```ruby:xxx
14
15
  (foo)
15
16
  ```
16
17
  EOS
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: source2md
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Ikeda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-02 00:00:00.000000000 Z
11
+ date: 2023-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  - !ruby/object:Gem::Version
251
251
  version: '0'
252
252
  requirements: []
253
- rubygems_version: 3.4.19
253
+ rubygems_version: 3.4.20
254
254
  signing_key:
255
255
  specification_version: 4
256
256
  summary: Markdown generator from source code