jbs-markup

0.0.55 • Public • Published

JBS MarkUp Engine

The JumpButton Studio MarkUp Engine was originally designed for in-house use to speed up the production of website development. We've decided to give back to the community and share our engine.

Please note: IF statements can NOT be nested at this time.

Updates

Version 0.055

  • Added object support to the variables. You can now call objects with {> object_name.property_name}

Version 0.053

  • Fixed greedy loops.

Version 0.05

  • Fixed major bug with the IF statements overriding each other.

This is a beta and nowhere near complete. Usage

test.jbt

{IF isLoggedIn}
	Logged In within Included File.<br />
{/IF}
Testing File.<br />

index.jbt

<body>
	<!-- Basic IF/Then/Else Syntax -->
	{IF !isLoggedIn}
		<a href="/sign-in/">Sign In</a>
	{ELSE}
		Welcome back, {>username}!
	{/IF}
	<h5>User List</h5>
	<ul>
	<!-- Loop Through Objects -->
	{# users}
		<li>{#>last_name}, {#>first_name}</li>
	{/#}
	</ul>
	<!-- Include Other Files -->
	{#>test.jbt}
</body>

server.js

var engine = require("jbs-markup");

// Users object to pass to template for looping. Could be dynamic from a database or something.
var users = [
	{first_name:"Matthew", last_name:"Auld"},
	{first_name:"Reuben", last_name:"Nick"}
];

// Assuming you're using Express like us.
app.get("/",function(req,res){
	res.send(engine.parse("./templates/index.jbt",{isLoggedIn:true,username:"Lycrios",users:users}));
});

Rendering

Rendered Page

Readme

Keywords

Package Sidebar

Install

npm i jbs-markup

Weekly Downloads

1

Version

0.0.55

License

ISC

Last publish

Collaborators

  • lycrios