Various RTD related fixes.
This commit is contained in:
		
							
								
								
									
										21
									
								
								docs/_static/style.css
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										21
									
								
								docs/_static/style.css
									
									
									
									
										vendored
									
									
								
							@@ -74,6 +74,9 @@ Historically however, thanks to:
 | 
			
		||||
  --active-toc: #dbdbdb;
 | 
			
		||||
  --scrollbar: rgba(0,0,0,0.2);
 | 
			
		||||
  --scrollbar-hover: rgba(0,0,0,0.4);
 | 
			
		||||
  --rtd-ad-border: #bfbfbf;
 | 
			
		||||
  --rtd-ad-background: #eeeeee;
 | 
			
		||||
  --rtd-ad-text-rgb: 64, 64, 64;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
:root[data-font="sans"] {
 | 
			
		||||
@@ -124,6 +127,9 @@ Historically however, thanks to:
 | 
			
		||||
  --active-toc: #212121;
 | 
			
		||||
  --scrollbar: rgba(0,0,0,0.5);
 | 
			
		||||
  --scrollbar-hover: rgba(0,0,0,0.7);
 | 
			
		||||
  --rtd-ad-border: #333333;
 | 
			
		||||
  --rtd-ad-background: #404040;
 | 
			
		||||
  --rtd-ad-text-rgb: 221, 221, 221;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
img[src$="snake_dark.svg"]  {
 | 
			
		||||
@@ -844,6 +850,21 @@ section#welcome-to-discord-py > h1 {
 | 
			
		||||
  display: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* make the RTD ad look a little less jarring */
 | 
			
		||||
 | 
			
		||||
.ethical-fixedfooter {
 | 
			
		||||
  background-color: var(--rtd-ad-background) !important;
 | 
			
		||||
  border-top: 1px solid var(--rtd-ad-border) !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.ethical-fixedfooter a {
 | 
			
		||||
  color: rgb(var(--rtd-ad-text-rgb)) !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.ethical-callout a {
 | 
			
		||||
  color: rgba(var(--rtd-ad-text-rgb), 0.7) !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.active {
 | 
			
		||||
  background-color: var(--mobile-active-toc);
 | 
			
		||||
  border-left: 5px solid var(--mobile-active-toc);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								docs/_templates/layout.html
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								docs/_templates/layout.html
									
									
									
									
										vendored
									
									
								
							@@ -4,6 +4,8 @@
 | 
			
		||||
  <meta charset="utf-8">
 | 
			
		||||
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
			
		||||
  <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
 | 
			
		||||
  {%- block extrahead %} {% endblock %}
 | 
			
		||||
  <!-- end extra head -->
 | 
			
		||||
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
 | 
			
		||||
  <link rel="stylesheet" href="{{ pathto('_static/style.css', 1)|e }}" type="text/css" />
 | 
			
		||||
  <link rel="stylesheet" href="{{ pathto('_static/codeblocks.css', 1) }}" type="text/css" />
 | 
			
		||||
@@ -48,7 +50,6 @@
 | 
			
		||||
  <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
 | 
			
		||||
  {%- endif %}
 | 
			
		||||
  {%- endblock %}
 | 
			
		||||
  {%- block extrahead %} {% endblock %}
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
{%- block header %}{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
@@ -48,18 +48,20 @@ def add_custom_jinja2(app):
 | 
			
		||||
    env.tests['prefixedwith'] = str.startswith
 | 
			
		||||
    env.tests['suffixedwith'] = str.endswith
 | 
			
		||||
 | 
			
		||||
def get_builder(app):
 | 
			
		||||
def add_builders(app):
 | 
			
		||||
    """This is necessary because RTD injects their own for some reason."""
 | 
			
		||||
    try:
 | 
			
		||||
        original = app.registry.builders['readthedocs']
 | 
			
		||||
    except KeyError:
 | 
			
		||||
        return DPYStandaloneHTMLBuilder
 | 
			
		||||
        app.set_translator('html', DPYHTML5Translator, override=True)
 | 
			
		||||
        app.add_builder(DPYStandaloneHTMLBuilder, override=True)
 | 
			
		||||
    else:
 | 
			
		||||
        injected_mro = tuple(base if base is not StandaloneHTMLBuilder else DPYStandaloneHTMLBuilder
 | 
			
		||||
                             for base in original.mro()[1:])
 | 
			
		||||
        return type(original.__name__, injected_mro, {'name': 'readthedocs'})
 | 
			
		||||
        new_builder = type(original.__name__, injected_mro, {'name': 'readthedocs'})
 | 
			
		||||
        app.set_translator('readthedocs', DPYHTML5Translator, override=True)
 | 
			
		||||
        app.add_builder(new_builder, override=True)
 | 
			
		||||
 | 
			
		||||
def setup(app):
 | 
			
		||||
    app.set_translator('html', DPYHTML5Translator, override=True)
 | 
			
		||||
    app.add_builder(get_builder(app), override=True)
 | 
			
		||||
    add_builders(app)
 | 
			
		||||
    app.connect('builder-inited', add_custom_jinja2)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user