Skip to content

hugovk/linkotron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

872bbb8 · Jul 3, 2024
Feb 8, 2024
Feb 8, 2024
Feb 8, 2024
Feb 8, 2024
Jul 3, 2023
Sep 8, 2022
Jul 3, 2024
Jul 3, 2023
Jan 30, 2024
Jul 3, 2023
Jul 3, 2024
Feb 8, 2024

Repository files navigation

linkotron

PyPI version Supported Python versions PyPI downloads Test Codecov Licence Code style: Black

CLI to format GitHub links in a shorter format.

Installation

From PyPI

python3 -m pip install --upgrade linkotron

With pipx

pipx install linkotron

From source

git clone https://github.com/hugovk/linkotron
cd linkotron
python3 -m pip install .

Usage

Run linkotron or linky, they do the same thing.

$ linky --help
usage: linky [-h] [-V] [--no-copy] [-m | -r] input

linkotron: CLI to format GitHub links in a shorter format.

positional arguments:
  input                 text containing GitHub links to shorten

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  --no-copy             do not copy output to clipboard

formatters:
  -m, --md, --markdown  output in Markdown
  -r, --rst, --restructuredtext
                        output in reStructuredText

Linkify a repo

$ linky https://github.com/python/peps
Copied! python/peps

Linkify an issue

$ linky https://github.com/python/peps/issues/1012
Copied! python/peps#1012

Linkify a pull request

$ linky https://github.com/python/peps/pull/2399
Copied! python/peps#2399

Linkify a commit

$ linky https://github.com/hugovk/cpython/commit/28b23555030d58fdb52b74a547cc621c49690de0
Copied! hugovk/cpython#28b2355

Linkify a comment

$ linky https://github.com/python/peps/pull/2399#issuecomment-1063409480
Copied! python/peps#2399 (comment)

Formatting

Markdown

$ linky --md https://github.com/python/peps/pull/2399
Copied! [python/peps#2399](https://github.com/python/peps/pull/2399)

reStructuredText

$ linky --rst https://github.com/python/peps/pull/2399
Copied! `python/peps#2399 <https://github.com/python/peps/pull/2399>`__