Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# your-comark-plugin

[![npm version](https://img.shields.io/npm/v/your-comark-plugin?color=black)](https://npmx.dev/your-comark-plugin)
[![npm downloads](https://img.shields.io/npm/dm/your-comark-plugin?color=black)](https://npm.chart.dev/your-comark-plugin)
[![CI](https://img.shields.io/github/actions/workflow/status/your-name/your-comark-plugin/ci.yml?branch=main&color=black)](https://github.com/your-name/your-comark-plugin/actions/workflows/ci.yml)
[![license](https://img.shields.io/github/license/your-name/your-comark-plugin?color=black)](https://github.com/your-name/your-comark-plugin/blob/main/LICENSE)

> This repo is a skeleton — work through the [checklist](#-replace-these) below,
> then replace the starter logic in `src/index.ts` with your own.

Expand All @@ -10,15 +15,17 @@ GitHub Actions CI.

## 📋 Replace these

Search the repo for `TODO` and `your-comark-plugin` to find every placeholder.
Search the repo for `TODO`, `your-comark-plugin`, and `your-name` to find every
placeholder.

- [ ] **`package.json`** — `name`, `description`, `keywords`, `author`,
`homepage`, `bugs`, `repository`.
- [ ] **`LICENSE`** — your name and year (or swap in a different license).
- [ ] **`src/index.ts`** — the plugin `name`, the `PluginOptions` / `PluginMeta`
types, and the `post` hook logic.
- [ ] **`test/plugin.test.ts`** — real tests for your plugin.
- [ ] **This `README.md`** — the title, description, and usage example.
- [ ] **This `README.md`** — the title, description, usage example, and badge
URLs (`your-comark-plugin` / `your-name`).

## Getting started

Expand All @@ -39,10 +46,10 @@ pnpm build # bundle dist/ (ESM + type declarations) with tsdown
Consumers register your plugin when parsing:

```ts
import { parse } from 'comark'
import { parseMarkdown } from 'comark'
import plugin from 'your-comark-plugin'

const tree = await parse(content, { plugins: [plugin()] })
const tree = await parseMarkdown(content, { plugins: [plugin()] })
```

## Anatomy of a Comark plugin
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
"comark": ">=0.4.0"
},
"devDependencies": {
"@types/node": "^22.10.0",
"comark": "^0.4.0",
"tsdown": "^0.22.3",
"tsx": "^4.22.4",
"typescript": "^5.7.0",
"vitest": "^4.1.4"
"@types/node": "^26.6.2",
"comark": "^0.7.0",
"tsdown": "^0.23.0",
"tsx": "^4.23.15",
"typescript": "^7.0.2",
"vitest": "^5.0.1"
},
"packageManager": "pnpm@11.5.2",
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions playground/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from 'comark'
import { parseMarkdown } from 'comark'
import plugin from '../src/index.ts'

// A scratchpad for trying your plugin. Edit the content, tweak `src/index.ts`,
Expand All @@ -12,7 +12,7 @@ title: Playground
Some **markdown** to run your plugin against.
`

const tree = await parse(content, { plugins: [plugin()] })
const tree = await parseMarkdown(content, { plugins: [plugin()] })

console.log('nodes:', tree.nodes)
console.log('frontmatter:', tree.frontmatter)
Expand Down
Loading
Loading