documentation-editor 0.11.1 → 0.12.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2be27160f41ee85490c83d85b751c935771dcbd
|
4
|
+
data.tar.gz: 82e49eb9fd73cc4927498c57217289fe2ba70e47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d610cf14999eaf17070997e6b786b68875be7121f0194352d6b979b9fc0cc74bc4507448dda2a0f2a9188ce42808270705f8b607a744d3f708cd0a5405857255
|
7
|
+
data.tar.gz: a5862abaae29bf7d6947afda0d99c8bfed19952fa5f8168cf052683a076776fc7192e5c2b658eba57bc2f51aecc137d4f1abb67ff073622360ca1faf2469e029
|
data/README.md
CHANGED
@@ -116,6 +116,9 @@ DocumentationEditor::Config.paperclip_options = {
|
|
116
116
|
|
117
117
|
# to wrap your h1 sections with `<section>` tags
|
118
118
|
DocumentationEditor::Config.wrap_h1_with_sections = true
|
119
|
+
|
120
|
+
# to lower all title levels by 1 (h1 -> h2, h2 -> h3, ..)
|
121
|
+
DocumentationEditor::Config.lower_title_levels = true
|
119
122
|
```
|
120
123
|
|
121
124
|
## Extensions
|
@@ -4,6 +4,7 @@ module DocumentationEditor
|
|
4
4
|
|
5
5
|
def to_html(options = {})
|
6
6
|
options = defaulted(options)
|
7
|
+
options[:lower_title_levels] = DocumentationEditor::Config.lower_title_levels
|
7
8
|
html = parse_document(options).to_html
|
8
9
|
# resolve the variables
|
9
10
|
html = resolve_variables(options, html)
|
@@ -55,7 +56,8 @@ module DocumentationEditor
|
|
55
56
|
|
56
57
|
private
|
57
58
|
def parse_document(options)
|
58
|
-
|
59
|
+
markdown_content = options[:lower_title_levels] ? content.gsub(/^#/, '##') : content
|
60
|
+
doc = Kramdown::Document.new(markdown_content, options.merge(input: 'BlockKramdown'))
|
59
61
|
|
60
62
|
# apply the /if filtering
|
61
63
|
doc.root.children = apply_filtering(doc.root.children, options, [])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: documentation-editor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Algolia Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|