diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f34f89a..1b4795af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,9 @@ Released: TBD ### Bug fixes -- [#479](https://github.com/peggyjs/peggy/issues/379) +- [#478](https://github.com/peggyjs/peggy/issues/478) Add "npx" to some doc + examples. +- [#479](https://github.com/peggyjs/peggy/issues/479) Refactor `cli/fromMem.js` into separate project [from-mem](https://github.com/peggyjs/from-mem/). - [#481](https://github.com/peggyjs/peggy/issues/481) Add CLI test for diff --git a/docs/documentation.html b/docs/documentation.html index 7a7b8376..5eddcdbf 100644 --- a/docs/documentation.html +++ b/docs/documentation.html @@ -131,13 +131,13 @@

Command Line

To generate a parser from your grammar, use the peggy command:

-
$ peggy arithmetics.pegjs
+
$ npx peggy arithmetics.pegjs

This writes parser source code into a file with the same name as the grammar file but with “.js” extension. You can also specify the output file explicitly:

-
$ peggy -o arithmetics-parser.js arithmetics.pegjs
+
$ npx peggy -o arithmetics-parser.js arithmetics.pegjs

If you omit both input and output file, standard input and standard output are used.

@@ -295,33 +295,33 @@

Command Line

# - write test results to stdout (42)
 # - exit with the code 0
-echo "foo = '1' { return 42 }" | peggy --test 1
+echo "foo = '1' { return 42 }" | npx peggy --test 1
 
 # - write a parser error to stdout (Expected "1" but "2" found)
 # - exit with the code 2
-echo "foo = '1' { return 42 }" | peggy --test 2
+echo "foo = '1' { return 42 }" | npx peggy --test 2
 
 # - write an error to stdout (Generation of the source map is useless if you don't
 #   store a generated parser code, perhaps you forgot to add an `-o/--output` option?)
 # - exit with the code 1
-echo "foo = '1' { return 42 }" | peggy --source-map --test 1
+echo "foo = '1' { return 42 }" | npx peggy --source-map --test 1
 
 # - write an error to stdout (Generation of the source map is useless if you don't
 #   store a generated parser code, perhaps you forgot to add an `-o/--output` option?)
 # - exit with the code 1
-echo "foo = '1' { return 42 }" | peggy --source-map --test 2
+echo "foo = '1' { return 42 }" | npx peggy --source-map --test 2
 
 # - write an output to `parser.js`,
 # - write a source map to `parser.js.map`
 # - write test results to stdout (42)
 # - exit with the code 0
-echo "foo = '1' { return 42 }" | peggy --output parser.js --source-map --test 1
+echo "foo = '1' { return 42 }" | npx peggy --output parser.js --source-map --test 1
 
 # - write an output to `parser.js`,
 # - write a source map to `parser.js.map`
 # - write a parser error to stdout (Expected "1" but "2" found)
 # - exit with the code 2
-echo "foo = '1' { return 42 }" | peggy --output parser.js --source-map --test 2
+echo "foo = '1' { return 42 }" | npx peggy --output parser.js --source-map --test 2
 

JavaScript API

@@ -726,7 +726,7 @@

Importing External Rules

number.peggy:

number = n:$[0-9]+ { return parseInt(n, 10); }

Generate:

-
$ peggy csv.peggy number.peggy
+
$ npx peggy csv.peggy number.peggy