Efefomatic
Description
Efefomatic is a Flat File CMS providing:- A useful subset of markdown plus a few nice features such as a KBD shortcut
- Templates with variable syntax similar to twig and liquid, {{ var }}
- YAML defines front matter such as Title, Author, date, theme...
Written in the proud spirit of the Bass o Matic 76, blending content and themes just the way you like it.
Table of Contents
- License
- Pronounciation
- Markdown
- Extending Markdown
- Frameworks and Dependencies
- OO
- Installation
- Examples
- Limitations, Bugs and Issues
- View Markdown
License
MIT LicensePronounciation
It's pronounced just like it's speltEFF EFF OH MATIC
Markdown
- H1 #
- H2 ##
- H3 ###
- H4 ####
- H5 #####
- H6 ######
- HR ___ or ‐‐‐ or ***
- BR two spaces at end of line or back-tick at end of line
- LI * at start of line
- UL blank line before the first * list item
- \UL blank line afer the last * list item
- B **text**
- I *text*
- CODE three back-ticks (```) before and after the code section
- P One or more blank lines before the text
- A [text](link)
Markdown Enhancements
- ˜˜
strike-through˜˜ - Two tildes to strike-through - ==highlight== - Two equals to highlight
- ___underline___ - Three underscores to underline
- Exponents: x2 -> x2 ; xabc -> xabc
- Responsive iframe: paste Youtube iframe. efefomatic will make it's size scalable
- Anchored header: ==@ converts to <a href="first-word-of-header"></a><h2>header</h2>
- KBD `k'keystroke for a single keystroke
- KBD `k'modifier+keystroke for a two-stroke sequence
Extending Markdown
Just as I have made the above enhancements, you to easily add new, custom markdown features. At the top of efefomatic.php is an array of regular expressions. You can add more regular expressions here or directly in your application.
The following example simplifies the HTML KBD keystroke sequence. It converts the sequence `k'keystroke to <kbd>keystroke</kbd>. Note, there is no magic associate with the back-tick or single-quote. I just chose them because the sequence is unlikely to collide with other markdown features. You can choose whatever you want when you add features.
$efef_md[] = array( 'name' => 'kbd', 'from' => "/`k'(.+?)\s/s" , 'to' => "<kbd>$1</kbd>");
The following example is a little more complex and handles a keystroke
combination. It converts the sequence
`k'modifier+keystroke to
<kbd>modifier</kbd>+<kbd>keystroke</kbd>.
The Lua Text Editor Documentation shows this feature in action.
$efef_md[] = array( 'name' => 'kbd2', 'from' => "/`k'(.+?)\+(.+?)'/s" , 'to' => "<kbd>$1</kbd>+<kbd>$2</kbd>");
Frameworks and Dependencies
What's a framework? Efefomatic is one PHP file. One file to rule them all.OO
No thanks, I don't need the OO. OO on stackexchangeInstallation
git clone https://github.com/jwrr/efefomatic.git
cp -rf efefomatic/example name-of-new-post
cd name-of-new-post
Add markdown file(s).