backstage-plugin-techdocs-addon-sourcegraph
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Backstage TechDocs Addon for Sourcegraph

A module that extends Sourcegraph capabilities into Backstage TechDocs.

Getting started

This module is a Backstage TechDocs Addon plugin, which requires Backstage v1.2+. The plugin provides a component for embedding Sourcegraph Notebooks. Follow the official documentation for TechDocs Addons to use this addon.

import { SourcegraphNotebook } from 'backstage-plugin-techdocs-addon-sourcegraph';

// Sourcegraph instance domain (Required)
const domain = 'sourcegraph.example.com';

// pre-render callback (Optional)
const callback = ({

  // div wrapper for embedded Notebook
  container: HTMLDivElement,

  // embedded notebook iframe
  iframe: HTMLIFrameElement,

  // notebook id
  id: string,

  // non-embedded notebook url
  url: string
}) => {

  // ...some extra handling or DOM manipulation before attaching the
  // iframe to the container
  container.append(iframe);
});

<TechDocsAddons>
  <SourcegraphNotebook domain={domain} callback={callback} />
</TechDocsAddons>

Further resources

Package Sidebar

Install

npm i backstage-plugin-techdocs-addon-sourcegraph

Weekly Downloads

2

Version

0.1.0

License

Apache-2.0

Unpacked Size

22.4 kB

Total Files

6

Last publish

Collaborators

  • modethirteen