Skip to content
GitHub

FullSnippet

Use this component if you wish pull an entire file from a public Github repository to be displayed as code.

It takes a source attribute which must be from the raw.githubsercontent.com API.

To use it, your docs page must be in .mdx format. Please change the format from .md to .mdx if necessary. All your existing markdown will still be supported without issue.

Usage

Import the FullSnippet component like so:

import FullSnippet from "/src/components/FullSnippet.astro";

Use the <FullSnippet> component within your content like so:

<FullSnippet source='https://raw.githubusercontent.com/interledger/open-payments-snippets/main/incoming-payment/incoming-payment-create.ts' />

Working example

There’s no working example at the moment.

This component was created to pull in GitHub files before the ChunkedSnippet component existed. ChunkedSnippet negated the need for us to use this component for our particular use case; however, FullSnippet still exists and can be used as needed.