github-markdown-adf 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -2
- package/dist/browser/index.iife.js +25 -25
- package/dist/browser/index.js +16 -16
- package/dist/index.cjs +229 -83
- package/dist/index.d.cts +14 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +14 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +229 -83
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
Bidirectional **GitHub Flavored Markdown (GFM) to / from Atlassian Document Format (ADF)** converter.
|
|
8
8
|
|
|
9
|
+
## AI Notice
|
|
10
|
+
|
|
11
|
+
This package has predominantly AI-generated code. Keep this in mind in case you have a strict policy against using ai-generated code in your project.
|
|
12
|
+
|
|
9
13
|
## Install
|
|
10
14
|
|
|
11
15
|
```bash
|
|
@@ -135,18 +139,37 @@ import { mdToAdf, adfToMd } from 'github-markdown-adf';
|
|
|
135
139
|
|
|
136
140
|
Converts a GFM string to an ADF document object. Parses using [remark](https://github.com/remarkjs/remark) / [unified](https://github.com/unifiedjs/unified) with full GFM extensions: tables, task lists, strikethrough, and GitHub Alert syntax (`> [!NOTE]`, `> [!WARNING]`, etc.).
|
|
137
141
|
|
|
138
|
-
### `adfToMd(adf: AdfDoc): string`
|
|
142
|
+
### `adfToMd(adf: AdfDoc, options?: AdfToMdOptions): string`
|
|
139
143
|
|
|
140
144
|
Converts an ADF document object to a GFM string. Handles all standard ADF node and mark types and produces clean, readable output targeting GitHub Flavored Markdown.
|
|
141
145
|
|
|
146
|
+
## Options
|
|
147
|
+
|
|
148
|
+
`adfToMd` accepts an optional second argument to control rendering behaviour.
|
|
149
|
+
|
|
150
|
+
### `AdfToMdOptions`
|
|
151
|
+
|
|
152
|
+
| Option | Type | Default | Description |
|
|
153
|
+
|---|---|---|---|
|
|
154
|
+
| `mentions` | `boolean` | `true` | When `true`, renders mention nodes as the display text if available, otherwise as `@{id}`. When `false`, renders as plain text: display text if available, otherwise just the bare `{id}` without an `@` prefix. |
|
|
155
|
+
|
|
156
|
+
### Usage example
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
// Render mentions as plain text instead of @-tagged references
|
|
160
|
+
const md = adfToMd(adfDoc, { mentions: false });
|
|
161
|
+
```
|
|
162
|
+
|
|
142
163
|
## TypeScript Types
|
|
143
164
|
|
|
144
|
-
All ADF types are exported for use in your own code:
|
|
165
|
+
All ADF types and option interfaces are exported for use in your own code:
|
|
145
166
|
|
|
146
167
|
```typescript
|
|
147
168
|
import type { AdfDoc, AdfNode, AdfMark, AdfInlineNode, AdfTopLevelBlockNode } from 'github-markdown-adf';
|
|
148
169
|
// Also available: ParagraphNode, HeadingNode, TableNode, PanelNode, CodeBlockNode,
|
|
149
170
|
// BulletListNode, OrderedListNode, TaskListNode, TextNode, MentionNode, ...and more
|
|
171
|
+
|
|
172
|
+
import type { AdfToMdOptions } from 'github-markdown-adf';
|
|
150
173
|
```
|
|
151
174
|
|
|
152
175
|
## Requirements
|