Skip to content

Commit

Permalink
docss
Browse files Browse the repository at this point in the history
  • Loading branch information
tefkah committed Mar 2, 2023
1 parent 586a0d2 commit 237dcb5
Show file tree
Hide file tree
Showing 59 changed files with 54,423 additions and 171 deletions.
8 changes: 7 additions & 1 deletion libs/citations/apa-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
"syntax",
"tree",
"ast"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "apa-parser",
"tsconfig": "./tsconfig.lib.json"
}
}
3 changes: 0 additions & 3 deletions libs/citations/apa-parser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
},
{
"path": "./tsconfig.spec.json"
}
Expand Down
4 changes: 2 additions & 2 deletions libs/citations/apa-parser/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"declaration": true,
"types": ["node"]
},
"exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"],
"include": ["**/*.ts"]
"include": ["**/*.ts"],
"exclude": ["**/spec/*", "**/*.spec.ts", "**/*.test.ts", "jest.config.ts"]
}
10 changes: 8 additions & 2 deletions libs/citations/crossref-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@
"syntax",
"tree",
"ast"
]
}
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "crossref-json",
"tsconfig": "./tsconfig.lib.json"
}
}
10 changes: 8 additions & 2 deletions libs/citations/crossref-to-csl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
"syntax",
"tree",
"ast"
]
}
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "crossref-to-csl",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/citations/csl-consolidate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@
"references",
"citations",
"metadata"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "csl-consolidate",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/citations/csl-to-biblatex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@
"references",
"csl-json",
"bibliography"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "csl-to-biblatex",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/citations/ojs-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@
"open-journal-systems",
"pkp",
"typescript"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "ojs-api",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/citations/parse-text-cite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
"references",
"bibliography",
"parser"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "parse-text-cite",
"tsconfig": "./tsconfig.lib.json"
}
}
6 changes: 6 additions & 0 deletions libs/jast/jast-util-from-csl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
"to-vfile": "^7.2.3",
"unified": "^10.1.1",
"vfile": "^5.3.0"
},
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "jast-util-from-csl",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/jast/jast-util-to-csl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@
"converter",
"ast",
"unified"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "jast-util-to-csl",
"tsconfig": "./tsconfig.lib.json"
}
}
6 changes: 6 additions & 0 deletions libs/jast/jast-util-to-texast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,11 @@
"csl-json": "^0.1.0",
"unist-util-remove-position": "4.0.0",
"unist-util-visit-parents": "5.0.0"
},
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "jast-util-to-texast",
"tsconfig": "./tsconfig.lib.json"
}
}
62 changes: 5 additions & 57 deletions libs/jast/jast-util-to-texast/src/lib/jast-util-to-texast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function toTexast(
quotes: ['"'],
topSection: 1,
columnSeparator: false,
}
},
) {
// const byId: { [s: string]: Element } = {}
let texast: TexastContent | TexastRoot
Expand All @@ -41,7 +41,7 @@ export function toTexast(
node: TexastRoot | TexastContent,
type: string,
props?: Attributes | string | TexastContent[],
children?: string | TexastContent[]
children?: string | TexastContent[],
) => {
let attributes: Attributes | undefined

Expand Down Expand Up @@ -77,9 +77,7 @@ export function toTexast(
/** @type {string|null} */
frozenBaseUrl: null,
qNesting: 0,
handlers: options.handlers
? { ...handlers, ...options.handlers }
: handlers,
handlers: options.handlers ? { ...handlers, ...options.handlers } : handlers,
document: options.document,
checked: options.checked || '[x]',
unchecked: options.unchecked || '[ ]',
Expand All @@ -93,9 +91,8 @@ export function toTexast(
booktabs: options.booktabs ?? true,
rowNumber: 0,
numberOfRows: 0,
citationAnalyzer:
options.citationAnalyzer || ((node: Node) => 'autocite'),
} as Context
citationAnalyzer: options.citationAnalyzer || ((node: Node) => 'autocite'),
} as Context,
)

// visit(tree, 'element', (node) => {
Expand Down Expand Up @@ -126,53 +123,4 @@ export function toTexast(
// visit(mdast, 'text', ontext)

return texast

/**
* Collapse text nodes, and fix whitespace.
* Most of this is taken care of by `rehype-minify-whitespace`, but
* we’re generating some whitespace too, and some nodes are in the end
* ignored.
* So clean up.
*
//* {import('unist-util-visit/complex-types').BuildVisitor TexastRoot, 'text'>}
*/
function ontext(node: any, index: any, parent: any) {
/* c8 ignore next 3 */
if (index === null || !parent) {
return
}

const previous = parent.children[index - 1]

if (previous && previous.type === node.type) {
previous.value += node.value
parent.children.splice(index, 1)

if (previous.position && node.position) {
previous.position.end = node.position.end
}

// Iterate over the previous node again, to handle its total value.
return index - 1
}

node.value = node.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/, '$1')

// We don’t care about other phrasing nodes in between (e.g., `[ asd ]()`),
// as there the whitespace matters.
if (parent && block(parent)) {
if (!index) {
node.value = node.value.replace(/^[\t ]+/, '')
}

if (index === parent.children.length - 1) {
node.value = node.value.replace(/[\t ]+$/, '')
}
}

if (!node.value) {
parent.children.splice(index, 1)
return index
}
}
}
8 changes: 7 additions & 1 deletion libs/jast/jast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@
"tree",
"ast",
"unified"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "jast-types",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/notion/html-to-notion-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
"syntax",
"tree",
"ast"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "html-to-notion-blocks",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/notion/rehype-notion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
"syntax",
"tree",
"ast"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "rehype-notion",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/ojs/ojs-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
"syntax",
"tree",
"ast"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "ojs-client",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/ojs/ojs-relatex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
"syntax",
"tree",
"ast"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "ojs-relatex",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/ooxast/ooxast-util-citation-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
"docx",
"ooxast",
"citation"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "ooxast-util-citation-plugin",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/ooxast/ooxast-util-citations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@
"ooxast",
"docx",
"ast"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "ooxast-util-citations",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/ooxast/ooxast-util-get-style/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@
"ooxast",
"docx",
"reoff"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "ooxast-util-get-style",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/ooxast/ooxast-util-parse-bib-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@
"syntax",
"tree",
"ast"
]
],
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "ooxast-util-parse-bib-browser",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/ooxast/ooxast-util-parse-bib-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@
"tree",
"ast"
],
"dependencies": {}
"dependencies": {},
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "ooxast-util-parse-bib-node",
"tsconfig": "./tsconfig.lib.json"
}
}
8 changes: 7 additions & 1 deletion libs/ooxast/ooxast-util-parse-bib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@
"citations",
"anystyle"
],
"dependencies": {}
"dependencies": {},
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"displayName": "ooxast-util-parse-bib",
"tsconfig": "./tsconfig.lib.json"
}
}
Loading

0 comments on commit 237dcb5

Please sign in to comment.