Skip to content

Commit

Permalink
Rebuild documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
siefkenj committed Aug 20, 2024
1 parent 5f516a2 commit 0aabe43
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 72 deletions.
8 changes: 4 additions & 4 deletions packages/unified-latex-ctan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import the `.js` file. To explicitly access the commonjs export, import the `.cj

# Constants

| Name | Type | Description |
| :---------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------- |
| `environmentInfo` | `{ cleveref: EnvInfoRecord; exam: EnvInfoRecord; geometry: EnvInfoRecord; hyperref: EnvInfoRecord; latex2e: EnvInfoRecord; ... 10 more ...; multicol: EnvInfoRecord; }` | Info about the environments for available ctan packages. `latex2e` contains
the standard environments for LaTeX. |
| `macroInfo` | `{ cleveref: MacroInfoRecord; exam: MacroInfoRecord; geometry: MacroInfoRecord; hyperref: MacroInfoRecord; latex2e: MacroInfoRecord; ... 10 more ...; multicol: MacroInfoRecord; }` | Info about the macros for available ctan packages. `latex2e` contains
the standard macros for LaTeX. |
| Name | Type | Description |
| :---------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------- |
| `environmentInfo` | `{ amsart: EnvInfoRecord; cleveref: EnvInfoRecord; exam: EnvInfoRecord; geometry: EnvInfoRecord; hyperref: EnvInfoRecord; ... 11 more ...; multicol: EnvInfoRecord; }` | Info about the environments for available ctan packages. `latex2e` contains
the standard environments for LaTeX. |
| `macroInfo` | `{ amsart: MacroInfoRecord; cleveref: MacroInfoRecord; exam: MacroInfoRecord; geometry: MacroInfoRecord; hyperref: MacroInfoRecord; ... 11 more ...; multicol: MacroInfoRecord; }` | Info about the macros for available ctan packages. `latex2e` contains
the standard macros for LaTeX. |
2 changes: 1 addition & 1 deletion packages/unified-latex-lint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ import the `.js` file. To explicitly access the commonjs export, import the `.cj

| Name | Type | Description |
| :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------ |
| `lints` | `{ unifiedLatexLintArgumentColorCommands: Plugin<void[] \| [{ fix?: boolean; } \| [boolean \| Severity \| Label, { fix?: boolean; }?]], Root, Root>; ... 7 more ...; unifiedLatexLintPreferSetlength: Plugin<...>; }` | Object exporting all available lints. |
| `lints` | `{ unifiedLatexLintArgumentColorCommands: Plugin<void[] \| [{ fix?: boolean; } \| [boolean \| Label \| Severity, { fix?: boolean; }?]], Root, Root>; ... 7 more ...; unifiedLatexLintPreferSetlength: Plugin<...>; }` | Object exporting all available lints. |
48 changes: 10 additions & 38 deletions packages/unified-latex-to-pretext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,36 +81,19 @@ Unified plugin to convert a `unified-latex` AST into a `xast` AST representation
#### options

```typescript
HtmlLikePluginOptions
PluginOptions
```

### Type

`Plugin<HtmlLikePluginOptions[], Ast.Root, Xast.Root>`
`Plugin<PluginOptions[], Ast.Root, Xast.Root>`

```typescript
function unifiedLatexToPretext(
options: HtmlLikePluginOptions
options: PluginOptions
): (tree: Ast.Root, file: VFile) => Xast.Root;
```

where

```typescript
type HtmlLikePluginOptions = {
/**
* Functions called to replace environments during processing. Key values should match environment names.
* You probably want to use the function `htmlLike(...)` to return a node that gets converted to specific HTML.
*/
environmentReplacements?: EnvironmentReplacements;
/**
* Functions called to replace macros during processing. Key values should match macro names.
* You probably want to use the function `htmlLike(...)` to return a node that gets converted to specific HTML.
*/
macroReplacements?: MacroReplacements;
};
```

## `unifiedLatexWrapPars`

Unified plugin to wrap paragraphs in `\html-tag:p{...}` macros.
Expand Down Expand Up @@ -196,23 +179,6 @@ function convertToPretext(
| tree | `Ast.Node \| Ast.Node[]` |
| options | `PluginOptions` |

where

```typescript
type PluginOptions = {
/**
* Functions called to replace environments during processing. Key values should match environment names.
* You probably want to use the function `htmlLike(...)` to return a node that gets converted to specific HTML.
*/
environmentReplacements?: EnvironmentReplacements;
/**
* Functions called to replace macros during processing. Key values should match macro names.
* You probably want to use the function `htmlLike(...)` to return a node that gets converted to specific HTML.
*/
macroReplacements?: MacroReplacements;
};
```

## `wrapPars(nodes, options)`

Wrap paragraphs in `<p>...</p>` tags.
Expand Down Expand Up @@ -253,5 +219,11 @@ function wrapPars(
## `PluginOptions`

```typescript
export type PluginOptions = HtmlLikePluginOptions & {};
export type PluginOptions = HtmlLikePluginOptions & {
/**
* A boolean where if it's true then the output won't be wrapped in the <pretext><article> ... etc. tags.
* If it's false (default), a valid and complete PreTeXt document is returned.
*/
producePretextFragment?: boolean;
};
```
2 changes: 1 addition & 1 deletion packages/unified-latex-util-align/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function createMatchers(
): {
isRowSep: Ast.TypeGuard<Ast.Macro & { content: string }>;
isColSep: (node: Ast.Node) => boolean;
isWhitespace: (node: Ast.Node) => boolean;
isWhitespace: (node: Ast.Node) => node is Ast.Whitespace;
isSameLineComment: (node: Ast.Node) => boolean;
isOwnLineComment: (node: Ast.Node) => boolean;
};
Expand Down
6 changes: 3 additions & 3 deletions packages/unified-latex-util-arguments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ option.
#### options

```typescript
{ macros: Ast.MacroInfoRecord; }
{ macros: MacroInfoRecord; }
```

### Type

`Plugin<{ macros: Ast.MacroInfoRecord; }[], Ast.Root, Ast.Root>`
`Plugin<{ macros: MacroInfoRecord; }[], Ast.Root, Ast.Root>`

```typescript
function unifiedLatexAttachMacroArguments(options: {
macros: Ast.MacroInfoRecord;
macros: MacroInfoRecord;
}): (tree: Ast.Root) => void;
```

Expand Down
6 changes: 3 additions & 3 deletions packages/unified-latex-util-environments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ Unified plugin to process environment content and attach arguments.
#### options

```typescript
{ environments: Ast.EnvInfoRecord; }
{ environments: EnvInfoRecord; }
```

### Type

`Plugin<{ environments: Ast.EnvInfoRecord; }[], Ast.Root, Ast.Root>`
`Plugin<{ environments: EnvInfoRecord; }[], Ast.Root, Ast.Root>`

```typescript
function unifiedLatexProcessEnvironments(options: {
environments: Ast.EnvInfoRecord;
environments: EnvInfoRecord;
}): (tree: Ast.Root) => void;
```

Expand Down
2 changes: 1 addition & 1 deletion packages/unified-latex-util-macros/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function createMacroExpander(

```typescript
function createMatchers(): {
isHash: (node: Ast.Node) => boolean;
isHash: (node: Ast.Node) => node is Ast.String;
isNumber: (node: Ast.Node) => boolean;
splitNumber: (
node: Ast.String
Expand Down
6 changes: 3 additions & 3 deletions packages/unified-latex-util-match/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ import the `.js` file. To explicitly access the commonjs export, import the `.cj

# Constants

| Name | Type | Description |
| :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------- |
| `match` | `{ macro(node: any, macroName?: string): node is Ast.Macro; anyMacro(node: any): node is Ast.Macro; environment(node: any, envName?: string): node is Ast.Environment; anyEnvironment(node: any): node is Ast.Environment; ... 11 more ...; createEnvironmentMatcher: (macros: string[] \| Record<...>) => Ast.TypeGuard<...>; }` | Functions to match different types of nodes. |
| Name | Type | Description |
| :------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------- |
| `match` | `{ macro(node: any, macroName?: string): node is Ast.Macro; anyMacro(node: any): node is Ast.Macro; environment(node: any, envName?: string): node is Ast.Environment; ... 12 more ...; createEnvironmentMatcher: (macros: string[] \| Record<string, unknown>) => Ast.TypeGuard<Ast.Environment>; }` | Functions to match different types of nodes. |
16 changes: 8 additions & 8 deletions packages/unified-latex-util-parse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ Parse a string to a LaTeX AST.
#### options

```typescript
{ mode?: "math" | "regular"; macros?: Ast.MacroInfoRecord; environments?: Ast.EnvInfoRecord; flags?: { atLetter?: boolean; expl3?: boolean; autodetectExpl3AndAtLetter?: boolean; }; }
{ mode?: "math" | "regular"; macros?: MacroInfoRecord; environments?: EnvInfoRecord; flags?: { atLetter?: boolean; expl3?: boolean; autodetectExpl3AndAtLetter?: boolean; }; }
```

### Type

`Plugin<{ mode?: "math" | "regular"; macros?: Ast.MacroInfoRecord; environments?: Ast.EnvInfoRecord; flags?: { atLetter?: boolean; expl3?: boolean; autodetectExpl3AndAtLetter?: boolean; }; }[], string, Ast.Root>`
`Plugin<{ mode?: "math" | "regular"; macros?: MacroInfoRecord; environments?: EnvInfoRecord; flags?: { atLetter?: boolean; expl3?: boolean; autodetectExpl3AndAtLetter?: boolean; }; }[], string, Ast.Root>`

```typescript
function unifiedLatexFromString(options: {
mode?: "math" | "regular";
macros?: Ast.MacroInfoRecord;
environments?: Ast.EnvInfoRecord;
macros?: MacroInfoRecord;
environments?: EnvInfoRecord;
flags?: {
atLetter?: boolean;
expl3?: boolean;
Expand Down Expand Up @@ -134,17 +134,17 @@ are reparsed (if needed) in math mode.
#### options

```typescript
{ environments: Ast.EnvInfoRecord; macros: Ast.MacroInfoRecord; }
{ environments: EnvInfoRecord; macros: MacroInfoRecord; }
```

### Type

`Plugin<{ environments: Ast.EnvInfoRecord; macros: Ast.MacroInfoRecord; }[], Ast.Root, Ast.Root>`
`Plugin<{ environments: EnvInfoRecord; macros: MacroInfoRecord; }[], Ast.Root, Ast.Root>`

```typescript
function unifiedLatexProcessMacrosAndEnvironmentsWithMathReparse(options: {
environments: Ast.EnvInfoRecord;
macros: Ast.MacroInfoRecord;
environments: EnvInfoRecord;
macros: MacroInfoRecord;
}): (tree: Ast.Root) => void;
```

Expand Down
10 changes: 1 addition & 9 deletions packages/unified-latex-util-pgfkeys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,7 @@ import the `.js` file. To explicitly access the commonjs export, import the `.cj


```typescript
function createMatchers(): {
isChar: (node: Ast.Node, char: string) => boolean;
isComma: (node: Ast.Node) => boolean;
isEquals: (node: Ast.Node) => boolean;
isWhitespace: (node: Ast.Node) => boolean;
isParbreak: (node: Ast.Node) => boolean;
isSameLineComment: (node: Ast.Node) => boolean;
isOwnLineComment: (node: Ast.Node) => boolean;
};
function createMatchers(): { isChar: (node: Ast.Node, char: string) => node is Ast.String; isComma: (node: Ast.Node) => node is Ast.String; isEquals: (node: Ast.Node) => node is Ast.String; isWhitespace: (node: Ast.Node) => node is Ast.Whitespace; isParbreak: (node: Ast.Node) => node is Ast.Parbreak; isSameLineComment: (node: Ast.Node) => boo...
```
## `parsePgfkeys(ast, options)`
Expand Down
2 changes: 1 addition & 1 deletion packages/unified-latex-util-scan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Efficiently search for a large number of strings using a prefix-tree.
The longest match is returned.

```typescript
function prefixMatch(nodes: Ast.Node[], prefixes: string | string[] | { dump(spacer?: number): string; tree(): any; addWord(word: string): ...; removeWord(word: string): ...; isPrefix(word: string): boolean; countPrefix(word: string): number; ... 5 more ...; getSubAnagrams(word: string): string[]; }, options: { startIndex?: number; matchSubstrings?: boolean; assumeOneCharStrings?: boolean; }): { match: string; endNodeIndex: number; endNodePartialMatch: string | null; }
function prefixMatch(nodes: Ast.Node[], prefixes: string | string[] | { dump(spacer?: number): string; tree(): any; addWord(word: string): ReturnType<typeof Trie>; removeWord(word: string): ReturnType<typeof Trie>; ... 7 more ...; getSubAnagrams(word: string): string[]; }, options: { startIndex?: number; matchSubstrings?: boolean; assumeOneCharStrings?: boolean; }): { match: string; endNodeIndex: number; endNodePartialMatch: string | null; }
```

**Parameters**
Expand Down

0 comments on commit 0aabe43

Please sign in to comment.