https://github.com/trialanderrororg/ooxast-util-parse-bib
Find and convert raw references to CSL-JSON using `anystyle`.
https://github.com/trialanderrororg/ooxast-util-parse-bib
anystyle bibliography citations ooxast references unified
Last synced: 3 days ago
JSON representation
Find and convert raw references to CSL-JSON using `anystyle`.
- Host: GitHub
- URL: https://github.com/trialanderrororg/ooxast-util-parse-bib
- Owner: TrialAndErrorOrg
- Created: 2023-02-28T21:57:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-28T18:53:09.000Z (over 1 year ago)
- Last Synced: 2025-05-25T20:45:45.729Z (5 months ago)
- Topics: anystyle, bibliography, citations, ooxast, references, unified
- Language: TypeScript
- Size: 6.92 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/funding.yml
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.# ooxast-util-parse-bib
[](https://badge.fury.io/js/ooxast-util-parse-bib) [](https://www.npmjs.com/package/ooxast-util-parse-bib)
Find and convert raw references to CSL-JSON using `anystyle`.
Takes a bibliography array (usually of `w:p`s) and parses it using `anystyle` to CSL.
You need to either: set up an anystyle API on your own (very easy to do, just click the "Deploy to vercel" button below for a version identical to the one used in this repo) or provide the path to the `anystyle` executable.
## Contents
* [ooxast-util-parse-bib](#ooxast-util-parse-bib)
* [Contents](#contents)
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Web API](#web-api)
* [Locally](#locally)
* [Use](#use)
* [Options](#options)
* [API](#api)
* [Syntax tree](#syntax-tree)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)## What is this?
## When should I use this?
## 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 ooxast-util-parse-bib
# or with yarn
# yarn add ooxast-util-parse-bib
# or with npm
# npm install ooxast-util-parse-bib
```## Use
### Options
```ts
parseBib(tree: OoxastTree, options:{
apiUrl?: string,
apiParams?: {param:string}[],
anyStylePath?: string
})
```If no options are provided it will try to use Anystyle on your path, and probably fail.
## API
***
### `parseBib()`
#### Signature
```ts
parseBib(tree: Node, options: Options): Promise;
```#### Parameters
| Name | Type |
| :------ | :------ |
| `tree` | `Node`<`Data`> |
| `options` | [`Options`](modules.md#options) |#### Returns
`Promise`<`undefined` | `Data`[]>
Defined in: [lib/ooxast-util-parse-bib.ts:13](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/ooxast/ooxast-util-parse-bib/src/lib/ooxast-util-parse-bib.ts#L13)
***
### `Options`
#### Properties
##### `anyStylePath?`
> `string`
Defined in: [lib/ooxast-util-parse-bib.ts:8](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/ooxast/ooxast-util-parse-bib/src/lib/ooxast-util-parse-bib.ts#L8)
##### `apiParams?`
> `object`
```ts
{
param: string;
}
```###### Type declaration
| Member | Type |
| :------ | :------ |
| `param` | `string` |Defined in: [lib/ooxast-util-parse-bib.ts:6](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/ooxast/ooxast-util-parse-bib/src/lib/ooxast-util-parse-bib.ts#L6)
##### `apiUrl?`
> `string`
Defined in: [lib/ooxast-util-parse-bib.ts:5](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/ooxast/ooxast-util-parse-bib/src/lib/ooxast-util-parse-bib.ts#L5)
##### `headers?`
> `object`
```ts
{
header: string;
}
```###### Type declaration
| Member | Type |
| :------ | :------ |
| `header` | `string` |Defined in: [lib/ooxast-util-parse-bib.ts:7](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/ooxast/ooxast-util-parse-bib/src/lib/ooxast-util-parse-bib.ts#L7)
##### `mailto?`
> `string`
Defined in: [lib/ooxast-util-parse-bib.ts:9](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/ooxast/ooxast-util-parse-bib/src/lib/ooxast-util-parse-bib.ts#L9)
##### `overrideId?`
> `boolean`
Defined in: [lib/ooxast-util-parse-bib.ts:10](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/ooxast/ooxast-util-parse-bib/src/lib/ooxast-util-parse-bib.ts#L10)
## Syntax tree
## Types
## Compatibility
## Security
## Related
## Contribute
## License
[GPL-3.0-or-later](LICENSE) © Thomas F. K. Jorna
[unified]: https://unifiedjs.com
[unifiedgh]: https://github.com/unifiedjs/unified
[xast-from-xml]: https://github.com/syntax-tree/xast-util-from-xml
[rehype]: https://github.com/rehypejs/rehype
[rejour]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour
[rejour-parse]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/rejour-parse
[rejour-stringify]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/rejour-stringify
[rejour-move-abstract]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/rejour-move-abstract
[rejour-meta]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/rejour-meta
[rejour-relatex]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/rejour-relatex
[relatex]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/relatex
[ooxast-util-to-jast]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/relatex/ooxast-util-to-jast
[jast]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/jast
[jast-util-to-texast]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/jast-util-to-texast
[jastscript]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/rejour/jastscript
[texast]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/relatex/texast
[texast-util-to-latex]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/relatex/texast-util-to-latex
[hast]: https://github.com/syntax-tree/hast
[xast]: https://github.com/syntax-tree/xast
[mdast]: https://github.com/syntax-tree/mdast
[mdast-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown
[latex-utensils]: https://github.com/tamuratak/latex-utensils
[latexjs]: https://github.com/latexjs/latexjs
[reoff]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/reoff
[reoff-parse]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/reoff/reoff-parse
[reoff-rejour]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/reoff/reoff-rejour
[ooxast]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/ooxast/ooxast
[ooxast]: https://github.com/TrialAndErrorOrg/parsers/tree/main/libs/ooxast/ooxast-util-to-jast