Skip to content

Commit

Permalink
Try adding output blocks and configure evaldown to capture the console
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Jul 4, 2020
1 parent 63f8fa1 commit 7b07a9c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -62,6 +62,10 @@ const renderer = counteraction('lower-roman');
console.log(renderer.render(123)); // cxxiii
```

```output
cxxiii
```

The `@counter-system` ones are created by their `system` name and accept an
options object that corresponds to the CSS properties of the `@counter-style`
declaration:
Expand All @@ -73,6 +77,10 @@ const renderer = counteraction('alphabetic', {
console.log(renderer.render(123)); // XXXXZ
```

```output
cxxiii
```

The name (system) can also be passed as a separate property instead of the name
parameter. That might be easier if you're working with a parsed representation
of the whole `@counter-style` declaration:
Expand All @@ -85,6 +93,10 @@ const renderer = counteraction({
console.log(renderer.render(123)); // XXXXZ
```

```output
XXXXZ
```

They also support a `fallback` option to be used when the value is out of range.
It can be passed as either a renderer instance or the name of a
`list-style-type` renderer:
Expand All @@ -98,4 +110,9 @@ console.log(renderer.render(3)); // Z
console.log(renderer.render(4)); //
```

```output
Z
```

The `fallback` option can also be passed as another renderer instance, or "lazily" as a function that returns either a `list-style-type` name or a renderer.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -27,7 +27,7 @@
"scripts": {
"lint": "eslint . && prettier --check '**/*.js'",
"test": "mocha",
"test:documentation": "evaldown README.md >/dev/null",
"test:documentation": "evaldown --output-capture=console README.md >/dev/null",
"test:ci": "npm run coverage && npm run test:documentation",
"coverage": "NODE_ENV=development nyc --reporter=lcov --reporter=text --all -- npm test && echo google-chrome coverage/lcov-report/index.html"
},
Expand Down

0 comments on commit 7b07a9c

Please sign in to comment.