Skip to content

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

License

Notifications You must be signed in to change notification settings

hellojudger/QMarkdownView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.