Skip to main content

Reference code to improve explainability

Project description

refers

reference code simply

Tests PyPI version

The refers library allows referencing plain text files from plain text files.

Usage:

  1. Add a @tag to the line that you want to reference: @tag:NAME
  2. To reference the tag use @ref followed by an optional option: @ref:NAME:OPTION
  3. run the refers library in the command line

The refers library will create new files with the outputted references in place of the tags. Changes of line placement, file name, relative path etc. are reflected in the updated references when the refers library is executed.

Installation

pip install refers

Reference Options

A reference has the following structure: @ref:NAME:OPTION. This will reference the named tag with the specified option. The available options are outlined in the table below.

Option Output
blank file name and line number
:file file name
:line line number
:link relative link to file
:linkline relative link to line in file
:fulllink full path link to file
:fulllinkline full path link to line in file
:quote quote line
:quotecode quote line of code without comment
:func get function name that contains line
:class get class name that contains line

Relative paths are given from the directory containing the pyproject.toml.

Future Work

Currently line continuation of code is only supported in python (using black). Future work will include supporting line continuation for all languages.

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

refers-0.0.4.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

refers-0.0.4-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file refers-0.0.4.tar.gz.

File metadata

  • Download URL: refers-0.0.4.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.6 Windows/10

File hashes

Hashes for refers-0.0.4.tar.gz
Algorithm Hash digest
SHA256 53422088b58de1ea1a4702c151dff3fe25f49ebda82331dc9f4dc3fff4bee019
MD5 67f93c9b06a709a04f3b8782ba27bc9e
BLAKE2b-256 de6b6c410d806f1334e37a96fa896522f9975b025ac3db3a50291a8bbd3ce9af

See more details on using hashes here.

File details

Details for the file refers-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: refers-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.6 Windows/10

File hashes

Hashes for refers-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2b847df522d8a7b4968ef000051849cef8dfc864fc801a9337e1410e6c95aa52
MD5 6ccf3e086e5b6fbffc7bd343b98284a7
BLAKE2b-256 c36f6929141439c1345a059613ac136f13bc01410621099f594c90593bbed296

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page