pug

Crates.iopug
lib.rspug
version0.2.0
sourcesrc
created_at2018-10-03 13:42:33.703167
updated_at2023-02-20 14:26:38.045983
descriptionpug.js port to Rust
homepage
repositoryhttps://github.com/bnoctis/pug-rs
max_upload_size
id87815
size24,863
Blair Noctis (nc7s)

documentation

README

pug-rs

crates.io

A port of pug to Rust.

This is a maintained fork of the original code by github.com/aep.

CLI usage

$ cargo install pug
$ pug < thing.pug > thing.html

Using with webpack

pug_loader.js:

const spawnSync = require('child_process').spawnSync;
module.exports = function(source) {
  var proc = spawnSync("pug", {
    input: source
  });
  if (proc.status != 0) {
    throw proc.error;
  }
  return proc.stdout.toString();
}

webpack.config.js

  module: {
    rules: [
      {
        test: /\.pug$/,
        use: [require.resolve('./pug_loader.js')]
      },

Commit count: 22

cargo fmt