all repos — litestore @ 9cdae4f65883217af04ec93b9310bff1e5eafebc

A minimalist nosql document store.

Now automatically fixing headings on guide pages.
h3rald h3rald@h3rald.com
Sun, 12 Apr 2015 20:09:03 +0200
commit

9cdae4f65883217af04ec93b9310bff1e5eafebc

parent

32d015b820d63217659c2c4ff40a5e2182695670

M admin/js/components/navbar.jsadmin/js/components/navbar.js

@@ -15,6 +15,8 @@ return (m.route().match(new RegExp("^\/"+url))) ? "active" : "";

}; vm.guidelinks = [ {path: "/guide/overview", title: "Overview"}, + {path: "/guide/use-cases", title: "Use Cases"}, + {path: "/guide/architecture", title: "Architecture"}, {path: "/guide/getting-started", title: "Getting Started"}, {path: "/guide/usage", title: "Usage"}, {path: "/guide/api", title: "API"},
M admin/js/utils.jsadmin/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.mdadmin/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