Coder Social home page Coder Social logo

pugneum's Introduction

Pugneum

Clean HTML templates for static sites.

Installation

npm install pugneum

Syntax

Pugneum is a clean, whitespace sensitive syntax for writing HTML. Here is a simple example:

html(lang="en")
  head
    title Example
    script(type='text/javascript').
      if (foo) {
        bar(1 + 5);
      }
  body
    h1 Pugneum
    #container.centered
      p.
        Pugneum is a terse and simple templating language
        with a focus on static pure HTML web sites.

That code compiles to:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Example</title>
    <script type="text/javascript">
      if (foo) {
        bar(1 + 5);
      }
    </script>
  </head>
  <body>
    <h1>Pugneum</h1>
    <div id="container" class="centered">
      <p>
        Pugneum is a terse and simple templating language
        with a focus on static pure HTML web sites.
      </p>
    </div>
  </body>
</html>

Pugneum is a variant of pug, modified to be fully static. All dynamic features have been removed. Only the clean language remains.

Usage

The command line utility requires a pugneum.json file to work:

{
    "inputDirectory": "pg/files",
    "outputDirectory": "example.com",
    "baseDirectory": "pg"
}

Committing this file to version control is recommended.

Once it exists, the pugneum templates can be compiled to HTML with a command line tool:

pugneum

Programming interface

const pg = require('pugneum');

let html = pg.render('h1 Hello, world!');
let html = pg.renderFile('page.pg');

License

MIT

pugneum's People

Contributors

tj avatar forbeslindesay avatar matheusmoreira avatar timothygu avatar chowey avatar hemanth avatar alubbe avatar jserme avatar rauchg avatar conancat avatar tricknotes avatar pavel avatar caseywebdev avatar seanho avatar enlore avatar notslang avatar pgherveou avatar stuartpb avatar kylekatarnls avatar weakish avatar logicalparadox avatar eldargab avatar cleishm avatar ezhlobo avatar droooney avatar khingebjerg avatar naltatis avatar kizu avatar zackschuster avatar masylum avatar

Stargazers

Zhalelov Damir 赵强 avatar Benjamin avatar Roxwize avatar Mason Yang avatar Cris avatar Rafael Jurado González avatar Amarizky Yoga Pratama avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

dosycorps

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.