Registry / serialization / markdown-strings

markdown-strings

JSON →
library3.4.0pypypi✓ verified 84d ago

A Python library for programmatically generating Markdown formatted text. Current version 3.4.0 (with v4.0.0a1 alpha release featuring a complete API rewrite). Release cadence: irregular.

pip install markdown-strings
INSTALL
IMPORT
SIG · MARKDOWN-STRINGS
M
markdown-strings
serializationpythonv3.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

md
import markdown_strings as md
import markdown_strings as mds
The canonical import alias is 'md', but some tutorials use 'mds'.
header
from markdown_strings import header
from markdown_strings import heading
Function is named 'header', not 'heading'.

Generate a level-1 heading and bold text.

import markdown_strings as md text = md.header("Hello, World!", 1) text += md.bold("Important") print(text)
Debug
Known issues
breakingv4.0.0a1 is a complete API rewrite. Functions and signatures have changed. Do not upgrade to alpha in production.
fix
Stay on 3.x until stable v4 release.
affects: >=4.0.0a1
gotchaThe function name 'header' takes level as second argument (1-indexed). This differs from some other Markdown libraries.
fix
Use md.header('text', 2) for ## heading, not md.header('text', 2).
affects: *
deprecatedFunction 'bold' and 'italic' are deprecated in v4 alpha; use 'strong' and 'emphasis' instead.
fix
Use md.strong('text') and md.emphasis('text') in v4.
affects: >=4.0.0a1
Errors
Common errors & fixes
AttributeError: module 'markdown_strings' has no attribute 'bold'
You installed v4 alpha which removed 'bold'.
fix
Downgrade to v3.4.0: pip install markdown-strings==3.4.0
NameError: name 'md' is not defined
Forgot to import or used incorrect import statement.
fix
Add 'import markdown_strings as md' at the top of your script.
TypeError: header() missing 1 required positional argument: 'level'
Called header('text') without specifying level.
fix
Use header('text', 1) with two arguments.
Upgrade
Version history
3.4.0latest on PyPI
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources