Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 957 Bytes

README.md

File metadata and controls

37 lines (23 loc) · 957 Bytes

QMarkdownView

Description

QMarkdownView is a package based on PySide6 designed to help you preview Markdown documents.

Markdown by default supports code highlighting and LaTex mathematical formulas.

How to use

Firstly, you need to introduce the QMarkdownView library.

from QMarkdownView import MarkdownView, LinkMiddlewarePolicy

You can use the component class `MarkdownView`` we provide.

widget = MarkdownView()

MarkdownView inherits from QWebEngineView.

You can change the Markdown rendering plugin through the setExtension member function. The markup rendering engine for this function library is python-markdown.

widget.setExtensions(["markdown.extensions.tables", "markdown.extensions.extra"])

You can modify Markdown text through the setValue member function.

widget.setValue("# Hello world!")

Warning: You need to call this function after the component is loaded.