Skip to content

Markdown

Parse frontmatter, convert to HTML, and generate table of contents.

3 modules

ModuleDescription
Analizuj FrontmatterWyodrębnij frontmatter YAML z treści Markdown
Markdown na HTMLKonwertuj tekst Markdown na HTML
Generuj spis treściGeneruj spis treści z nagłówków Markdown

Modules

Analizuj Frontmatter

markdown.parse_frontmatter

Wyodrębnij frontmatter YAML z treści Markdown

Parameters:

NameTypeRequiredDefaultDescription
textstringYes-Treść Markdown z frontmatter

Output:

FieldTypeDescription
frontmatterobjectPrzeanalizowany frontmatter jako słownik
contentstringTreść Markdown bez frontmatter

Example: Parse YAML frontmatter

yaml
text: ---
title: Hello World
date: 2024-01-01
tags:
  - python
  - markdown
---

# Hello World

Content here.

Markdown na HTML

markdown.to_html

Konwertuj tekst Markdown na HTML

Parameters:

NameTypeRequiredDefaultDescription
textstringYes-Treść Markdown do konwersji
extensionsarrayNo-Rozszerzenia Markdown do włączenia (używane tylko z biblioteką markdown)

Output:

FieldTypeDescription
htmlstringPrzekonwertowana treść HTML
word_countnumberLiczba słów w tekście wejściowym

Example: Convert markdown to HTML

yaml
text: # Hello

This is **bold** and *italic*.

Generuj spis treści

markdown.toc

Generuj spis treści z nagłówków Markdown

Parameters:

NameTypeRequiredDefaultDescription
textstringYes-Treść Markdown do wyodrębnienia nagłówków
max_depthnumberNo3Maksymalna głębokość nagłówka do uwzględnienia (1-6)

Output:

FieldTypeDescription
tocarrayLista nagłówków z poziomem, tytułem i slugiem
toc_markdownstringSformatowany spis treści w Markdown

Example: Generate TOC from markdown

yaml
text: # Introduction

## Getting Started

### Installation

### Configuration

## Usage

## API Reference
max_depth: 3

Released under the Apache 2.0 License.