Skip to content
A simple variable based template editor using handlebarjs+strapdownjs. The idea is to use variables in markdown based files to easily replace the variables with content. Data is saved temporarily in local storage. PHP is only needed to generate the list of files in the dropdown of templates.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts added clearbutton Jan 6, 2017
tpls changed some stuff in the example report to make it look nice. Dec 12, 2016
.gitignore added ignore of files in tpls/ Dec 12, 2016
LICENSE Initial commit Dec 12, 2016
README.md yea it's a form of editor. Dec 12, 2016
index.html initial commit Dec 12, 2016
list.php proper php tag Dec 12, 2016

README.md

Template generator

A simple variable based template editor using handlebarjs+strapdownjs. The idea is to use variables in markdown based files to easily replace the variables with content. Data is saved temporarily in local storage. PHP is only needed to generate the list of files in the dropdown of templates.

Thoughts:

  1. I turned off HTML sanitization to make code with <, >, " etc inside:
this kind of content

So it's easily XSS:able as it is now.

  1. I had to hack a bit in strapdown.js due to messy location of files.
  2. I had to hack a bit in handlebar.js since I wanted to use {{lookup}} as a param, and that wasn't possible to turn off even though I removed it as a helper.
  3. Didn't do anything with images, since these still needs to be uploaded elsewhere. A tip here is to name them with what they contain so the tags are easily changeable whenever you use this in your report.

How to run

php -S localhost:8000

Place a bunch of .md files in the /tpls/ dir. They should show up in the dropdown. It saves now on every keystroke and will remember the data using localStorage. It will also reuse the variables if you switch template.

Disclaimer

This was a weekend project, took a few hours but was totally worth it (was able to gain speed quick using it). It's really messy but, hey, it works.

\o/

Frans Rosén @fransrosen

You can’t perform that action at this time.