Socket
Book a DemoInstallSign in
Socket

remark-code-tabs

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-code-tabs

a remark plugin to create multi-tab code views in html

1.1.4
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

remark-code-tabs

What

It's a remark plugin which create the basics for code tabs in a markdown document.

Demo

```jsx tabs=demo name=index.jsx
export default function App() {
  return <div>hello world</div>;
}
```

```css tabs=demo name=style.css
div {
  border: 1px solid red;
}
```

When

When you wont't use docusaurus' plugin because you don't want/plan to add jsx/mdx.

How

Installation

  • Install the plugin with npm i remark-code-tabs
  • Import the plugin with `import remarkCodeTabs from 'remark-plugin-code-tabs'
  • Add to your remark plugin stack [remarkCodeTabs]

Usage

In a markdown file, add the 2 meta tabs="" name="" to a block content such as:

```jsx tabs="demo" name="index.jsx"
export default function App() {
  return <div>hello world</div>;
}
```

```css tabs="demo" name="style.css"
div {
  border: 1px solid red;
}
```

Styling

By default, no style will be injected, only classnames and a default html structure to help you get started. That said, you can import the plugin like this [remarkCodeTabs, { injectStyle: true }] to add a inlined <style> with the bare minimum to have a tab-like navigation, or [remarkCodeTabs, { injectStyle: 'cdn' }] yielding a link tag using unpkg.com.

You can leverage these css selectors to theme your code tabs:

.remark-code-tabs {
  /* tabs wrapper */
}

.remark-code-tab {
  /* tab default state */
}

.remark-code-tab:has(:checked) {
  /* tab active state */
}

.remark-code-tab:not(:has(:checked)) {
  /* tab inactive state */
}

.remark-code-content {
  /* content wrapper */
}

Keywords

remark

FAQs

Package last updated on 14 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.