to-html icon indicating copy to clipboard operation
to-html copied to clipboard

Feature request: fonts.

Open Efreak opened this issue 3 years ago • 2 comments
trafficstars

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?

Efreak avatar Dec 12 '21 21:12 Efreak

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'

Aloso avatar Dec 12 '21 22:12 Aloso

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.

Efreak avatar Dec 12 '21 23:12 Efreak