Closed soshial closed 8 months ago
Firstly, we don't have to have the same defaults. Specially if you want to have the option of using a dark theme (that's why I don't like gray text)
Secondly, if you use a format like StarDict (not a binary format like slob or AppleDict binary), you can edit a CSS file after conversion, while using the dict app, rather than converting again to change a color.
So we just need an option to include a CSS file name in every entry.
I agree with you, a middle ground would to just make those 4 values customizable.
Same parameters would be re-used when converting XDXF <ex>
, <kref>
, <abbr>
tags.
We don't necessarily need to implement it via command parameters, I think just having a single CSS and a set of classes (examples, grammar, transcription etc. ) that's added to all glosses.
I propose the following solution (in the DSL reader):
<span class="c_red">
toouse_external_css
or like. "Off" is default and means using old hard-coded css style behaviour.In this case we could allow easy output dictionary customization for the user, like changing indents (important on phones) or even changing display:block
to display:inline
to remove line breaks (popup dictionaries like Kindle mobi).
@ilius if you are Ok with this and are ready to accept such a PR, I will try to implement it - it looks not too difficult.
Thanks for your proposal, @BorisNA — that's exactly how I imagined converting dictionaries: with CSS classes and not hardcoded colours & values.
@ilius what do you think about this? This improvement would help so much improving how dictionaries appearance and would become easier to read! Please consider this!
Здравствуй, @BorisNA, have you had a chance to work on your cool idea of customizable CSS for DSL dicts? :)
@soshial I see that this is not something that the author needs or even wants in his project, so I believe that it will be a waste of time, unfortunately.
Changing all html formatting to check for an option to switch between current logic and CSS makes it very bloated and hard to maintain (and slower). And we can't completely switch to CSS because some dictionaries don't support it.
I think a single-purpose tool (to convert DSL to StarDict for example) can do a much better job than pyglossary which is general-purpose.
It's probably my fault for not thinking it through at first. I'm gonna close this issue.
Firstly, example default color is
gray
. Secondly, stressed letters should bered
. Thirdly, I think it would be nice if other tags would have customizable colours, similar to Lingvo official program: