Now automatically fixing headings on guide pages.
h3rald h3rald@h3rald.com
Sun, 12 Apr 2015 20:09:03 +0200
5 files changed,
34 insertions(+),
17 deletions(-)
M
admin/js/utils.js
→
admin/js/utils.js
@@ -12,6 +12,21 @@ return v.toString(16);
}); }; + u.fixHeadings = function(html, maxheading){ + var $content = $(html); + var n = maxheading; + if ($content.find("h"+n).length > 0) { + return $content.html(); + } else { + for (var i=n+1; i<=6; i++){ + var j = i-1; + $content.find("h"+i).each(function(){ + $(this).replaceWith("<h"+j+">"+$(this).html()+"</h"+j+">"); + }); + } + return u.fixHeadings($content, maxheading); + } + }; u.markdown = function(s) { var hs = new marked.Renderer();@@ -45,7 +60,9 @@ }
} return md.link(href, title, text); }; - return marked(s, {renderer: hs}); + var html = marked(s, {renderer: hs}); + var $html = $('<div>').append($(html).clone()); + return u.fixHeadings($html, 2); }; /**
A
admin/md/architecture.md
@@ -0,0 +1,3 @@
+### Architecture + +![LiteStore Architecture](images/litestore_arch.png)
M
admin/md/overview.md
→
admin/md/overview.md
@@ -17,7 +17,7 @@ And yes, you can even store the code of your client-side application inside the datastore itself, along with your application data.
### Key Features -Despite being fairly small and self-contained, LiteStore comes with many useful features that are essential for many [use cases](#Use.Cases). +Despite being fairly small and self-contained, LiteStore comes with many useful features that are essential for many use cases. #### Multiformat documents@@ -31,18 +31,4 @@ #### RESTful HTTP API
#### Directory Bulk Import/Export -#### Directory Mounting and Mirroring - -### Use Cases - -#### SPA prototyping backend - -#### Personal Wiki/CMS backend - -#### Static site backend - -#### Lightweight file server - -### Architecture - -![LiteStore Architecture](images/litestore_arch.png)+#### Directory Mounting and Mirroring
A
admin/md/use-cases.md
@@ -0,0 +1,9 @@
+### Use Cases + +#### SPA prototyping backend + +#### Personal Wiki/CMS backend + +#### Static site backend + +#### Lightweight file server