Skip to content

Get the typer output with html format to provide it to termynal #538

Open
@GreNait

Description

First Check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Typer documentation, with the integrated search.
  • I already searched in Google "How to X in Typer" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to Typer but to Click.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

script -q -c "python data_stream_measurement/main.py --help" test.out
cat test.out | ./ansi2html.sh test.html

Description

Within the typer documentation, termynal is used to interactively show the typer features etc. They are also all styled like the typical terminal output. It would be awesome, if I could replicate this for my typer app documentation.

I tried to capture the terminal styling with several approaches:

  • Capture output as html -> didn't work
  • Use script to capture the terminal and afterwards use ansi2html -> still no coloring

Is there a way, to get the typer output saved into a file, with the html styling? So I could copy that to my markdown?

Operating System

Linux

Operating System Details

Ubuntu 20.04

Typer Version

0.7.0

Python Version

3.8.10

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    questionQuestion or problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions