diff --git a/HISTORY.md b/HISTORY.md index 5d1a158..4dd20ad 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,10 +1,12 @@ # Change Log + As with most npm modules, this project adheres to [Semantic Versioning](http://semver.org/). ## [1.0.0] - 2021-06-13 ### Changed + - command is now `pug3`, to make it possible to have installed globally alongside pug-cli - update Readme - Removing broken test ("JavaScript syntax does not accept UTF newlines") @@ -13,56 +15,69 @@ As with most npm modules, this project adheres to - configure Travis to test with Node 10, 12 and 14 (Pug 3 supports Node 10+) ### Added + - `man` page ## [1.0.0-alpha6] - 2016-06-01 ### Added + - `--basedir` option is added for easier specification of that Pug option. - Node.js v6 is now tested. ## [1.0.0-alpha5] - 2016-05-18 ### Changed + - Files ending `.jade` are now recognized as Pug templates when a directory is provided as input. ## [1.0.0-alpha4] - 2016-05-18 ### Changed + - When `--watch` is specified, `watch` is no longer passed as an option to Pug. This should have no effect on users. ### Fixed + - Fixed `--no-debug` option ([#23]) ## [1.0.0-alpha3] - 2016-05-18 ### Added + - Node.js module as option file is supported as well. - Some examples have been added to the documentation on how to use `-O`. ## [1.0.0-alpha2] - 2016-05-18 ### Changed + - Pug has been updated to the latest alpha. - Unused dependencies have been removed. ## [1.0.0-alpha1] - 2016-03-23 ### Removed + - `-H` option, deprecated in 0.1.0, has been removed. - Support for `SIGINT` as signal for EOF, deprecated in 0.1.1, has been removed. ### Changed + - The package is renamed to `pug-cli`. ### Fixed + - Support for Windows has been fixed. ## [0.1.1] - 2015-09-29 + ### Deprecated + - Using `SIGINT` (`^C`) to signify end of input in standard input mode is deprecated, and will be removed in 1.0.0. Instead, use `^D` which means "end of file." ### Fixed + - Fallback on options specified with `-O` if the corresponding CLI option is not specified. - Mark this module as preferred to be installed globally. - Fix copyright and update maintainers in package.json. @@ -70,26 +85,33 @@ As with most npm modules, this project adheres to - Fix compiling directories whose paths contain backslashes (`\`) (#11). ## [0.1.0] - 2015-07-24 + ### Added + - Silent mode (`-s`, `--silent`) which disables printing unimportant messages (#3, pugjs/pug#1905). ### Changed + - Hierarchy mode (`-H`, `--hierarchy`) is made the default. - Both versions of Pug and the CLI are printed with `-V` or `--version`. - Unescaped Unicode line and paragraph separators (`U+2028` and `U+2029`) is now allowed in the `-O` option only when the input is considered to be JSON (#5, pugjs/pug#1949). - Non-JSON object files are allowed for the `-O` option as long as it can be parsed with the `eval()` function. ### Deprecated + - Since the hierarchy mode (`-H`, `--hierarchy`) is made the default, the option is now redundant and will be removed in 1.0.0. ### Fixed + - Capitalization in help message is kept consistent. - Fix grammar error in the help message (by @didoarellano). - Fix watch mode in more than one level of dependency hierarchy (pugjs/pug#1888). ## 0.0.1 - 2015-06-02 + ### Added + - Initial release. [unreleased]: https://github.com/pugjs/pug-cli/compare/1.0.0-alpha5...master @@ -100,5 +122,4 @@ As with most npm modules, this project adheres to [1.0.0-alpha1]: https://github.com/pugjs/pug-cli/compare/0.1.1...1.0.0-alpha1 [0.1.1]: https://github.com/pugjs/pug-cli/compare/0.1.0...0.1.1 [0.1.0]: https://github.com/pugjs/pug-cli/compare/0.0.1...0.1.0 - [#23]: https://github.com/pugjs/pug-cli/issues/23 diff --git a/README.md b/README.md index 558111a..5c8cf3b 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ Pug 3 CLI with many fixes and improvements [![NPM version](https://img.shields.io/npm/v/@tokilabs/pug3-cli.svg)](https://www.npmjs.org/package/@tokilabs/pug3-cli) -**@tokilabs/pug3-cli** is a CLI for running [Pug](https://pugjs.org/), updated to Pug 3.0.2. It's a fork of the original [pug-cli](https://www.npmjs.com/package/pug-cli), which still uses PUG 2. +**@tokilabs/pug3-cli** is a CLI for running [Pug](https://pugjs.org/), updated to Pug 3.0.3. It's a fork of the original [pug-cli](https://www.npmjs.com/package/pug-cli), which still uses PUG 2. ## Usage -``` -$ pug3 [options] [dir|file ...] +```sh +pug3 [options] [dir|file ...] ``` Render ``s and all files in ``s. If no files are specified, @@ -17,7 +17,7 @@ input is taken from standard input and output to standard output. ### Options -``` +```sh -h, --help output usage information -V, --version output the version number -O, --obj JSON/JavaScript/YAML options object or file @@ -42,66 +42,77 @@ input is taken from standard input and output to standard output. Render all files in the `templates` directory: -``` -$ pug3 templates +```sh +pug3 templates ``` Create `{foo,bar}.html`: -``` -$ pug3 {foo,bar}.pug +```sh +pug3 {foo,bar}.pug ``` Using `pug` over standard input and output streams: -``` -$ pug3 < my.pug > my.html -$ echo "h1 Pug!" | pug +```sh +pug3 < my.pug > my.html +echo "h1 Pug!" | pug ``` Render all files in `foo` and `bar` directories to `/tmp`: -``` -$ pug3 foo bar --out /tmp +```sh +pug3 foo bar --out /tmp ``` Specify options through a string: -``` -$ pug3 -O '{"doctype": "html"}' foo.pug +```sh +pug3 -O '{"doctype": "html"}' foo.pug + # or, using JavaScript instead of JSON -$ pug3 -O "{doctype: 'html'}" foo.pug +pug3 -O "{doctype: 'html'}" foo.pug ``` Specify options through a file: -``` -$ echo "exports.doctype = 'html';" > options.js -$ pug3 -O options.js foo.pug +```sh +echo "exports.doctype = 'html';" > options.js +pug3 -O options.js foo.pug + # or, JSON works too -$ echo '{"doctype": "html"}' > options.json -$ pug3 -O options.json foo.pug +echo '{"doctype": "html"}' > options.json +pug3 -O options.json foo.pug + # YAML works as well -$ pug3 -O options.yaml foo.pug +pug3 -O options.yaml foo.pug ``` ## Installation ### Global installation - npm install -g @tokilabs/pug3-cli +```sh +npm install -g @tokilabs/pug3-cli +``` Use --help to learn how to use it - pug3 --help +```sh +pug3 --help +``` ### Local installation - yarn add -D install @tokilabs/pug3-cli +```sh +yarn add -D install @tokilabs/pug3-cli +``` Run with yarn: - yarn pug3 ... +```sh +yarn pug3 ... +``` ## Original @@ -109,7 +120,7 @@ The original project this was forked from: - [github.com/pugjs/pug-cli](https://github.com/pugjs/pug-cli) -## Thank You! +## Thank You This fork started by merging the contributions of the fellas below: diff --git a/man/pug3.0.2 b/man/pug3.0.3 similarity index 96% rename from man/pug3.0.2 rename to man/pug3.0.3 index 2612ef6..8b9ccab 100644 --- a/man/pug3.0.2 +++ b/man/pug3.0.3 @@ -1,7 +1,7 @@ .\" Manpage for pug3-cli. .TH man 1 "23 April June 2023" "1.0.0" "pug3 man page" .SH NAME -@tokilabs/pug3-cli \- A cli for Pug 3.0.2 with many fixes and improvements +@tokilabs/pug3-cli \- A cli for Pug 3.0.3 with many fixes and improvements .SH SYNOPSIS pug3 [OPTIONS] [DIR|FILE ...] .SH DESCRIPTION diff --git a/package.json b/package.json index eeae77c..978ff05 100644 --- a/package.json +++ b/package.json @@ -1,50 +1,50 @@ { - "name": "@tokilabs/pug3-cli", - "version": "3.0.1", - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - }, - "description": "A cli for Pug 3.0.2 with many fixes and improvements", - "repository": { - "type": "git", - "url": "https://github.com/tokilabs/pug3-cli.git" - }, - "directories": { - "man": "man" - }, - "bin": { - "pug3": "./index.js" - }, - "preferGlobal": true, - "keywords": [ - "pug", - "pug3", - "pug-cli", - "pug3-cli", - "html", - "cli" - ], - "dependencies": { - "chalk": "^4.1.1", - "commander": "^7.2.0", - "debug": "^4.3.4", - "gray-matter": "^4.0.2", - "js-yaml": "^4.1.0", - "mkdirp": "^1.0.4", - "pug": "^3.0.2" - }, - "devDependencies": { - "istanbul": "*", - "mocha": "*", - "rimraf": "*" - }, - "scripts": { - "test": "mocha -R spec --bail", - "precoverage": "rimraf coverage && rimraf cov-pt*", - "coverage": "istanbul cover --report none --dir cov-pt0 node_modules/mocha/bin/_mocha -- -R dot", - "postcoverage": "istanbul report --include cov-pt\\*/coverage.json && rimraf cov-pt*", - "man": "man ./man/pug3.0.2" - }, - "license": "MIT" + "name": "@tokilabs/pug3-cli", + "version": "3.0.1", + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "description": "A cli for Pug 3.0.3 with many fixes and improvements", + "repository": { + "type": "git", + "url": "https://github.com/tokilabs/pug3-cli.git" + }, + "directories": { + "man": "man" + }, + "bin": { + "pug3": "./index.js" + }, + "preferGlobal": true, + "keywords": [ + "pug", + "pug3", + "pug-cli", + "pug3-cli", + "html", + "cli" + ], + "dependencies": { + "chalk": "^4.1.2", + "commander": "^12.1.0", + "debug": "^4.3.7", + "gray-matter": "^4.0.3", + "js-yaml": "^4.1.0", + "mkdirp": "^3.0.1", + "pug": "^3.0.3" + }, + "devDependencies": { + "mocha": "^11.0.1", + "nyc": "^17.1.0", + "rimraf": "^6.0.1" + }, + "scripts": { + "test": "mocha -R spec --bail", + "precoverage": "rimraf --no-glob coverage && rimraf --no-glob cov-pt*", + "coverage": "nyc --reporter=none --report-dir=cov-pt0 mocha -- -R dot", + "postcoverage": "nyc report --include=cov-pt*/coverage.json && rimraf --no-glob cov-pt*", + "man": "man ./man/pug3.0.3" + }, + "license": "MIT" }