GithubHelp home page GithubHelp logo

jewel's Introduction

jewel

Rich Python code snippets.

pip install jewel

Examples

Module & Member Input

> jewel -m rich.print -th dracula

๐Ÿ’Ž Saved SVG to jewel.svg!

The source code for rich.print.

File & Line Number Input

> jewel -i jewel/__main__.py -l 81 101 -o file_input.svg

๐Ÿ’Ž Saved SVG to file_input.svg!

Source code from jewel/__main__.py.

Usage

> jewel -h

usage: jewel [-h] (-i PATH | -m MEMBER) [-l START END] [-g] [-n] [-nd] [-th THEME] [-na] [-nt] [-o PATH] [-t TITLE] [-w WIDTH]

Rich Python code snippets.

options:
  -h, --help            show this help message and exit
  -i PATH, --input PATH
                        The Python file to use.
  -m MEMBER, --member MEMBER
                        The member to use.
  -l START END, --lines START END
                        The line range to use.

code options:
  -g, --guides          Include indent guides.
  -n, --numbers         Include line numbers.
  -nd, --no-docs        Remove member docstring.
  -th THEME, --theme THEME
                        The syntax theme to use.

svg options:
  -na, --no-after       No terminal:after gradient.
  -nt, --no-traffic-lights
                        No traffic lights.
  -o PATH, --output PATH
                        Where to save the SVG.
  -t TITLE, --title TITLE
                        A title for the snippet.
  -w WIDTH, --width WIDTH
                        The width of the snippet.

jewel's People

Contributors

aaronst avatar

Stargazers

 avatar  avatar

Watchers

 avatar

jewel's Issues

Accept a callable returning a `Console(record=True)` instance

I have a custom script which generates my desired output/formatting in the form of a Console(record=True) instance. It would be great if I could something like:

jewel -c my_module.generate

It would execute my_module.generate and print the return Console instance.

A cheeky alternative syntax could be jewel -m "my_module.generate()" (note the pseudo-function-call).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.