Skip to content

Commit 9024434

Browse files
committed
Update readme
1 parent 67010df commit 9024434

File tree

1 file changed

+52
-8
lines changed

1 file changed

+52
-8
lines changed

readme.md

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
[![Coverage][coverage-badge]][coverage]
55
[![Downloads][downloads-badge]][downloads]
66
[![Size][size-badge]][size]
7-
[![Sponsors][sponsors-badge]][collective]
8-
[![Backers][backers-badge]][collective]
97
[![Chat][chat-badge]][chat]
108

119
[micromark][] extensions to support math (`$C_L$`).
@@ -15,6 +13,8 @@
1513
* [What is this?](#what-is-this)
1614
* [When to use this](#when-to-use-this)
1715
* [Install](#install)
16+
* [Replacing the official package](#replacing-the-official-package)
17+
* [Standard Installation](#standard-installation)
1818
* [Use](#use)
1919
* [API](#api)
2020
* [`math(options?)`](#mathoptions)
@@ -59,6 +59,56 @@ making it easier to transform content by abstracting these internals away.
5959

6060
## Install
6161

62+
### Replacing the official package
63+
64+
If you are using another tool (such as `remark-math`) that depends on the original `micromark-extension-math`, you will need to tell your build tool or package manager to use this package (`micromark-extension-cfm-math`) instead.
65+
66+
#### With Vite
67+
68+
In your `vite.config.js` (or `vite.config.ts`), you can use the `resolve.alias` option:
69+
70+
```js
71+
import { defineConfig } from 'vite'
72+
73+
export default defineConfig({
74+
// ...
75+
resolve: {
76+
alias: {
77+
'micromark-extension-math': 'micromark-extension-cfm-math'
78+
}
79+
}
80+
})
81+
```
82+
83+
#### With Package Manager Overrides
84+
85+
A more robust method is to use the overrides feature of your package manager. This forces the dependency resolution to always use your preferred version, regardless of how deep it is in the dependency tree.
86+
87+
* **For npm (v8.3.0+):** add this to your `package.json`:
88+
```json
89+
"overrides": {
90+
"micromark-extension-math": "npm:micromark-extension-cfm-math@^3"
91+
}
92+
```
93+
* **For pnpm:** add this to your `package.json`:
94+
```json
95+
"pnpm": {
96+
"overrides": {
97+
"micromark-extension-math": "npm:micromark-extension-cfm-math@^3"
98+
}
99+
}
100+
```
101+
* **For Yarn (v1 Classic and v2+ Modern):** add this to your `package.json`:
102+
```json
103+
"resolutions": {
104+
"micromark-extension-math": "npm:micromark-extension-cfm-math@^3"
105+
}
106+
```
107+
108+
After adding this, delete your `node_modules` directory and lock file (`package-lock.json`, `pnpm-lock.yaml`, or `yarn.lock`), and run install again.
109+
110+
### Standard Installation
111+
62112
This package is [ESM only][esm].
63113
In Node.js (version 16+), install with [npm][]:
64114

@@ -372,12 +422,6 @@ abide by its terms.
372422

373423
[size]: https://bundlejs.com/?q=micromark-extension-cfm-math
374424

375-
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
376-
377-
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
378-
379-
[collective]: https://opencollective.com/unified
380-
381425
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
382426

383427
[chat]: https://github.com/alephpiece/micromark-extension-cfm-math/discussions

0 commit comments

Comments
 (0)