Skip to content

Commit

Permalink
Merging forks that were never merged into the official pug-cli (closes
Browse files Browse the repository at this point in the history
…#4 from tokilabs/merging-forks)

Here's a list of the merged contributions:

- @Anduh at [anduh/pug-cli](https://github.com/anduh/pug-cli)
  - Update Pug to version 3.0.2 (Closes pugjs#88)
- @anthony-tron at [anthony-tron/pug-cli](https://github.com/anthony-tron/pug-cli)
  - Hot reload of options file and YAML in `-O | --obj` option (Closes pugjs#89)
- @lazdmx at https://github.com/lazdmx/pug-cli
  - Allow symlink as input 2d6c334 (Closes pugjs#80) [2d6c334](lazdmx@2d6c334)
- @funai at [funai/pug-cli](https://github.com/funai/pug-cli)
  - [Allow templates to use YAML front-matter](4d5b6e6)
  - [Inject `extends` from  frontmatter `layout`](4d5b6e6#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R260)
  • Loading branch information
svallory committed Apr 23, 2023
2 parents 0eb8d37 + 931f446 commit 51e3e0e
Show file tree
Hide file tree
Showing 9 changed files with 4,037 additions and 514 deletions.
57 changes: 49 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,56 @@
*.seed
*.log
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# cache files
build/
dist/
logs/
out/
results/
temp/
*.csv
*.dat
*.gz
*.log
*.out
*.pid
*.gz
*.seed
pids
logs
results
npm-debug.log
node_modules
coverage

# testing
cov-pt*
coverage
test/temp

# next.js
.next/

# misc
.DS_Store
*.pem

# debug
.pnpm-debug.log*
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.development.local
.env.local
.env.production.local
.env.test.local

# dependencies
node_modules
package-lock.json
.pnp
.pnp.*

# Yarn
yarn.lock
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ language: node_js
sudo: false

node_js:
- "0.10"
- "0.12"
- "4"
- "6"
- "10"
- "12"
- "14"

after_success:
- npm run coverage
Expand Down
13 changes: 13 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
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")
- upgrade to PUG 3
- upgrade all dependencies
- 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
Expand Down
43 changes: 26 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# pug-cli
# @anduh/pug-cli

Pug's CLI interface
PUG 3 CLI interface

[![Build Status](https://img.shields.io/travis/pugjs/pug-cli/master.svg)](https://travis-ci.org/pugjs/pug-cli)
[![Dependency Status](https://img.shields.io/david/pugjs/pug-cli.svg)](https://david-dm.org/pugjs/pug-cli)
[![NPM version](https://img.shields.io/npm/v/pug-cli.svg)](https://www.npmjs.org/package/pug-cli)
[![Coverage Status](https://img.shields.io/codecov/c/github/pugjs/pug-cli.svg)](https://codecov.io/gh/pugjs/pug-cli)
[![Dependency Status](https://img.shields.io/david/anduh/pug-cli.svg)](https://david-dm.org/anduh/pug-cli)
[![NPM version](https://img.shields.io/npm/v/@anduh/pug-cli.svg)](https://www.npmjs.org/package/@anduh/pug-cli)
[![Coverage Status](https://img.shields.io/codecov/c/github/anduh/pug-cli.svg)](https://codecov.io/gh/anduh/pug-cli)

**@anduh/pug-cli** is a CLI for rendering [PUG](https://pugjs.org/), updated to PUG 3. It's a fork of the original [pug-cli](https://www.npmjs.com/package/pug-cli), which still uses PUG 2.

**warning:** this is my first try at publishing an npm package, so this might not work.

## Usage

```
$ pug [options] [dir|file ...]
$ pug3 [options] [dir|file ...]
```

Render `<file>`s and all files in `<dir>`s. If no files are specified,
Expand All @@ -21,7 +24,7 @@ input is taken from standard input and output to standard output.
```
-h, --help output usage information
-V, --version output the version number
-O, --obj <str|path> JSON/JavaScript options object or file
-O, --obj <str|path> JSON/JavaScript/YAML options object or file
-o, --out <dir> output the rendered HTML or compiled JavaScript to
<dir>
-p, --path <path> filename used to resolve includes
Expand All @@ -44,49 +47,55 @@ input is taken from standard input and output to standard output.
Render all files in the `templates` directory:

```
$ pug templates
$ pug3 templates
```

Create `{foo,bar}.html`:

```
$ pug {foo,bar}.pug
$ pug3 {foo,bar}.pug
```

Using `pug` over standard input and output streams:

```
$ pug < my.pug > my.html
$ pug3 < my.pug > my.html
$ echo "h1 Pug!" | pug
```

Render all files in `foo` and `bar` directories to `/tmp`:

```
$ pug foo bar --out /tmp
$ pug3 foo bar --out /tmp
```

Specify options through a string:

```
$ pug -O '{"doctype": "html"}' foo.pug
$ pug3 -O '{"doctype": "html"}' foo.pug
# or, using JavaScript instead of JSON
$ pug -O "{doctype: 'html'}" foo.pug
$ pug3 -O "{doctype: 'html'}" foo.pug
```

Specify options through a file:

```
$ echo "exports.doctype = 'html';" > options.js
$ pug -O options.js foo.pug
$ pug3 -O options.js foo.pug
# or, JSON works too
$ echo '{"doctype": "html"}' > options.json
$ pug -O options.json foo.pug
$ pug3 -O options.json foo.pug
# YAML works as well
$ pug3 -O options.yaml foo.pug
```

## Installation

npm install pug-cli -g
npm install @anduh/pug-cli -g

## Original
The original project this was forked from:
* [github.com/pugjs/pug-cli](https://github.com/pugjs/pug-cli)

## License

Expand Down

0 comments on commit 51e3e0e

Please sign in to comment.