Registry / web-framework / markdownlit

markdownlit

JSON →
library0.0.7pypypi✓ verified 85d ago

markdownlit is a Python library that enhances Streamlit's native Markdown capabilities by introducing 'lit' features such as magic links, colored text, collapsible content, and improved arrow/dash rendering. Built upon the `Python-Markdown` project, it is currently at version 0.0.7 and is actively maintained, though releases follow an irregular cadence.

pip install markdownlit
INSTALL
IMPORT
SIG · MARKDOWNLIT
M
markdownlit
web-frameworkpythonv0.0.7
Install
23.3s avg
Import
2886ms
Disk
547MB
Pass rate
9/ 10
Env Coverage9 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 20.78s
py 3.11
✓ —
✓ 19.2s
py 3.12
✓ —
✓ 19.73s
py 3.13
✓ —
✓ 19.5s
py 3.9
✕ build_error
✓ 37.3s
547MB installed
● package 547MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mdlit
from markdownlit import mdlit

To use `markdownlit`, import `mdlit` and use it as a drop-in replacement for `st.markdown()` to access its enhanced features like magic links, colored text, and custom arrows.

import streamlit as st from markdownlit import mdlit st.set_page_config(layout="centered") st.header("markdownlit Demo") mdlit("You should definitely check out @(https://streamlit.io/) for building awesome apps!") mdlit("Here is some [red]colored[/red] text and a [blue]magic link[/blue] to @(twitter.com/arnaudmiribel).") mdlit("Is this cool -> right? And what about <- this?!")
Debug
Known issues
breakingVersions v0.0.6 and v0.0.7 included significant fixes related to Streamlit's caching primitives (`st.cache_data`, `st.cache_resource`). Applications using `markdownlit` with caching decorators might experience unexpected behavior or errors if not updated to match the latest Streamlit caching API and `markdownlit` versions. [cite: changelog]
fix
Upgrade `markdownlit` to v0.0.7 or later and ensure Streamlit is also up-to-date. Review and adapt any custom caching logic if `markdownlit`'s output was previously cached.
affects: <0.0.7
gotchaPrior to v0.0.4, `markdownlit` had a dependency issue with `streamlit-extras`'s `mention` package, leading to potential XML parsing errors due to HTML conflicts. [cite: changelog]
fix
Upgrade `markdownlit` to v0.0.4 or later. If still encountering parsing issues, try to isolate if `streamlit-extras.mention` (or other HTML-injecting components) are conflicting and ensure both libraries are the latest compatible versions.
affects: <0.0.4
gotchaWhile `markdownlit` provides colored text, Streamlit now offers native support for colored text within `st.markdown()` using similar syntax. Users should be aware they might not need `markdownlit` solely for this feature in newer Streamlit versions.
fix
Check Streamlit's official documentation for native colored text capabilities before deciding to use `markdownlit` specifically for this feature. For other unique features like magic links, `markdownlit` remains valuable.
affects: All versions
Errors
Common errors & fixes
NameError: name 'mdlit' is not defined
The `mdlit` function was not imported from the `markdownlit` library.
fix
Add `from markdownlit import mdlit` at the top of your Streamlit script.
AttributeError: module 'streamlit' has no attribute 'cache_data' (or similar caching errors)
This error often indicates an incompatibility between your `markdownlit` version and Streamlit's caching API, which underwent changes.
fix
Ensure both `markdownlit` (v0.0.7+) and Streamlit are updated to their latest versions. Review your code for deprecated caching decorators (`st.cache` should be `st.cache_data` or `st.cache_resource`).
XMLSyntaxError: Start tag expected, '<' not found (or similar parsing/rendering issues)
This might be related to `markdownlit`'s interaction with other components that inject HTML, specifically a known issue with `streamlit-extras`'s `mention` package in older versions.
fix
Upgrade `markdownlit` to v0.0.4 or newer. If the problem persists, examine other Streamlit components or custom HTML that might conflict with Markdown parsing, especially those that dynamically alter HTML structure.
Upgrade
Version history
0.0.7latest on PyPI · released Apr 17, 2023
Audit
Dependencies
streamlitrequiredCore functionality relies on Streamlit to render enhanced Markdown.
markdownrequiredBuilt upon the `Python-Markdown` project as its core Markdown parser.
pymdownxrequiredUsed for additional Markdown extensions, as indicated in `requirements.txt` of the project.
Agent activity
11 hits · last 30 days
node
8
Amazon
1
Resources
markdownlit — pip install markdownlit · libregistry