-
Notifications
You must be signed in to change notification settings - Fork 26
Refresh documentation styling with Furo theme #2934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vlad-perevezentsev
wants to merge
22
commits into
master
Choose a base branch
from
update_dpnp_docs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
00371ce
Update doc dependencies for furo migration
vlad-perevezentsev 2a2b216
Switch Sphinx theme to furo in conf.py
vlad-perevezentsev 3ff2adf
Redesign landing page with sphinx-design grid cards
vlad-perevezentsev 7530aa9
Comment lines for future dpnp logo
vlad-perevezentsev 1e5dfe6
Add custom CSS and JS for furo theme styling
vlad-perevezentsev 4355506
Use html_title as interim sidebar branding for furo theme
vlad-perevezentsev b5464e3
Fix warnings in index.rst
vlad-perevezentsev bb95bb0
Merge remote-tracking branch 'origin/master' into update_dpnp_docs
vlad-perevezentsev b748d2e
Rename css/js custom files
vlad-perevezentsev bacc702
Add js file manually in setup()
vlad-perevezentsev 48f18ff
Add debug step for check js file
vlad-perevezentsev bf5dcd1
Fix custom JS not executing
vlad-perevezentsev 0f1f80c
Handle both EN DASH and double-hyphen separators in parameter reforma…
vlad-perevezentsev 7bc144a
Remove Debug JS step
vlad-perevezentsev 0bdc775
Merge master into update_dpnp_docs
vlad-perevezentsev e0bb48e
Merge remote-tracking branch 'origin/master' into update_dpnp_docs
vlad-perevezentsev ac4b390
Apply remarks
vlad-perevezentsev 3d3ae8f
Update changelog
vlad-perevezentsev 8c610e7
Merge remote-tracking branch 'origin/master' into update_dpnp_docs
vlad-perevezentsev d39cd2a
Apply remarks
vlad-perevezentsev b5ff034
Merge remote-tracking branch 'origin/master' into update_dpnp_docs
vlad-perevezentsev c4ccfda
A small update .css file
vlad-perevezentsev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /* Autosummary tables: left-aligned */ | ||
|
vlad-perevezentsev marked this conversation as resolved.
|
||
| .longtable.docutils { | ||
| margin-left: 0; | ||
| margin-right: auto; | ||
| } | ||
|
|
||
| /* Admonitions: normal font size, no left accent bar */ | ||
| div.admonition { | ||
| font-size: inherit !important; | ||
| border-left: 0 !important; | ||
| } | ||
|
|
||
| /* Table borders and alternating row backgrounds */ | ||
| body table.docutils td, | ||
| body table.docutils th { | ||
| border: 1px solid var(--color-foreground-border) !important; | ||
| padding: 8px 12px; | ||
| } | ||
|
|
||
| body table.docutils thead th, | ||
| body table.docutils tbody tr.row-odd { | ||
| background-color: var(--color-background-secondary) !important; | ||
| } | ||
|
|
||
| body table.docutils tbody tr.row-even { | ||
| background: transparent !important; | ||
| } | ||
|
|
||
| /* Docstring section titles: normal case, bold, secondary background */ | ||
| dd p.rubric, | ||
| dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .field-list > dt, | ||
| .admonition > .admonition-title { | ||
| text-transform: none !important; | ||
| font-size: inherit !important; | ||
| font-weight: 700 !important; | ||
| background-color: var(--color-background-secondary); | ||
| padding: 4px 8px; | ||
| } | ||
|
|
||
| /* Constants page: lighter section headers */ | ||
| #constants dd p.rubric { | ||
| background-color: transparent; | ||
| padding: 0; | ||
| border-bottom: 1px solid var(--color-foreground-border); | ||
| } | ||
|
|
||
| /* Function signatures: normal weight, bold only for name and param names */ | ||
| dt.sig.sig-object, | ||
| dt.sig.sig-object * { | ||
| font-weight: 400 !important; | ||
| } | ||
|
|
||
| dt.sig.sig-object .sig-name, | ||
| dt.sig.sig-object .sig-name *, | ||
| dt.sig.sig-object .sig-param > .n, | ||
| dt.sig.sig-object .sig-param > .n * { | ||
| font-weight: 700 !important; | ||
| } | ||
|
|
||
| /* Parameter/return descriptions: indented block on new line (via custom.js) */ | ||
| dl.field-list dd .param-desc { | ||
| display: block; | ||
| padding-left: 1.5em; | ||
| } | ||
|
|
||
| /* Parameter lists: no bullets, keep indentation */ | ||
| dl.field-list dd ul.simple { | ||
| list-style: none !important; | ||
| padding-left: 1.2em !important; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| (function() { | ||
| var separators = [ " – ", " -- " ]; | ||
|
|
||
| function findSeparator(container) | ||
| { | ||
| var walker = document.createTreeWalker(container, NodeFilter.SHOW_TEXT); | ||
| var node; | ||
| while ((node = walker.nextNode())) { | ||
| for (var i = 0; i < separators.length; i++) { | ||
| var idx = node.nodeValue.indexOf(separators[i]); | ||
| if (idx !== -1) | ||
| return {node : node, offset : idx, sep : separators[i]}; | ||
| } | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| // Splits <p> at the separator; wraps everything after it in .param-desc. | ||
| function reformatP(p) | ||
| { | ||
| var found = findSeparator(p); | ||
| if (!found) | ||
| return null; | ||
|
|
||
| var afterNode = found.node.splitText(found.offset); | ||
| afterNode.nodeValue = afterNode.nodeValue.slice(found.sep.length); | ||
|
|
||
| var range = document.createRange(); | ||
| range.setStartBefore(afterNode); | ||
| range.setEndAfter(p.lastChild); | ||
|
|
||
| var desc = document.createElement("span"); | ||
| desc.className = "param-desc"; | ||
| desc.appendChild(range.extractContents()); | ||
| p.appendChild(desc); | ||
| return desc; | ||
| } | ||
|
|
||
| // Browsers auto-close nested <p> tags, so multi-paragraph descriptions | ||
| // arrive as sibling <p> elements inside <li>. Fold them into the same desc. | ||
| function reformatEntry(container) | ||
| { | ||
| var firstP = container.querySelector(":scope > p"); | ||
| if (!firstP) | ||
| return; | ||
|
|
||
| var desc = reformatP(firstP); | ||
| if (!desc) | ||
| return; | ||
|
|
||
| var sibling; | ||
| while ((sibling = firstP.nextElementSibling) && sibling.tagName === "P") { | ||
| if (desc.textContent.trim()) | ||
| desc.appendChild(document.createElement("br")); | ||
| while (sibling.firstChild) | ||
| desc.appendChild(sibling.firstChild); | ||
| sibling.remove(); | ||
| } | ||
| } | ||
|
|
||
| document.querySelectorAll("dl.field-list dd ul.simple li") | ||
| .forEach(reformatEntry); | ||
| document.querySelectorAll("dl.field-list dd").forEach(function(dd) { | ||
| if (!dd.querySelector("ul.simple")) | ||
| reformatEntry(dd); | ||
| }); | ||
| }()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| pyenchant==3.2.2 | ||
| sphinx-copybutton==0.5.2 | ||
| sphinx-design==0.6.1 | ||
| sphinxcontrib-googleanalytics==0.4 | ||
| sphinxcontrib-spelling==8.0.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.