Skip to content

Templarian/Savvy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Savvy

JavaScript markup parser for the Savvy syntax. Play with the Demo.

  • Jasmine Unit Tested
  • jQuery or jqLite (for use with Angular)
  • Variables and Functions

Use

Include the jquery.savvy.js file.

jQuery

$('.savvy').savvy();
$('.savvy').savvy(text);
$.savvy(element, text);

AngularJS

exmaple here

Savvy Syntax

The parser allows for inline variable definitions and functions. View the full syntax documention.

Variables

Variables can be defined with the @ symbol with a name containing letters or numbers. Any value after the next space will be saved globally to the variable.

@hello world!

@hello
<p>world!</p>

Note: To redefine a variable use @@ instead of a single @.

Function

Functions allow basic tempates and the execution of pre-defined JavaScript.

@twitter(username){
  <a href="https://twitter.com/@username">@username</a>
}

Follow me on twitter: @twitter(Templarian)
<p>Follow me on twitter: <a href="https://twitter.com/Templarian">Templarian</a></p>

About

jqLite compatible markup parser for the Savvy syntax.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published