markdown

package
v2.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package markdown implements MCP tools for rendering GitLab-flavored Markdown.

The package wraps the GitLab Markdown API:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec

ActionSpecs returns canonical specs for Markdown rendering actions exposed as MCP tools. The render route is projected into the dynamic, meta, individual, and audit surfaces by the action catalog (ADR-0004).

func FormatRenderMarkdown

func FormatRenderMarkdown(out RenderOutput) *mcp.CallToolResult

FormatRenderMarkdown wraps the RenderOutput HTML in an mcp.CallToolResult with a Markdown heading so downstream agents see a stable structure even when the rendered HTML is empty.

Types

type RenderInput

type RenderInput struct {
	Text    string `json:"text" jsonschema:"Markdown text to render,required"`
	GFM     bool   `json:"gfm,omitempty" jsonschema:"Use GitLab Flavored Markdown (default false)"`
	Project string `json:"project,omitempty" jsonschema:"Project path for resolving references (e.g. group/project)"`
}

RenderInput is the input for rendering markdown.

type RenderOutput

type RenderOutput struct {
	toolutil.HintableOutput
	HTML string `json:"html"`
}

RenderOutput is the output containing the rendered HTML.

func Render

func Render(ctx context.Context, client *gitlabclient.Client, input RenderInput) (RenderOutput, error)

Render sends arbitrary Markdown text to the GitLab Markdown render API (POST /markdown) and returns the resulting HTML. When GFM is true, GitLab Flavored Markdown extensions are applied; an optional Project enables reference resolution (e.g. issue/MR links).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL