Socket
Book a DemoInstallSign in
Socket

@vegaprotocol/docusaurus-theme-github-codeblock

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vegaprotocol/docusaurus-theme-github-codeblock

A Docusaurus v2 plugin that supports referencing code examples from public GitHub repositories.

0.1.8
latest
Source
npmnpm
Version published
Maintainers
5
Created
Source

Docusaurus Theme GitHub Codeblock ( 🪛 Patched fork)

A Docusaurus v2 plugin that supports referencing code examples from public GitHub repositories.

NOTE: This is a fork of the original project, since it's not maintained anymore. It contains a patch to work with docusaurus v2.0.1.

Note: this theme plugin requires Docusaurus v2

Install

First, add the theme plugin to your dependencies:

npm install @vegaprotocol/docusaurus-theme-github-codeblocks

Usage

Add the theme plugin to your list of themes in the docusaurus.config.js:

    // ...
    themes: [
        '@vegaprotocol/docusaurus-theme-github-codeblock'
    ],
    // ...

In order to reference GitHub snippets in your markdown, create code blocks with a reference attached to the language meta string and put the link to your GitHub reference in the code block, e.g.:

```js reference
https://github.com/saucelabs/docusaurus-theme-github-codeblock/blob/main/src/theme/ReferenceCodeBlock/index.tsx#L105-L108
```

You can also set a custom title:

```js reference title="Example"
https://github.com/saucelabs/docusaurus-theme-github-codeblock/blob/main/src/theme/ReferenceCodeBlock/index.tsx#L105-L108
```

The plugin will download the code and display the desired lines:

Plugin Example

If you are interested contributing to this project, see CONTRIBUTING.md.

See also

Keywords

docusaurus

FAQs

Package last updated on 01 Aug 2022

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.