markdown

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package markdown provides the scriptling.markdown extension library.

Index

Constants

View Source
const LibraryName = "scriptling.markdown"

LibraryName is the script-visible name of the markdown library.

Variables

View Source
var Library = object.NewLibrary(LibraryName, map[string]*object.Builtin{
	"to_html": {
		Fn: markdownToHTMLFunc,
		HelpText: `to_html(markdown_string) - Convert Markdown to HTML

Converts a Markdown string to an HTML string using the GitHub Flavored
Markdown (GFM) specification. Supports headings, bold, italic, code blocks,
fenced code, blockquotes, ordered and unordered lists, tables, strikethrough,
task lists, and auto-linked URLs.

Args:
    markdown_string (str): The Markdown source to convert.

Returns:
    str: HTML representation of the Markdown input.

Example:
    import scriptling.markdown as markdown

    html = markdown.to_html("# Hello\n\nThis is **bold** and _italic_ text.")
    print(html)
    # <h1 id="hello">Hello</h1>
    # <p>This is <strong>bold</strong> and <em>italic</em> text.</p>

    html = markdown.to_html("- item one\n- item two")
    print(html)
    # <ul>
    # <li>item one</li>
    # <li>item two</li>
    # </ul>`,
	},
}, nil, "Markdown parsing and conversion")

Library provides Markdown parsing and conversion to HTML.

Functions

func Register

func Register(registrar interface{ RegisterLibrary(*object.Library) })

Register registers the scriptling.markdown library.

Types

This section is empty.

Jump to

Keyboard shortcuts

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