Skip to main content

View highlighted python code

Project description

BB-PyCodeView

View syntax highlighted code from a filename or module name

Options

$ code-view --help

    code-view - view highlighted python code

    ( -c |    --comments     ):  Show comments in output
                                  - default = False
    ( -f |    --function     ):  Function name - same as adding ':function' after module name
    ( -H |      --html       ):  Output an html string
    ( -h |      --help       ):  Print help message
    ( -m |     --module      ):  View code from a module
                                  - will attempt to automagically parse this without the option given
    ( -n | --no-highlighting ):  Disable syntax highlighting in output
                                  - only effects output - string data is still processed
                                  - default = False
    ( -p |    --filepath     ):  View file contents
                                  - path can also be provided without this option
    ( -s |     --string      ):  Code view from a provided string
    (    |     --version     ):  Print version info and exit

If the options -p|--filepath, -m|--module, or -f|--function are ommitted, it will attempt to automatically assign the arguments properly. May not work depending on the module name/path. Pathnames are almost guaranteed to work on their own.

TODO

  • theming
  • comments are not removed when --no-highlighting option is used
    • syntax highlighter is what removed them - might rewrite this

ChangeLog

v0.1.0
- initial release
v0.1.1
- added html output
- added licenses
v0.1.2
- added `--version` option
v0.1.3
- made html look nicer
- fixed `--no-highlighting` option for html output
- `--no-highlighting` option now skips syntax highlighter processing
- added `__call__` method to SyntaxHighlighter
    - same as calling `SyntaxHighlighter.highlight()`
- fixes for method lookup
- added `-a`|`--attribute` options for searching attributes

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

bb_pycodeview-0.1.3.tar.gz (67.9 kB view hashes)

Uploaded Source

Built Distribution

bb_pycodeview-0.1.3-py3-none-any.whl (68.1 kB view hashes)

Uploaded Python 3

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