Skip to content

Feature Request: Automatable HTML dump of really all the content #1336

@jhcarl0814

Description

@jhcarl0814

Feature description:

  1. Creates an HTML file in the current working directory, like echo -e '\e[10i';
  2. Automatable (does not require a human to click mouse etc), like echo -e '\e[10i';
  3. Unlike echo -e '\e[10i', ignores window height, so the content pushed beyond the top border is also included;
  4. Unlike echo -e '\e[10i', ignores window width, so the content that wraps visually doesn't generate <br>.

Use case:

  1. Create a web page which uses HTML dump to demonstrate some command line tool(s)'s usage;
  2. There are many, many dumps so this needs to be automatable (operated by script without human intervention);
  3. Demos may contain a large number of commands, and no matter how tall the screen is, some content will always be pushed beyond the top border;
  4. Line wrapping (or horizontal scrolling) should be controlled by downstream CSS, not by however the window/screen width is at the time of dump.

Currently 3. and 4. are unavailable. There are workarounds such as ansi2html, which add a nested layer of <span> wherever style changes causing The W3C Markup Validation Service to warn you about DOM tree depth, and do not handle styles such as blinking.


Code and screenshot demonstrating 3. and 4. currently are unavailable:

commands=$(cat <<-'EOF_commands_dump'
"$SHELL" -i 0<<-'EOF_commands'
printf -- '%0.d\n' {1..1000}
printf -- '-%0.s' {1..1000}
EOF_commands
echo -e '\e[10i'
EOF_commands_dump
)
/git-bash.exe -c "$commands"
Image
  • Numbers less than 945 are lost (according to the window height at the time of dump).
  • The last line has superfluous <br>s (according to the window width at the time of dump), so even if downstream CSS gives the content more room to fit or allows free horizonal scrolling, the line wrapping still occurs.

Screenshot demonstrating how the result will be used when 3. and 4. are available (https://jhcarl0814.github.io/ClosedAI/git/git.html ):

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions