This plugin allows you to show/hide elements in SimplePersonalSiteJavaServer.
- follow directions to setup a SimplePersonalSiteJavaServer.
- symlink
PluginFoldy.css
andPluginFoldy.js
to the plugins directory of your site - include
PluginFoldy.js
as a script inindex.html
belowSimplePersonalSite.js
<script src='plugins/PluginFoldy.js'></script>
- Tell the app to initialize the plugin by passing
PluginFoldy.plugin
toapp.run()
inindex.html
- if you only have one plugin, this looks like:
app.run([PluginFoldy.plugin])
Show/hide an entire section of content.
- Above the content you want to show/hide, add
<div id='your-id-here' class='foldy-div'></div>
- Below your content, add
<div id='your-id-here-close'></div>
If you want to style your foldy-divs, you can add style to the class foldy-div-found
. I like to add margin to the left so content get indented (css): .foldy-div-found { margin-left: 15px }
Some markdown renderers don't render markdown inside divs very well. Adding a div above and below content should work well for most markdown renderers.
Show/hide the next element.
If there is no next element, recursively keep search up to parents until a next element can be found, or the body
is reached.
- Before the element you want to show/hide, add
<span class='foldy-next'></span>
If you want the element to start off as hidden instead of shown, just add foldy-hide
as a class to the foldy element.
Examples:
<span class='foldy-next foldy-hide'></span>
<span id='cool-element-yes' class='foldy-div foldy-hide'></span>