Skip to main content

Generate language-learning HTML readers (with sentence-level LLM translations and TTS) from Markdown.

Project description

langreader

Generate interactive language-learning HTML readers from Markdown using LLMs.

en ja fr

👀 Demo

Before reading further, check out what this tool generates:

👉 Live Demo: French Reader (Alsace)


md-llm-lang-reader (CLI command: langreader) converts standard Markdown text into a bilingual HTML reader. It uses Large Language Models (via multiai) to intelligently split paragraphs into natural sentences and provide translations, while adding Text-to-Speech (TTS) capabilities to every sentence.

Features

  • 🤖 AI-Powered Translation: Automatically splits paragraphs into natural sentences and translates them line-by-line.
  • 🔊 Text-to-Speech: Built-in audio buttons for every source sentence (uses browser Web Speech API).
  • ⏯️ Resumable Generation: Hit an API rate limit? Use --continue to resume generation exactly where it stopped.
  • 📝 Markdown Support: Preserves headings, code blocks, and basic formatting.
  • 🌍 Wikipedia Helper: Includes a script to easily fetch and format Wikipedia articles for learning.

📚 Documentation

For detailed installation instructions, CLI options, and tutorials, please visit the official documentation:

👉 https://sekika.github.io/langreader/

  • Usage Guide: Options for styling, resuming, and metadata.
  • Tutorial: Step-by-step guide to creating a reader from a Wikipedia article.
  • TTS Setup: How to configure high-quality voices on your device.

Installation

pip install md-llm-lang-reader

Note: This tool requires multiai configuration to access LLM providers (OpenAI, Anthropic, etc.).

Quick Start

  1. Create a Markdown file (input.md):

    # Bonjour
    Ceci est un exemple de phrase pour l'apprentissage.
    
  2. Run the generator:

    langreader -i input.md -o output.html --src fr --tgt en --provider openai --model gpt-4o-mini
    
  3. Open output.html in your browser to start reading and listening!

License

MIT

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

md_llm_lang_reader-0.2.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

md_llm_lang_reader-0.2.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file md_llm_lang_reader-0.2.0.tar.gz.

File metadata

  • Download URL: md_llm_lang_reader-0.2.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for md_llm_lang_reader-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6525db484d6da28c539a0b01e6c6f87ff12e43a52a5f1671fcd3cd5c8360cc0e
MD5 8c8eb81224902fb333c764704eb1bd54
BLAKE2b-256 9355c3c735aec4ad9b3e86c5715b9de526fa4ce5d255c6f82389b0ae51a5a5e5

See more details on using hashes here.

File details

Details for the file md_llm_lang_reader-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for md_llm_lang_reader-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2a93db8b264c0485e25387d1298a235c07f52c4f1bdd328ffc7d27b576c7865
MD5 2bcdde97c9242034f82209069e821786
BLAKE2b-256 6a6037c76db10e051c49e24bf18fb9ad67c3e1b13469ae9fc4b7cca2c5f9b932

See more details on using hashes here.

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