# remark-inline-code-language

> A Remark plugin that allows passing a language to inline code.

Latest version **1.0.1** (published 2023-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install remark-inline-code-language
pnpm add remark-inline-code-language
yarn add remark-inline-code-language
bun add remark-inline-code-language
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-04-24 |
| First published | 2023-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | babakfp |
| Keywords | remark, remark-plugin |

## Links

- npm: https://www.npmjs.com/package/remark-inline-code-language
- Repository: https://github.com/babakfp/remark-inline-code-language
- Homepage: https://github.com/babakfp/remark-inline-code-language#readme
- Issues: https://github.com/babakfp/remark-inline-code-language/issues
- npm.io page: https://npm.io/package/remark-inline-code-language

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-04-24

## README

# remark-inline-code-language

A [Remark](https://github.com/remarkjs/remark) plugin that allows passing a language to inline code. This is useful for syntax highlighting.

Note: This is not a standard markdown feature.

## Example

```
`_js console.log()`
```

## Installation

```
npm i -D remark-inline-code-language
```

<!-- prettier-ignore -->
```js
import { unified } from "unified"
import remarkParse from "remark-parse"
import remarkInlineCodeLanguage from "remark-inline-code-language"

const mdast = await unified()
	.use(remarkParse)
	.parse("`_js console.log()`")

const result = unified()
	.use(remarkInlineCodeLanguage)
	.runSync(mdast)

console.log(JSON.stringify(result.children[0].children[0], null, 4))
```

```json
{
	"type": "inlineCode",
	"value": "console.log()",
	"lang": "js"
}
```

## Options

You can customize the syntax!

If you are going to only change 1 option, sadly you need to add in all other options too.

```js
.use(remarkInlineCodeLanguage, {
	// ...
})
```

### `separator_character`

This is the character(s) that separates the language name from the code content itself.

- Type: `string`
- Default: `"_"`

#### Examples

- `"_"` => `_js console.log()`
- `"+"` => `+js console.log()`
- `"="` => `=js console.log()`

### `separator_position`

- Type: `"before" | "after" | "both"`
- Default: `"before"`

#### Examples

- `"before"` => `_js console.log()`
- `"after"` => `js_ console.log()`
- `"both"` => `_js_ console.log()`

---
_Source: https://npm.io/package/remark-inline-code-language · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
