Litrepl evaluates code from LaTeX/Markdown verbatim sections.
Project description
Changelog
Version 3.14.0
-
Python
- Fixed leaking stdout in on-demand interpreter start mode and now raise an explicit error on double-start.
- Added the
--keep-readoutdebugging option for retaining interpreter output. - Performed extra
fsyncoperations to make file handling more robust. - Improved error handling and reporting, including printing a clear error
when
litreplis 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_caseand replaced bareassertwith anassert_()helper. - Updated the
aicliinterpreter to require explicit/askendings and to avoid modifying verbosity settings.
-
Environment
- Removed
aiclifrom 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.
- Removed
-
Vim
- No Vim-related changes in this release.
Version 3.13.0
-
Python
- Improved backward compatibility by fixing issues related to spurious newlines on empty inputs.
- Accept
codeaicode section for AI interpreters, in addition toai. - Introduced a new command
print-auxdir.
-
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.
-
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
-
Python
- Fix the hashing algorithm to exclude the unstable
hash()output from digests thus fixed an issue with handling aNonesuffix 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-sectionsthe default command, reflecting a focus on ease of use and user interaction.
- Fix the hashing algorithm to exclude the unstable
-
Environment
- Underscores have been removed from auxiliary directory file names.
- Add a link to the arXiv paper.
-
Vim
- Added new options for ignoring specific LaTeX sections with the
lignorefeature, enhancing customization for LaTeX users. - Updated the Vim async tag pattern
BG->LR.
- Added new options for ignoring specific LaTeX sections with the
Version 3.11.0
-
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-grammarto output the grammar andprint-regexpfor regular expression management. - Introduced adjustable code section labels, removing the default
lcodesections 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=autohas been implemented. - The support for
--irreproducible-exitcodeargument was added
-
Vim
- Fixed cursor handling issues in
LEvalMon, improving text navigation and evaluation feedback within Vim. - Improve error reporting performed by the
LOpenErrcommand.
- Fixed cursor handling issues in
Version 3.10.1
Minor environment changes
Version 3.10.0
-
Python
- Code refactoring for better code management and efficiency: moved main
logic in
litreplfrompython/bin/litreplto 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.systemwere mostly replaced with native Python calls. - Added robust error handling and message retrieval for the interpreter interface, providing clearer errors when the interpreter fails.
- Code refactoring for better code management and efficiency: moved main
logic in
-
Vim
- Introduced the default environment variable check for
LITREPL_WORKDIR,LITREPL_PYTHON_AUXDIR,LITREPL_AI_AUXDIRetc. environment variables. - Updated Vim functions to consider both buffer and global settings,
improving flexibility in command generation (
LitReplGethelper function). - Updated commands related to AI tasks like
:LAIStyle,:LAIFile, and:LAICodeto handle rephrasing and AI interaction more efficiently. - Adjusted internal Vim functions to handle text width settings and cursor positionings.
- Introduced the default environment variable check for
-
Environment
- Replaced
test.shwith 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.
- Replaced
Version 3.9.0
-
Python
- Added assertions to ensure a successful attachment to the interpreter, enhancing error handling robustness.
-
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, andLAICodeare introduced to support a wide range of code and AI-related tasks.
-
Environment
- Added a new markdown file
./doc/screencast.mdwith examples for evaluating Python code in Vim, offering insights into the screencast documentation process. - Adjusted
screencast.shto be executable and made improvements to accommodate a target file parameter. - Introduced a new test function
test_vim_ai_queryintest.sh, facilitating new test coverage for AI query functionality.
- Added a new markdown file
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.
Notes:
|
|
Preprint: (2025, Sergei Mironov) Litrepl: Literate Paper Processor Promoting Transparency More Than Reproducibility arXiv:2501.10738 |
Features
- Document formats
Markdown (Example [MD]) | LaTeX (Examples [TEX][PDF]) - Interpreters
Sh | Bash | Python | IPython | Aicli - Editor integration
Vim (plugin source included)
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 repland Vim'sLTermcommands to work.
Documentation
For full documentation, check out the project's GitHub Pages site.
Gallery
Basic usage (Show GIF)
(Outdated!) AI capabilities (Show GIF)
Vimtex integration (Show Video)
We utilize LitRepl alongside the Vimtex plugin to edit and preview LaTeX documents instantly.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file litrepl-3.14.1.tar.gz.
File metadata
- Download URL: litrepl-3.14.1.tar.gz
- Upload date:
- Size: 607.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90e6c2af1a0e9197216002a00a9234c6f251922c5a98b9e3f0968257943450c8
|
|
| MD5 |
aedccdb8a6e68435dca32d397951d403
|
|
| BLAKE2b-256 |
075fcb0380dbebbd29ee28949be89b3c5f335364e4a61ef558426ae5897a43dc
|
File details
Details for the file litrepl-3.14.1-py3-none-any.whl.
File metadata
- Download URL: litrepl-3.14.1-py3-none-any.whl
- Upload date:
- Size: 38.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
863aed0cc6294f0390e5ff20bb3a2f02f0ec3d38604ad3684a5efc768a39772f
|
|
| MD5 |
0544bfb22376a0bfd97aeddef2035fc5
|
|
| BLAKE2b-256 |
89d5483172e11a75c00d51e155810baffc3af299210dbce89cc5eedd5dfd066e
|