Format xonsh history to post it to Github or another page.
Project description
Format xonsh history to post it to Github or another page.
If you like the idea click ⭐ on the repo and stay tuned.
Installation
To install use pip:
xpip install xontrib-hist-format
# or: xpip install -U git+https://github.com/anki-code/xontrib-hist-format
Usage
xontrib load hist_format
hist-format --help # Basic command
hist-md # Markdown format shortcut
hist-txt # Text format shortcut
usage: hist-format [-h] [-f FORMAT] [-c COUNT] [-l] [-m] [--lines]
Format xonsh history to post it to Github or another page.
optional arguments:
-h, --help show this help message and exit
-f FORMAT, --format FORMAT
Format: md, txt.
-c COUNT, --count COUNT
Count of commands
-l, --show-commands-list
Show commands in distinct section.
-m, --min Make block minimized i.e. by adding <details> tag in Markdown.
--lines Add additional lines before and after.
Example
Run commands:
echo 123
ls / | head -n 3
Run hist-format:
hist-md -c 2 -l --lines # latest 2 commands + commands list + header and footer as line
As result you will get the output that you can copy and paste to the Github comment or md-file:
Output:
echo 123
#123
ls / | head -n 3
#boot
#cdrom
#dev
# Prepared by xontrib-hist-format
Commands:
echo 123
ls / | head -n 3
# Prepared by xontrib-hist-format
Clipboard
You can redirect the output to clipboard. Example for xclip:
hist-md | xclip
Known issues
Not every command has output in the __xonsh__.history
.
Credits
- This package is the part of ergopack - the pack of ergonomic xontribs.
- This package was created with xontrib cookiecutter template.
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
Close
Hashes for xontrib-hist-format-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00fc9263ec6832901026bf3c73386994337e1f42c02cb94df3fa415ed0f1a0a5 |
|
MD5 | 5a5dcf0da2bd882df1992b9b7eab4132 |
|
BLAKE2b-256 | f1e14868677e02abbec875899d2a2305885afb17c37c434d4932df7f68edf691 |
Close
Hashes for xontrib_hist_format-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce7d3c2fe3932c98cc906f5de4d449afed207e2263495e55a0f10440317ec51f |
|
MD5 | 893ad28a30ef5d0513e58950289e9172 |
|
BLAKE2b-256 | 12f198c33de412ad0352c86963fc47396d5e39a9aeafdfb28475bd6b051e4feb |