Skip to content

Commit

Permalink
[move] Add move codeblock icon
Browse files Browse the repository at this point in the history
  • Loading branch information
hariria committed Mar 26, 2024
1 parent 217f708 commit ae4bac9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/nextra/src/client/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ export { ReactComponent as CsharpIcon } from './csharp.svg'
export { ReactComponent as GraphQLIcon } from './graphql.svg'
export { ReactComponent as PythonIcon } from './python.svg'
export { ReactComponent as RustIcon } from './rust.svg'
export { ReactComponent as MoveIcon } from './move.svg'
9 changes: 9 additions & 0 deletions packages/nextra/src/client/icons/move.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ describe('rehypeIcon', () => {
import { GraphQLIcon } from 'nextra/icons'
import { PythonIcon } from 'nextra/icons'
import { RustIcon } from 'nextra/icons'
import { MoveIcon } from 'nextra/icons'
function _createMdxContent(props) {
const _components = {
code: 'code',
Expand Down Expand Up @@ -211,6 +212,12 @@ describe('rehypeIcon', () => {
<_components.span> </_components.span>
</_components.code>
</_components.pre>
{'\\n'}
<_components.pre icon={MoveIcon} tabIndex="0" data-language="move" data-word-wrap="" data-copy="">
<_components.code>
<_components.span> </_components.span>
</_components.code>
</_components.pre>
</>
)
}
Expand Down
3 changes: 2 additions & 1 deletion packages/nextra/src/server/rehype-plugins/rehype-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export const REHYPE_ICON_DEFAULT_REPLACES: Record<string, string> = {
python: 'PythonIcon',
py: 'PythonIcon',
rust: 'RustIcon',
rs: 'RustIcon'
rs: 'RustIcon',
move: 'MoveIcon'
}

function createImport(iconName: string) {
Expand Down

0 comments on commit ae4bac9

Please sign in to comment.