eafer / rdrview

Firefox Reader View as a command line tool
Apache License 2.0
844 stars 36 forks source link

Add option to inject css #24

Closed asakura42 closed 3 years ago

asakura42 commented 3 years ago

Plain text is ok, but sometimes I want to make more readable pages. I propose to add option to inject css. Now I use shell wrapper and modified stolen css block from simplyread (https://njw.name/simplyread/):

p{margin:0ex auto;} h1,h2,h3,h4{font-weight:normal}
p+p{text-indent:2em;} body{background:#cccccc none}
img{display:block; max-width: 32em; padding:1em; margin: auto}
h1{text-align:center;text-transform:uppercase}
div#readability-page-1{width:34em; padding:8em; padding-top:2em;
background-color:white; margin:auto; line-height:1.4;
text-align:justify; font-family:serif; hyphens:auto;}

It looks nice and my shell script works ok, but it will be good to have same option natively. Maybe something like rdrview --css 'p{margin:0ex auto;} h1,h2,h3,h4{font-weight:normal}' https://.... or smth like that.

eafer commented 3 years ago

I don't know, this sounds easy to do with a pipeline. I don't want to bloat the interface.

asakura42 commented 3 years ago

Sounds reasonably.