OpenCyphal / nunavut

Generate code from DSDL using PyDSDL and Jinja2
https://nunavut.readthedocs.io/
Other
39 stars 24 forks source link

Changing zoom is not feasible in nunaweb docs #210

Closed silverv closed 3 years ago

silverv commented 3 years ago

Zooming doesn't soft-wrap the text that overflows. This makes zooming useless as it hides some of the content due to it. This also means that only people who are happy with the provided font size will use the site. https://nunaweb.uavcan.org/api/storage/docs/docs/uavcan/index.html

silverv commented 3 years ago

The solution is to use this css rule:

pre {
  white-space: pre-wrap;       /* css-3 */
  white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
  white-space: -pre-wrap;      /* Opera 4-6 */
  white-space: -o-pre-wrap;    /* Opera 7 */
  word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

The solution is from here: https://css-tricks.com/snippets/css/make-pre-text-wrap/ Also have to make sure that the selector of the rule is specific enough for it to apply over whatever other styles are applied. A possible more precise selector would be: pre.docs

silverv commented 3 years ago

The webpage also loses a lot of text when viewed in portrait mode for the same reasons. image If I only knew where to put this css snippet, it would be done.

silverv commented 3 years ago

Which I can do every time I open the webpage, but why would every visitor fix the styles of the webpage they are visiting? This is how it looks with the quick fix proposed above: image

pavel-kirienko commented 3 years ago

You will find the definitions you are looking for under src/nunavut/lang/html/templates

silverv commented 3 years ago

This is done, just needs to be deployed.