Skip to main content

Litrepl evaluates code from LaTeX/Markdown verbatim sections.

Project description

Changelog

Version 3.14.0

  1. Python

    • Fixed leaking stdout in on-demand interpreter start mode and now raise an explicit error on double-start.
    • Added the --keep-readout debugging option for retaining interpreter output.
    • Performed extra fsync operations to make file handling more robust.
    • Improved error handling and reporting, including printing a clear error when litrepl is called from a TTY without arguments.
    • Recognize IPython command lines more reliably as IPython and set up IPython in a safer way, omitting log files and performing initial configuration in-stream.
    • Added support for relative section indexing.
    • Refactored Python code style: converted CamelCase function names to snake_case and replaced bare assert with an assert_() helper.
    • Updated the aicli interpreter to require explicit /ask endings and to avoid modifying verbosity settings.
  2. Environment

    • Removed aicli from the Nix flake to break a mutual dependency, deferring a cleaner integration to later.
    • Updated inline help formatting, completed remaining help TODOs, and corrected the manual page section from 5 to 1.
  3. Vim

    • No Vim-related changes in this release.

Version 3.13.0

  1. Python

    • Improved backward compatibility by fixing issues related to spurious newlines on empty inputs.
    • Accept codeai code section for AI interpreters, in addition to ai.
    • Introduced a new command print-auxdir.
  2. Environment

    • Added support for generating coverage reports with updates to the Makefile.
    • Added dependency on coverage-badge, enhancing reporting capabilities.
    • Modified settings to ignore empty LITREPL_ environment variables.
  3. Vim

    • Enhanced the indentation feature in Litrepl to preserve empty lines.
    • Updated the status command to print the auxiliary directory and fixed an unwanted exception.

Version 3.12.0

  1. Python

    • Fix the hashing algorithm to exclude the unstable hash() output from digests thus fixed an issue with handling a None suffix in digests, improving the stability and accuracy of digest computations.
    • Section addressing has been adjusted to start from 1 instead of 0 for readability.
    • Made eval-sections the default command, reflecting a focus on ease of use and user interaction.
  2. Environment

    • Underscores have been removed from auxiliary directory file names.
    • Add a link to the arXiv paper.
  3. Vim

    • Added new options for ignoring specific LaTeX sections with the lignore feature, enhancing customization for LaTeX users.
    • Updated the Vim async tag pattern BG -> LR.

Version 3.11.0

  1. Python

    • The interpreters have been refactored into their own submodule, improving code organization.
    • Added preliminary support for shell interpreters, allowing the system to handle shell commands.
    • Introduced new commands: print-grammar to output the grammar and print-regexp for regular expression management.
    • Introduced adjustable code section labels, removing the default lcode sections support.
    • Improved debugging and configuration support in IPython by ensuring expanded paths and correct handling of the DEBUG setting.
    • Support for automatic file type detection with --filetype=auto has been implemented.
    • The support for --irreproducible-exitcode argument was added
  2. Vim

    • Fixed cursor handling issues in LEvalMon, improving text navigation and evaluation feedback within Vim.
    • Improve error reporting performed by the LOpenErr command.

Version 3.10.1

Minor environment changes

Version 3.10.0

  1. Python

    • Code refactoring for better code management and efficiency: moved main logic in litrepl from python/bin/litrepl to a new file python/litrepl/main.py.
    • Improved handling of subprocess management for the Python and AI interpreters, ensuring proper cleanup and output management. Additionally, calls to os.system were mostly replaced with native Python calls.
    • Added robust error handling and message retrieval for the interpreter interface, providing clearer errors when the interpreter fails.
  2. Vim

    • Introduced the default environment variable check for LITREPL_WORKDIR, LITREPL_PYTHON_AUXDIR, LITREPL_AI_AUXDIR etc. environment variables.
    • Updated Vim functions to consider both buffer and global settings, improving flexibility in command generation (LitReplGet helper function).
    • Updated commands related to AI tasks like :LAIStyle, :LAIFile, and :LAICode to handle rephrasing and AI interaction more efficiently.
    • Adjusted internal Vim functions to handle text width settings and cursor positionings.
  3. Environment

    • Replaced test.sh with runtests.sh in the build and test process for enhanced test execution flow.
    • Allowed more environment configuration by introducing more settings that default from environment variables, streamlining setup customization.
    • Updated Nix build script (default.nix) to reflect changes in the test script location and hash updates for source verification.
    • Added this changelog and the AI-powered changelog helper script diffchanges.sh.

Version 3.9.0

  1. Python

    • Added assertions to ensure a successful attachment to the interpreter, enhancing error handling robustness.
  2. Vim

    • Enhanced vim/plugin/litrepl.vim by preserving caret positions and restructuring comments for function alignment.
    • Significant expansions in vim/plugin/litrepl_extras.vim with multiple new functions for region handling, AI task management, and interaction across different scopes, substantially improving user experience with AI functionalities in Vim. Several new commands such as LAITell, LAICont, LAIStyle, LAIFile, and LAICode are introduced to support a wide range of code and AI-related tasks.
  3. Environment

    • Added a new markdown file ./doc/screencast.md with examples for evaluating Python code in Vim, offering insights into the screencast documentation process.
    • Adjusted screencast.sh to be executable and made improvements to accommodate a target file parameter.
    • Introduced a new test function test_vim_ai_query in test.sh, facilitating new test coverage for AI query functionality.

⌨️ LitRepl ⌨️

Changelog | Installation | Usage | Gallery

Litrepl tests

Litrepl is acommand-line processor for Markdown or LaTeX documents with literate programming code sections. Instructed by its arguments, it evaluates and updates sections via background interpreters. Interpreters can stay active for a read-eval-paste-loop style.

Peek 2024-07-18 20-50-2

Notes:

PDF Icon Preprint: (2025, Sergei Mironov) Litrepl: Literate Paper Processor Promoting Transparency More Than Reproducibility arXiv:2501.10738

Features

Requirements

  • POSIX-compatible OS, typically a Linux. The tool relies on POSIX operations, notably pipes, and depends on certain Shell commands.
  • lark-parser and psutil Python packages.
  • Socat (Optional) Needed for litrepl repl and Vim's LTerm commands to work.

Documentation

For full documentation, check out the project's GitHub Pages site.

Gallery

Basic usage (Show GIF)

Peek 2024-07-18 20-50-2

(Outdated!) AI capabilities (Show GIF)

Peek 2024-11-28 20-48

Vimtex integration (Show Video)

We utilize LitRepl alongside the Vimtex plugin to edit and preview LaTeX documents instantly.

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

litrepl-3.14.2.tar.gz (608.7 kB view details)

Uploaded Source

Built Distribution

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

litrepl-3.14.2-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

Details for the file litrepl-3.14.2.tar.gz.

File metadata

  • Download URL: litrepl-3.14.2.tar.gz
  • Upload date:
  • Size: 608.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.10

File hashes

Hashes for litrepl-3.14.2.tar.gz
Algorithm Hash digest
SHA256 3ca37260fcb681758902b07d2d4074d452613079ce04709b2b39c7e5c52b86e7
MD5 195488622300218947464bf806108fe3
BLAKE2b-256 f18ca4174c29249c1c70064b8d98c8fdf70bbe77d3e9e7b269a41698678f1784

See more details on using hashes here.

File details

Details for the file litrepl-3.14.2-py3-none-any.whl.

File metadata

  • Download URL: litrepl-3.14.2-py3-none-any.whl
  • Upload date:
  • Size: 38.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.10

File hashes

Hashes for litrepl-3.14.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da2e7cd44d4aebd1ba52f246f2d5d58c6beafa46317700f77b77a8d2293d9559
MD5 5d72a937c310df052c01ac8ccc94fc24
BLAKE2b-256 a97fc33ba3636327e23abb4afc93059019e84fba329637f9162201ac2142bcd5

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