Interface: Snippet

Represents a code snippet extracted from a source file. The field permalink is only present when the source is from a Git repository.

Table of contents

Properties

Properties

content

content: string

The snippet content. Leading spaces are trimmed.

Defined in

types.ts:20


endLine

endLine: number

The end line of the snippet.

Defined in

types.ts:16


filename

filename: string

The name of the file, derived from sourcePath.

Defined in

types.ts:12


highlightedLines

highlightedLines: number[]

The lines to be highlighted, if any.

Defined in

types.ts:18


language

language: string

The source language. It matches the file extension.

Defined in

types.ts:8


Optional permalink: string

The link to the file on the remote Git repo when available.

Defined in

types.ts:22


qualifier

Optional qualifier: string

An extra qualifier that can be used to differentiate snippets with the same key that might come from the same file extension.

Defined in

types.ts:27


sourcePath

sourcePath: string

The file path relative to the working directory.

Defined in

types.ts:10


startLine

startLine: number

The start line of the snippet.

Defined in

types.ts:14