documentation-editor 0.3.1 → 0.3.2
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: 128ed59d24e3216bc8c4307d0bafb76035e8436b
|
4
|
+
data.tar.gz: 26ed4bd0fe4caa858601549f24f9efb59a3c21ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ebf3279f79bbe3d19694f0d2791cea55c7218a7de1485cce7ea67518a5da0030c34eda2a4c380ea03ad361ea4f3341f12eb975e8c3cb6b08c455d5e62d64341
|
7
|
+
data.tar.gz: 2d86d9980b3cd0ad1c17c3e4ac84e0d953ee1c12b9af01ab35381bb4c1317cdc590a1cb693197316fc71894121f5d45b867aec1f8d1f356942cad8addbae0dc9
|
@@ -40,6 +40,16 @@ module DocumentationEditor
|
|
40
40
|
roots
|
41
41
|
end
|
42
42
|
|
43
|
+
def section_title(options, section)
|
44
|
+
doc = parse_document(options.merge(no_wrap: true))
|
45
|
+
ids = id_generator(doc)
|
46
|
+
doc.root.children.each do |child|
|
47
|
+
text = child.options[:raw_text]
|
48
|
+
return text if child.type == :header && child.options[:level] == 1 && section == ids.generate_id(resolve_variables(options, text))
|
49
|
+
end
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
|
43
53
|
private
|
44
54
|
def parse_document(options)
|
45
55
|
doc = Kramdown::Document.new(content, options.merge(input: 'BlockKramdown'))
|
@@ -4,6 +4,7 @@
|
|
4
4
|
= render partial: 'menu_items', object: @revision.to_toc(@options)
|
5
5
|
|
6
6
|
- content_for :page_title, @page.title
|
7
|
+
- content_for :section_title, @revision.section_title(@options, params[:section]) if params[:section]
|
7
8
|
|
8
9
|
.markdown-page
|
9
10
|
- if DocumentationEditor::Config.is_admin && send(DocumentationEditor::Config.is_admin)
|