GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.13] gh-121035: Improve logging flow diagram for dark/light modes. … · vsajip/cpython@845d861

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Doc/howto
    • logging.rst
    • logging_flow.svg
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Doc/howto/logging.rst‎

Copy file name to clipboardExpand all lines: Doc/howto/logging.rst
+38Lines changed: 38 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,44 @@ following diagram.
385385
.. raw:: html
386386
:file: logging_flow.svg
387387

388+
.. raw:: html
389+
390+
<script>
391+
/*
392+
* This snippet is needed to handle the case where a light or dark theme is
393+
* chosen via the theme is selected in the page. We call the existing handler
394+
* and then add a dark-theme class to the body when the dark theme is selected.
395+
* The SVG styling (above) then does the rest.
396+
*
397+
* If the pydoc theme is updated to set the dark-theme class, this snippet
398+
* won't be needed any more.
399+
*/
400+
(function() {
401+
var oldActivateTheme = activateTheme;
402+
403+
function updateBody(theme) {
404+
let elem = document.body;
405+
406+
if (theme === 'dark') {
407+
elem.classList.add('dark-theme');
408+
}
409+
else {
410+
elem.classList.remove('dark-theme');
411+
}
412+
}
413+
414+
activateTheme = function(theme) {
415+
oldActivateTheme(theme);
416+
updateBody(theme);
417+
};
418+
/*
419+
* If the page is refreshed, make sure we update the body - the overriding
420+
* of activateTheme won't have taken effect yet.
421+
*/
422+
updateBody(localStorage.getItem('currentTheme') || 'auto');
423+
})();
424+
</script>
425+
388426
Loggers
389427
^^^^^^^
390428

Collapse file

‎Doc/howto/logging_flow.svg‎

Copy file name to clipboardExpand all lines: Doc/howto/logging_flow.svg
+24-11Lines changed: 24 additions & 11 deletions
  • Display the source diff
  • Display the rich diff
Loading

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.