documentation-editor 0.3.0 → 0.3.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3625a114ab98bcbd702d8b61f9cfdb9f557faf79
|
|
4
|
+
data.tar.gz: 6dbc8592fd6b1912638a7f30eedec88f3edab4be
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a0cab134e685459d2ed0f30ff4b2fb4dd2a9f79bd68156cda70b027ab1722bcb15dddab7b67fe85e1e95c9bb9ec6c1add9c9f723768f20fd134e8c4d8fb240f2
|
|
7
|
+
data.tar.gz: 74bcfcec2eae27e018a9a3034fd892128bbbf964714566addbe69c6d3bbcbdf52df9a68b895c7907c9626cedb88ffed3b9486bf09d7ba755352d8c63ba23209e
|
data/README.md
CHANGED
|
@@ -164,7 +164,7 @@ Rails.application.routes.draw do
|
|
|
164
164
|
end
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
If you're using the `wrap_h1_with_sections` option you can use the `:section` param to restrict the rendering to a specific section your page. The TOC will still contain everything. That's something you may want to use for SEO reasons.
|
|
167
|
+
If you're using the `wrap_h1_with_sections` option you can use the `:section` param to restrict the rendering to a specific section your page. The TOC will still contain everything. That's something you may want to use for SEO reasons. This must be the last part of your URL.
|
|
168
168
|
|
|
169
169
|
## Usage
|
|
170
170
|
|
|
@@ -61,7 +61,13 @@ module DocumentationEditor
|
|
|
61
61
|
@page = Page.find_by!(slug: params[:slug])
|
|
62
62
|
@revision = @page.published_revision
|
|
63
63
|
@options = params
|
|
64
|
-
@base_path = params[:section]
|
|
64
|
+
@base_path = if params[:section]
|
|
65
|
+
s = request.path.split('/')
|
|
66
|
+
s.pop
|
|
67
|
+
s.join('/')
|
|
68
|
+
else
|
|
69
|
+
request.path
|
|
70
|
+
end
|
|
65
71
|
render :preview
|
|
66
72
|
end
|
|
67
73
|
|