-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/loaders/markdown/transformer/fixtures/code-group/expect.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { IMdTransformerResult } from '../..'; | ||
|
||
export default (ret: IMdTransformerResult) => { | ||
expect(ret.content).toEqual( | ||
'<><div className="markdown"><h3 id="codegroup"><a aria-hidden="true" tabIndex="-1" href="#codegroup"><span className="icon icon-link" /></a>{"CodeGroup"}</h3></div><CodeGroup><SourceCode title="npm" lang="bash">{$$contentTexts[0].value}</SourceCode><SourceCode title="yarn" lang="bash">{$$contentTexts[1].value}</SourceCode><SourceCode title="pnpm" lang="bash">{$$contentTexts[2].value}</SourceCode><SourceCode title=".dumirc.ts" lang="ts">{$$contentTexts[3].value}</SourceCode></CodeGroup></>', | ||
); | ||
}; |
25 changes: 25 additions & 0 deletions
25
src/loaders/markdown/transformer/fixtures/code-group/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
### CodeGroup | ||
|
||
:::code-group | ||
|
||
```bash [npm] | ||
npm install -D dumi | ||
``` | ||
|
||
```bash [yarn] | ||
yarn add -D dumi | ||
``` | ||
|
||
```bash [pnpm] | ||
pnpm add -D dumi | ||
``` | ||
|
||
```ts [.dumirc.ts] | ||
import { defineConfig } from 'dumi'; | ||
|
||
export default defineConfig({ | ||
// ... | ||
}); | ||
``` | ||
|
||
::: |