Skip to content

code()

ts
function code(value, options?): Node;

Defined in: code.ts:82

Builder-element for code

Parameters

ParameterTypeDescription
valuestring | NodeThe content of this element
options?CodeOptionsConfiguration options for this element

Returns

Node

A markdown node

Example

ts
import { define, code } from "@ogs-gmbh/markdown";

const markdown = define(
  code("let a = 5;", { language: "ts" })
);

console.assert(
  markdown.toString()
);

See

https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code

Since

1.0.0

Author

Simon Kovtyk