bluedoc-sml 0.6.0 → 0.6.1
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 +4 -4
- data/README.md +1 -1
- data/lib/bluedoc/plantuml.rb +11 -9
- data/lib/bluedoc/sml/rules/heading.rb +6 -2
- data/lib/bluedoc/sml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b42faf5f6a63c5ba48bc3df7157f106ed348b0b1bb9ec5be85fccdb4ce7c8ed1
|
4
|
+
data.tar.gz: b09c64f34316a98d5f4b5df131eadc49dfe055342d877905890d81a221a5097a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5820c42b3eb931a26f24aa52d415623ae369f0fcaf59d8c3f333b0c3fd58118c28a95a746582996cf1812ae22c9fc8a5f6f4c86fe9178280d972c5b04fcd6d5b
|
7
|
+
data.tar.gz: f3925f4ab3884600dabdfaa1eca12230f2cad388e6b5074e3d368b6a447eb6a37367e1d52c7e5ef0948c7922f3995a48e4443d23e57ffb90fde4a0aed4e9659e
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# BlueDoc::SML
|
2
2
|
|
3
|
-
[](https://circleci.com/gh/thebluedoc/bluedoc-sml/tree/master)
|
4
4
|
|
5
5
|
SML __(Slate markup language)__ is a rich text format for describe of the BlueDoc rich contents.
|
6
6
|
|
data/lib/bluedoc/plantuml.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "zlib"
|
2
4
|
|
3
5
|
module BlueDoc
|
@@ -7,7 +9,7 @@ module BlueDoc
|
|
7
9
|
result = ""
|
8
10
|
compressedData = Zlib::Deflate.deflate(text)
|
9
11
|
compressedData.chars.each_slice(3) do |bytes|
|
10
|
-
#print bytes[0], ' ' , bytes[1] , ' ' , bytes[2]
|
12
|
+
# print bytes[0], ' ' , bytes[1] , ' ' , bytes[2]
|
11
13
|
b1 = bytes[0].nil? ? 0 : (bytes[0].ord & 0xFF)
|
12
14
|
b2 = bytes[1].nil? ? 0 : (bytes[1].ord & 0xFF)
|
13
15
|
b3 = bytes[2].nil? ? 0 : (bytes[2].ord & 0xFF)
|
@@ -21,7 +23,7 @@ module BlueDoc
|
|
21
23
|
c2 = ((b1 & 0x3) << 4) | (b2 >> 4)
|
22
24
|
c3 = ((b2 & 0xF) << 2) | (b3 >> 6)
|
23
25
|
c4 = b3 & 0x3F
|
24
|
-
|
26
|
+
encode6bit(c1 & 0x3F).chr +
|
25
27
|
encode6bit(c2 & 0x3F).chr +
|
26
28
|
encode6bit(c3 & 0x3F).chr +
|
27
29
|
encode6bit(c4 & 0x3F).chr
|
@@ -29,25 +31,25 @@ module BlueDoc
|
|
29
31
|
|
30
32
|
def encode6bit(b)
|
31
33
|
if b < 10
|
32
|
-
return (
|
34
|
+
return ("0".ord + b).chr
|
33
35
|
end
|
34
36
|
b = b - 10
|
35
37
|
if b < 26
|
36
|
-
return (
|
38
|
+
return ("A".ord + b).chr
|
37
39
|
end
|
38
40
|
b = b - 26
|
39
41
|
if b < 26
|
40
|
-
return (
|
42
|
+
return ("a".ord + b).chr
|
41
43
|
end
|
42
44
|
b = b - 26
|
43
45
|
if b == 0
|
44
|
-
return
|
46
|
+
return "-"
|
45
47
|
end
|
46
48
|
if b == 1
|
47
|
-
return
|
49
|
+
return "_"
|
48
50
|
end
|
49
|
-
|
51
|
+
"?"
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
53
|
-
end
|
55
|
+
end
|
@@ -10,7 +10,7 @@ module BlueDoc::SML::Rules
|
|
10
10
|
|
11
11
|
def self.to_html(node, opts = {})
|
12
12
|
renderer = opts[:renderer]
|
13
|
-
title = renderer.children_to_html(node) || ""
|
13
|
+
title = (renderer.children_to_html(node) || "").strip
|
14
14
|
heading_tag = tag_name(node)
|
15
15
|
|
16
16
|
title_length = title.length
|
@@ -21,7 +21,11 @@ module BlueDoc::SML::Rules
|
|
21
21
|
header_id = Digest::MD5.hexdigest(title.strip)[0..8]
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
if title.blank?
|
25
|
+
%(<#{heading_tag}>#{title}</#{heading_tag}>)
|
26
|
+
else
|
27
|
+
%(<#{heading_tag} id="#{header_id}"><a href="##{header_id}" class="heading-anchor">#</a>#{title}</#{heading_tag}>)
|
28
|
+
end
|
25
29
|
end
|
26
30
|
end
|
27
31
|
end
|
data/lib/bluedoc/sml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bluedoc-sml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|