Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upENH: Configurable highlight style #38
Conversation
This comment has been minimized.
This comment has been minimized.
Bikeshedding. Imho #34 (comment) is a better way to address #34.
I'd prefer to drop it too. If you need this at work, you can use a custom head.mako file with contents such as: <style>
dd p {
white-space: pre-wrap;
}
</style>
I'm ok with this, but only when the details are expanded (open), i.e. on: .source details[open] summary { background: ... }
The blue box is compliments of your chosen OS / widget toolkit. For me, the outline is far less conspicuous. See also: http://www.outlinenone.com. You can override CSS without overriding the rest of the HTML template by using the mentioned head.mako file. |
KyleKing
force-pushed the
KyleKing:dev/CSS-Improvements
branch
2 times, most recently
from
d04081a
to
26d1a9d
Feb 25, 2019
This comment has been minimized.
This comment has been minimized.
|
Thanks for the feedback. I dropped 2,3,5 and kept 4 (12 px code). |
kernc
approved these changes
Feb 25, 2019
pdoc/templates/config.mako Outdated
pdoc/templates/config.mako Outdated
kernc
changed the title
Refac: Atom One Light hljs style & css tweaks
ENH: Configurable highlight style
Feb 25, 2019
kernc
added this to the 0.6.0 milestone
Feb 25, 2019
This comment has been minimized.
This comment has been minimized.
|
I made the changes! |
This comment has been minimized.
This comment has been minimized.
|
Thanks! |
KyleKing commentedFeb 24, 2019
•
edited by kernc
Fixes #34
I'd be happy to undo any (hopefully not all😄 ) of these changes, so let me know if you want to implement 1, 3, and 5 but not 2 and 4, etc. The four main changes are listed below and shown in side-by-side screenshot comparisons below:
Atom One LightHighlight.js style (other alternatives could beFoundation,Github Gist,A 11 Y Light, or others from https://highlightjs.org/static/demo/). This directly addresses #34white-space: pre-wrap;. At work, we have a compact docstring style where the newlines need to be preserved in the documentation. See discussion from pdoc: pdoc/179#comment. I think keeping the newlines is more consistent with how the comments were written in a text editor, but I'm open to dropping this changeSOURCE CODEwith the same background color as the hljs style (and add a small amount of padding) (background-color: #fafafa; /* Match HLJS backgd */)SOURCE CODEelement (outline: none !important;)Screenshots
Each example shows all of the proposed changes, but I call-out specific changes for each example. Generated with:
pip install beautifulsoup4pdoc bs4 --http localhost:8000Example 1
Proposed
Current
Notes
2 - Examples 1 and 2 show how the
pre-wrapchange comes into play causing the newlines from the source code to be preserved5 - Because of
cursor: pointer;, when you clickSOURCE CODE, the browser will momentary highlight the div. In the proposed version,outline: none !important;prevents the blue highlight from appearing on click (focus)Example 2
Proposed
Current
Notes
2 - See how the
pre-wrapchange comes into play causing the newlines from the source code to be preserved (decode()andhandle_starttag())3 - The clickable region for source code is lightly highlighted
Example 3
Proposed
Current
Notes
1,4 - The source code variable and built-ins are more clearly highlighted and the code better fits within the height-limited section