abstract-numbering
Advanced tools
Comparing version 2.0.2 to 3.0.0
{ | ||
"name": "abstract-numbering", | ||
"description": "JSON schema for abstract numberings of hierarchical document parts", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"author": "Kyle E. Mitchell <kyle@kemitchell.com> (https://kemitchell.com)", | ||
"files": [ | ||
"index.json" | ||
], | ||
"devDependencies": { | ||
"defence-cli": "^1.0.5", | ||
"ajv": "^6.10.0", | ||
"defence-cli": "^3.0.1", | ||
"replace-require-self": "^1.1.0", | ||
"tv4": "^1.2.7" | ||
"standard-markdown": "^5.0.1" | ||
}, | ||
"keywords": [ | ||
"abstract-numbering", | ||
"documents", | ||
@@ -19,7 +24,8 @@ "enumeration", | ||
], | ||
"license": "Apache-2.0", | ||
"license": "BlueOak-1.0.0", | ||
"repository": "commonform/abstract-numbering", | ||
"scripts": { | ||
"lint": "standard-markdown README.md", | ||
"test": "defence -i javascript README.md | replace-require-self | node" | ||
} | ||
} |
@@ -1,33 +0,27 @@ | ||
Validate abstract numberings of hierarchical document parts. | ||
# abstract-numbering | ||
Abstract numberings express how hierarchical document parts like | ||
outline sections, headings, or list items should be numbered, without | ||
rendering those numberings in any particular way. Other modules in | ||
the [`*-numbering` family](https://www.npmjs.com/search?q=-numbering) | ||
convert abstract numberings to strings in particular styles, like | ||
`"1.2"` or `"1(a)(v)"`. | ||
JSON schema for abstract numberings of hierarchical document parts | ||
Each abstract numbering is an array of numbering components, describing | ||
first the top-most "parent" of the relevant document part and continuing | ||
down to the document part to be numbered itself. | ||
Abstract numberings express how hierarchical document parts like outline sections, headings, or list items should be numbered, without rendering those numberings in any particular way. Other modules in the [`*-numbering` family](https://www.npmjs.com/search?q=keywords:abstract-numbering) convert abstract numberings to strings in particular styles, like `"1.2"` or `"1(a)(v)"`. | ||
Here is an example of a numbering for the first of two elements at the | ||
very top level of a document: | ||
Each abstract numbering is an array of numbering components, describing first the top-most "parent" of the relevant document part and continuing down to the document part to be numbered itself. | ||
Here is an example of a numbering for the first of two elements at the very top level of a document: | ||
```javascript | ||
var schema = require('abstract-numbering') | ||
var tv4 = require('tv4') | ||
var ajv = new (require('ajv'))() | ||
var assert = require('assert') | ||
assert( | ||
tv4.validate( | ||
ajv.validate( | ||
schema, | ||
[ | ||
{ | ||
// More on series later. | ||
series: {number: 1, of: 1}, | ||
series: { number: 1, of: 1 }, | ||
// "Element number 1 of 2" | ||
element: {number: 1, of: 2} | ||
element: { number: 1, of: 2 } | ||
} | ||
], | ||
schema | ||
] | ||
) | ||
@@ -41,10 +35,10 @@ ) | ||
assert( | ||
!tv4.validate( | ||
!ajv.validate( | ||
schema, | ||
[ | ||
{ | ||
series: {number: 1, of: 1}, | ||
element: {number: 0, of: 1} | ||
series: { number: 1, of: 1 }, | ||
element: { number: 0, of: 1 } | ||
} | ||
], | ||
schema | ||
] | ||
) | ||
@@ -75,3 +69,4 @@ ) | ||
assert( | ||
tv4.validate( | ||
ajv.validate( | ||
schema, | ||
[ | ||
@@ -81,4 +76,4 @@ // The component for "First Major Heading" | ||
// Numbering of headings does not restart, so there is one series. | ||
series: {number: 1, of: 1}, | ||
element: {number: 1, of: 2} | ||
series: { number: 1, of: 1 }, | ||
element: { number: 1, of: 2 } | ||
}, | ||
@@ -89,10 +84,9 @@ // The component for "Tigers" | ||
// "Tigers" is in the second series. | ||
series: {number: 2, of: 2}, | ||
series: { number: 2, of: 2 }, | ||
// There are three total elements, of which "Tigers" is second. | ||
element: {number: 2, of: 3} | ||
element: { number: 2, of: 3 } | ||
} | ||
], | ||
schema | ||
] | ||
) | ||
) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
0
100
5212
4
4
89