mdx-tex 0.1.10 → 0.1.11

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1445c84b79d3839f67f786d03c5f2ca3639acdd88a0e16250c477934c37b5c7b
4
- data.tar.gz: e0a60dd96456b945d31ea20a9c695f130636ba60d449b755ea086b7e5b1f6761
3
+ metadata.gz: e8b32c8e4c6ace0e3ae05f67c941839f6b2eb60a907b5961f7068a9e4a6c141d
4
+ data.tar.gz: 5b5c0cf00f434f2ef571d68203b6fc93279b9710cca9fdac68cf50fbb3de12a5
5
5
  SHA512:
6
- metadata.gz: c92ec8da08b5794f6ed990c71afbbe1f7092eee06e43bf8c63451b3c0dc86625d7fdf529007f592baaf80e5a692e53f11eb6ccea05811c14ce97d80192596fa9
7
- data.tar.gz: a03042264fd9b7675a75a35af09361f05da24724bdbef88027e41a6fda6212781c1b2400700538ac9a54b75e45baee30269f52a380b505505362f1a48e3dd1e0
6
+ metadata.gz: e645ed99556afc0982ff09ad7dfd2cc967c943ad3aa4441df092583738357b852507eeb928b414d9f9aae98474e0e6c1cf54ae5238ff79237bf49181f9f389d3
7
+ data.tar.gz: b0c8df3a5d0dc1e49ef3b0dc83d2c730580853e05611e51446f53b77c19a33cb172f61b44be2a89db1590a8e02820f3ed424820eefbd7cde774861b3e1f3c308
@@ -14,10 +14,12 @@ module MdxTex
14
14
  # MdxTex.to_textile(markdown: markdown, list_depth: 1)
15
15
  class Configuration
16
16
  attr_reader :header_level, :list_depth
17
+ attr_accessor :enable_string_extension
17
18
 
18
19
  def initialize
19
20
  @header_level = 'h3'
20
21
  @list_depth = 3
22
+ @enable_string_extension = false
21
23
  end
22
24
 
23
25
  def header_level=(value)
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MdxTex
4
+ module CoreExt
5
+ module String
6
+ def to_textile(**options)
7
+ MdxTex.to_textile(markdown: self, **options)
8
+ end
9
+ end
10
+ end
11
+ end
12
+
13
+ String.include(MdxTex::CoreExt::String)
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MdxTex
4
+ class Railtie < Rails::Railtie
5
+ initializer 'mdx_tex.string_extension' do
6
+ MdxTex.load_string_extension! if MdxTex.configuration.enable_string_extension
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MdxTex
4
- VERSION = '0.1.10'
4
+ VERSION = '0.1.11'
5
5
  end
data/lib/mdx_tex.rb CHANGED
@@ -20,5 +20,11 @@ module MdxTex
20
20
  merged = { header_level: configuration.header_level, list_depth: configuration.list_depth }.merge(options)
21
21
  MdxTex::ToTextile.new(**merged).execute(markdown)
22
22
  end
23
+
24
+ def load_string_extension!
25
+ require 'mdx_tex/core_ext/string'
26
+ end
23
27
  end
24
28
  end
29
+
30
+ require 'mdx_tex/railtie' if defined?(Rails::Railtie)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdx-tex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gloria Budiman
@@ -22,6 +22,8 @@ files:
22
22
  - lib/mdx/tex.rb
23
23
  - lib/mdx_tex.rb
24
24
  - lib/mdx_tex/configuration.rb
25
+ - lib/mdx_tex/core_ext/string.rb
26
+ - lib/mdx_tex/railtie.rb
25
27
  - lib/mdx_tex/to_textile.rb
26
28
  - lib/mdx_tex/to_textile/bold.rb
27
29
  - lib/mdx_tex/to_textile/errors.rb
@@ -29,14 +31,14 @@ files:
29
31
  - lib/mdx_tex/to_textile/ordered_list.rb
30
32
  - lib/mdx_tex/to_textile/unordered_list.rb
31
33
  - lib/mdx_tex/version.rb
32
- homepage: https://github.com/gbudiman/mark-left
34
+ homepage: https://github.com/gbudiman/mdx-tex
33
35
  licenses:
34
36
  - MIT
35
37
  metadata:
36
38
  rubygems_mfa_required: 'true'
37
- homepage_uri: https://github.com/gbudiman/mark-left
38
- source_code_uri: https://github.com/gbudiman/mark-left
39
- changelog_uri: https://github.com/gbudiman/mark-left/blob/main/CHANGELOG.md
39
+ homepage_uri: https://github.com/gbudiman/mdx-tex
40
+ source_code_uri: https://github.com/gbudiman/mdx-tex
41
+ changelog_uri: https://github.com/gbudiman/mdx-tex/blob/main/CHANGELOG.md
40
42
  post_install_message:
41
43
  rdoc_options: []
42
44
  require_paths: