noodle-slide

0.5.0 • Public • Published

Noodle Slide

noodle slide is a soggy static site builder running on Node.js.

Noodle slide builds upon the ReactiveX model: It reads files, sends them down the slide for you to manipulate them and finally writes the files back. Everything around is just seasoning. While being used in production it is still lacking proper documentation and testing. Please be patient.

Example

A build script using noodle slide may for example look like this:

const ns = require('noodle-slide').ns;

ns.sourceBase = __dirname + "/src/"

// specify the base directory for your target files.
// If it exists the directory is cleaned.
ns.targetBase = __dirname + "/dist/";

// copy <ns.sourceBase>/logo.png to <ns.targetBase>/logo.png
ns.copy("logo.png");

ns
  // read the file from the current working directory
  .textSlide("style.scss")
  // parse SCSS using node-sass
  .scss()
  .write();

ns
  .textSlide(ns.source + "/pages", "**/*.md")
  // parse markdown using showdown
  .markdown()
  // replace {{content}} inside template.html with the parsed markdown
  .wrapInto("template.html", "content")
  .template({
    // replace {{title}} with metadata aquired during the markdown parsing
    "title": n => n.getEnv("title"),
    // replace {{menu}} with a simple menu
    "menu": ns.menu(
      ns.item("foo"),
      ns.item("bar")
    ),
  })
  .obfuscateEmails()
  // compress the html using html-minifier
  .minifyHtml()
  // write the file to <ns.targetBase>/file.md
  .write();

// start the script. Everthing up until now was just setting the
// streams up. They only start pumping data through, when the enjoy()
// method is called.
ns.enjoy();

Development

Noodle slide is written in Scala.js. It requires sbt to build it. Use the standard commands fastOptJS for testing and fullOptJS for releases.

Do not edit the package.json file directly - it is generated by the build.sbt to keep the version synchronized.

The semantic versioning schema guarantees API stability only for the resulting JavaScript, not for a Scala.js library, that could be produced from the source code. Providing a comfortable to use Scala.js API and JavaScript API at the same time requires a considerable amount of work, I'm only willing to put in if there is actually demand.

Readme

Keywords

none

Package Sidebar

Install

npm i noodle-slide

Weekly Downloads

1

Version

0.5.0

License

Apache-2.0

Unpacked Size

466 kB

Total Files

4

Last publish

Collaborators

  • joschua