Skip to main content

Add your description here

Project description

md2wxhtml

A tool to convert Markdown files into a format suitable for WeChat articles, handling general content and code blocks with syntax highlighting.

Features

  • Converts Markdown to HTML.
  • Separates and processes code blocks for syntax highlighting and horizontal scrolling.
  • Merges processed content and code blocks into a single HTML document.

Disclaimer

This project is an independent open-source tool and is not affiliated with, endorsed by, or officially connected to WeChat or Tencent.

Installation

pip install md2wxhtml

Usage

Command-line Interface

md2wxhtml --input <input_file.md> --output <output_file.html>

As a Python Library

from md2wxhtml import WeChatConverter

converter = WeChatConverter(content_theme="blue", code_theme="monokai")
conversion_result = converter.convert("Your markdown content here.")
html_output = conversion_result.html
print(html_output)

Available Themes

The content_theme argument accepts the following built-in theme names:

  • default
  • blue
  • dark
  • github
  • green
  • hammer
  • red

The code_theme argument uses Pygments styles for code highlighting. You can specify any valid Pygments style name (e.g., monokai, default, friendly, colorful, etc.) to adjust the appearance of code blocks.

You can specify these names when creating a WeChatConverter instance. For example:

converter = WeChatConverter(content_theme="github", code_theme="monokai")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

md2wxhtml-0.1.5.dev1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

md2wxhtml-0.1.5.dev1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file md2wxhtml-0.1.5.dev1.tar.gz.

File metadata

  • Download URL: md2wxhtml-0.1.5.dev1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for md2wxhtml-0.1.5.dev1.tar.gz
Algorithm Hash digest
SHA256 d13549c2cfa24eeb577b9195700fcf40c886620831a69ee3c732663091d1c61c
MD5 cb2557145fd87ac1fbf3ddb4c43d44b2
BLAKE2b-256 4fe29bead5694a153ddbe99e3c846642ae814e99ac555965a89fcd2d1b2723ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for md2wxhtml-0.1.5.dev1.tar.gz:

Publisher: publish.yml on Wenjun-Mao/md2wxhtml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file md2wxhtml-0.1.5.dev1-py3-none-any.whl.

File metadata

  • Download URL: md2wxhtml-0.1.5.dev1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for md2wxhtml-0.1.5.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c066716d1b6637f5fb8bd46a5b3892d8538ad2b76495a7f23d78bf4bf36084f
MD5 6eb1d137e33695cc4c845c90ea59fffb
BLAKE2b-256 8fbe1b0a4b165fe74695d4cf2b2001b54c615a6f04593a6097fb239629f7d3a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for md2wxhtml-0.1.5.dev1-py3-none-any.whl:

Publisher: publish.yml on Wenjun-Mao/md2wxhtml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page