-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
70 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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 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,9 @@ | ||
/* Don't allow to select >>> in ```pycon``` code blocks */ | ||
.highlight .gp, .highlight .go { /* Generic.Prompt, Generic.Output */ | ||
user-select: none; | ||
} | ||
|
||
/* >>> selection in ```python``` code blocks is handled with Javascript */ | ||
.no-user-select { | ||
user-select: none; | ||
} |
This file contains 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 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,22 @@ | ||
/** | ||
* Disable user selection for '>>>' nodes inside code blocks. | ||
*/ | ||
function disablePyConsolePromptsUserSelection() { | ||
const spans = document.getElementsByClassName('o'); | ||
for (let i=0; i<spans.length; i++) { | ||
const span = spans[i]; | ||
if (span.innerText === '>>>') { | ||
// if the next is a text node with a space as content | ||
// move the space to the span so it will not be selectable | ||
if (span.nextSibling.data === ' ') { | ||
span.innerText = '>>> ' | ||
span.nextSibling.data = '' | ||
} | ||
span.classList.add('no-user-select'); | ||
} | ||
} | ||
} | ||
|
||
document.addEventListener("DOMContentLoaded", function() { | ||
disablePyConsolePromptsUserSelection(); | ||
}) |
This file contains 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,6 @@ | ||
mkdocs>=1.1 | ||
mkdocs-material | ||
mkdocstrings | ||
mkdocstrings[python-legacy]>=0.18 | ||
mkdocs-include-markdown-plugin | ||
pygments | ||
pymdown-extensions |
This file contains 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 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