https://github.com/trialanderrororg/jast-util-from-csl
Transform a CSL list or object to a [jast][jast] node.
https://github.com/trialanderrororg/jast-util-from-csl
ast conversion csl jats-xml tree
Last synced: 8 months ago
JSON representation
Transform a CSL list or object to a [jast][jast] node.
- Host: GitHub
- URL: https://github.com/trialanderrororg/jast-util-from-csl
- Owner: TrialAndErrorOrg
- Created: 2023-02-28T21:57:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-09T23:47:58.000Z (over 3 years ago)
- Last Synced: 2025-01-01T04:52:45.847Z (over 1 year ago)
- Topics: ast, conversion, csl, jats-xml, tree
- Language: TypeScript
- Size: 37.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
> **Note**
> This repository is automatically generated from the [main parser monorepo](https://github.com/TrialAndErrorOrg/parsers). Please submit any issues or pull requests there.
## API
***
### `cslToFront()`
#### Signature
```ts
cslToFront(data: Data): void;
```
#### Parameters
| Name | Type |
| :------ | :------ |
| `data` | `Data` |
#### Returns
`void`
Defined in: [lib/csl-to-jast.ts:27](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/jast/jast-util-from-csl/src/lib/csl-to-jast.ts#L27)
***
### `cslToJats()`
#### Signature
```ts
cslToJats(data: Data | Data[]): void | RefList;
```
#### Parameters
| Name | Type |
| :------ | :------ |
| `data` | `Data` | `Data`[] |
#### Returns
`void` | `RefList`
Defined in: [lib/csl-to-jast.ts:19](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/jast/jast-util-from-csl/src/lib/csl-to-jast.ts#L19)
***
### `cslToRef()`
#### Signature
```ts
cslToRef(data: Data, index: string | number): Ref;
```
#### Parameters
| Name | Type |
| :------ | :------ |
| `data` | `Data` |
| `index` | `string` | `number` |
#### Returns
`Ref`
Defined in: [lib/csl-to-jast.ts:44](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/jast/jast-util-from-csl/src/lib/csl-to-jast.ts#L44)
***
### `cslToRefList()`
#### Signature
```ts
cslToRefList(data: Data[] | {
}): RefList;
```
#### Parameters
| Name | Type |
| :------ | :------ |
| `data` | `Data`[] | { } |
#### Returns
`RefList`
Defined in: [lib/csl-to-jast.ts:31](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/jast/jast-util-from-csl/src/lib/csl-to-jast.ts#L31)
## Install
This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install as
```bash
pnpm add jast-util-from-csl
# or with yarn
[](https://badge.fury.io/js/jast-util-from-csl) [](https://www.npmjs.com/package/jast-util-from-csl)
# yarn add jast-util-from-csl
# or with npm
# npm install jast-util-from-csl
```
# csl-util-to-jast
Transform a CSL list or object to a [jast][jast] node.