Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Pug 3.0.3 #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -13,83 +15,103 @@ 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.
- Fix links in HISTORY.md.
- 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
Expand All @@ -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
65 changes: 38 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ 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 `<file>`s and all files in `<dir>`s. If no files are specified,
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 <str|path> JSON/JavaScript/YAML options object or file
Expand All @@ -42,74 +42,85 @@ 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

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:

Expand Down
2 changes: 1 addition & 1 deletion man/pug3.0.2 → man/pug3.0.3
Original file line number Diff line number Diff line change
@@ -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
Expand Down
96 changes: 48 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
"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"
}