Aloso/to-html

Feature request: fonts.

Opened this issue · 2 comments

Probably sufficient to have an option that chooses a front from powerline-web-fonts's stylesheet, and another option to override the stylesheet and allow other fonts (there's dozens of fonts available between nerdfonts.com and programmingfonts.org).

Examples:

  • --font=inconsolata adds @import url('https://cdn.jsdelivr.net/gh/wernight/powerline-web-fonts@ba4426cb0c0b05eb6cb342c7719776a41e1f2114/PowerlineFonts.css') and sets font-family:inconsolata,monospace;
  • --stylesheet=https://www.example.com/shitty-fonts.css --font="Comic Sans" adds @import url('https://www.example.com/shitty-fonts.css') and sets font-family: "Comic Sans", monospace; and maybe an option for text-transform: full-width?
Aloso commented

What's the use case? Can't you add these styles yourself?

If you're using the --doc flag, I think a better solution would be an option to add custom CSS, perhaps even custom HTML:

to-html -d --css ".terminal { font-family: Inconsolate, monospace }" 'cargo run'

I can absolutely add the styles myself, however the primary use case would be automating it. This way you can set up an alias that re-runs the previous command, captures the output, uploads it to a gist or private server and copies a link to the clipboard for pasting elsewhere.

A --css option would work just as well and it's probably a better idea, though it would make the command a bit longer.