Coder Social home page Coder Social logo

bczsalba / termage Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 0.0 796 KB

Generate SVGs from any Python code, even in your documentation.

Home Page: https://termage.bczsalba.com

License: MIT License

Python 100.00%
documentation mkdocs mkdocs-material mkdocs-plugin pytermgui svg-images

termage's People

Contributors

bczsalba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

termage's Issues

[REQUEST] Allow mkdocs-side global configuration

Is your feature request related to a problem? Please describe.
It's a bit annoying having to set every configuration value on a per-codeblock basis. Also, it is currently not possible to change the
output directory or naming scheme.

Describe the solution you'd like
Introduce mkdocs config options:

plugins:
  - termage:
       output_dir: "docs/termage"
       output_name_template: "screenshot_{index}.svg"
       background: "#dddddd"
       foreground: "#212121"

Describe alternatives you've considered
Manual configuration, but it's very restrictive.

[BUG] mkdocs only sees generated files after the second generation

Describe the bug
When generating from a clear tree (e.g. docs/assets is empty), the first run will have mkdocs complain about links to non-detected files:

Screenshot 2022-05-26 at 8 45 41

To Reproduce
Steps to reproduce the behavior:

  1. Run rm -rf docs/assets/*
  2. Run mkdocs serve
  3. Look at the terminal output and see warnings

If the development server is killed and restarted, the problem goes away.

Expected behavior
The files should be detected on first run.

Platform info
Browser: All

PTG:

PyTermGUI version 6.2.1

System details:
    Python version: 3.9.12
    $TERM:          xterm-kitty
    $COLORTERM:     truecolor
    Color support:  ColorSystem.TRUE
    OS Platform:    macOS-12.3.1-arm64-arm-64bit

[BUG] Terminal initialization codes visible in VTE3 terminals: “^[[4;1120;1917”

Describe the bug

When invoking termage in a VTE3 based terminal emulator, e.g. with termage -h, something that I suspect is terminal initialization codes are visible.

To Reproduce

  1. Open a VTE3 based terminal, e.g. terminator or sakura.
  2. Invoke termage with termage -h
  3. Enjoy the pretty sprinkles at the beginning and at the end of the help text.

Expected behavior

Teminal initialization codes ought to be invisible for the casual user.

Screenshots

In the screenshot of a terminator window just below the sprinkles can be clearly seen:

termage-ckb7yon68sg8

Platform info

I have seen it happen in VTE3 based terminal emulators:

  • terminator
  • sakura

But not in terminal emulators that are not based on VTE3:

  • xterm
  • kitty

PTG

Termage doesn't have a --version option, but pip has installed v0.2.0.

[BUG] Cannot install with pip: No module named ‘mkdocs_termage_plugin’

Describe the bug

When calling pip install mkdocs-termage-plugin the installation fails, seemingly because of a ModuleNotFoundError.

To Reproduce

Just run pip install mkdocs-termage-plugin from a terminal prompt.

Expected behavior

I expected the package to be downloaded and installed.

Screenshots

pip-install-fail-ck9nhfdsur68

Platform info
Browser: Not a browser, see screenshot of terminal

[REQUEST] Termage as a standalone app?

Is your feature request related to a problem? Please describe.

Could termage be implented as a standalone app?

Describe the solution you'd like

It would be weet to be able to generate an SVG (or more generally, an image) from a given code file. E.g.:

$ termage --help
Usage: termage [INPUT [OUTPUT]]
$ termage hello-world.py hello-world.svg

Describe alternatives you've considered

I usually go to https://carbon.now.sh/ to generate images from my code, so that I can post it on e.g. social media or on a blog. It would be sweeter to be able to do it from the commandline.

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.