https://github.com/pwright/pmodel
https://github.com/pwright/pmodel
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pwright/pmodel
- Owner: pwright
- License: mit
- Created: 2021-05-29T12:22:23.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-30T15:25:32.000Z (about 5 years ago)
- Last Synced: 2025-02-12T15:48:16.397Z (over 1 year ago)
- Language: JavaScript
- Size: 1.13 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
[id='analysing_{context}']
= Analysing AsciiDoc using `pmodel`
[role="_abstract"]
`pmodel` runs against `adoc` files and produces reports.
To install pmodel:
`npm i -g @techwriter/pmodel`
To test an adoc file:
`pmodel `
Example output shows that all elements exist:
```
{
"filename":"README.adoc",
"ID":"analysing_{context}",
"heading":"Analysing AsciiDoc using `pmodel`",
"abstract":"`pmodel` runs against `adoc` files and produces reports.",
"dummy":0}
```
To test a directory:
```
cd
pmodel parse
```
The `parse` keyword triggers pmodel to recursively search for AsciiDoc files and run the test, output can be queried with link:https://alasql-wiki.readthedocs.io/en/latest/index.html[alasql].
```
pmodel parse > test.json
alasql 'select heading, abstract from JSON("test.json") where abstract is not null'
```
== Tests
The following tests are performed:
* Capture Level 1 heading. If there are two level 1 headings, both are captured.
* Capture first line after `[role="_ abstract"]`
* Capture id value