Skip to content

Commit

Permalink
Merge branch 'master' into rellinks-classes
Browse files Browse the repository at this point in the history
  • Loading branch information
asmeurer committed Mar 4, 2021
2 parents 32ac2ff + 3b68afc commit 4fc1b6b
Show file tree
Hide file tree
Showing 16 changed files with 488 additions and 381 deletions.
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
- SPHINX=">=1.4,<1.5"
- SPHINX=">=1.5,<1.6"
- SPHINX=">=1.6,<1.7"
- SPHINX=">=1.7,<1.8"
install:
# For some reason Travis' build envs have wildly different pip/setuptools
# versions between minor Python versions, and this can cause many hilarious
Expand All @@ -28,10 +29,7 @@ install:
# Dev tooling sanity test: can invoke list tasks?
- inv --list
script:
# We have no real tests at present so we just make sure installation works,
# first off.
- pip install .
- inv travis.blacken
- flake8
# Does our own dogfooding website build ok? :D
- inv docs
# I have this in my git pre-push hook, but contributors probably don't
- flake8
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2018 Jeff Forcier.
Copyright (c) 2020 Jeff Forcier.

Based on original work copyright (c) 2011 Kenneth Reitz and copyright (c) 2010
Armin Ronacher.
Expand Down
12 changes: 6 additions & 6 deletions alabaster/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ def get_path():


def update_context(app, pagename, templatename, context, doctree):
context['alabaster_version'] = version.__version__
context["alabaster_version"] = version.__version__


def setup(app):
# add_html_theme is new in Sphinx 1.6+
if hasattr(app, 'add_html_theme'):
if hasattr(app, "add_html_theme"):
theme_path = os.path.abspath(os.path.dirname(__file__))
app.add_html_theme('alabaster', theme_path)
app.connect('html-page-context', update_context)
return {'version': version.__version__,
'parallel_read_safe': True}
app.add_html_theme("alabaster", theme_path)
app.connect("html-page-context", update_context)
return {"version": version.__version__, "parallel_read_safe": True}
4 changes: 2 additions & 2 deletions alabaster/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_info__ = (0, 7, 10)
__version__ = '.'.join(map(str, __version_info__))
__version_info__ = (0, 7, 12)
__version__ = ".".join(map(str, __version_info__))
4 changes: 2 additions & 2 deletions alabaster/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1 class="logo"><a href="{{ pathto(master_doc) }}">{{ project }}</a></h1>
{% set path = theme_travis_button %}
{% endif %}
<p>
<a href="https://travis-ci.org/{{ path }}">
<a class="badge" href="https://travis-ci.org/{{ path }}">
<img
alt="https://secure.travis-ci.org/{{ path }}.svg?branch={{ theme_badge_branch }}"
src="https://secure.travis-ci.org/{{ path }}.svg?branch={{ theme_badge_branch }}"
Expand All @@ -47,7 +47,7 @@ <h1 class="logo"><a href="{{ pathto(master_doc) }}">{{ project }}</a></h1>
{% set path = theme_codecov_button %}
{% endif %}
<p>
<a href="https://codecov.io/github/{{ path }}">
<a class="badge" href="https://codecov.io/github/{{ path }}">
<img
alt="https://codecov.io/github/{{ path }}/coverage.svg?branch={{ theme_badge_branch }}"
src="https://codecov.io/github/{{ path }}/coverage.svg?branch={{ theme_badge_branch }}"
Expand Down
31 changes: 25 additions & 6 deletions alabaster/donate.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
{% if theme_gratipay_user or theme_gittip_user %}
<h3>Donate</h3>
{# TODO: wrap all these in their own divs for easier styling #}

{% if theme_donate_url or theme_opencollective or theme_tidelift_url %}
<h3 class="donation">Donate/support</h3>
{% endif %}

{% if theme_donate_url %}
<p>
<a class="badge" href="{{ theme_donate_url }}">
<img src="https://img.shields.io/badge/donate-%E2%9D%A4%C2%A0-ff69b4.svg?style=flat" alt="Donate">
</a>
</p>
{% endif %}

{% if theme_opencollective %}
<p>
<a class="badge" href="https://opencollective.com/{{ theme_opencollective }}/donate" target="_blank">
<img src="https://opencollective.com/{{ theme_opencollective }}/donate/button.png?color={{ theme_opencollective_button_color }}" width=300 />
</a>
</p>
{% endif %}

{% if theme_tidelift_url %}
<p>
Consider supporting the authors on <a href="https://www.gratipay.com/">Gratipay</a>:
<script data-gratipay-username="{{ theme_gratipay_user or theme_gittip_user }}"
data-gratipay-widget="button"
src="//gttp.co/v1.js"></script>
Professionally-supported {{ project }} is available with the
<a href="{{ theme_tidelift_url }}">Tidelift Subscription</a>.
</p>
{% endif %}
13 changes: 13 additions & 0 deletions alabaster/static/alabaster.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,19 @@ div.sphinxsidebar hr {
width: 50%;
}

div.sphinxsidebar .badge {
border-bottom: none;
}

div.sphinxsidebar .badge:hover {
border-bottom: none;
}

/* To address an issue with donation coming after search */
div.sphinxsidebar h3.donation {
margin-top: 10px;
}

/* -- body styles ----------------------------------------------------------- */

a {
Expand Down
149 changes: 76 additions & 73 deletions alabaster/support.py
Original file line number Diff line number Diff line change
@@ -1,88 +1,91 @@
# flake8: noqa

from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
from pygments.token import (
Keyword,
Name,
Comment,
String,
Error,
Number,
Operator,
Generic,
Whitespace,
Punctuation,
Other,
Literal,
)


# Originally based on FlaskyStyle which was based on 'tango'.
class Alabaster(Style):
background_color = "#f8f8f8" # doesn't seem to override CSS 'pre' styling?
background_color = "#f8f8f8" # doesn't seem to override CSS 'pre' styling?
default_style = ""

styles = {
# No corresponding class for the following:
#Text: "", # class: ''
Whitespace: "underline #f8f8f8", # class: 'w'
Error: "#a40000 border:#ef2929", # class: 'err'
Other: "#000000", # class 'x'

Comment: "italic #8f5902", # class: 'c'
Comment.Preproc: "noitalic", # class: 'cp'

Keyword: "bold #004461", # class: 'k'
Keyword.Constant: "bold #004461", # class: 'kc'
Keyword.Declaration: "bold #004461", # class: 'kd'
Keyword.Namespace: "bold #004461", # class: 'kn'
Keyword.Pseudo: "bold #004461", # class: 'kp'
Keyword.Reserved: "bold #004461", # class: 'kr'
Keyword.Type: "bold #004461", # class: 'kt'

Operator: "#582800", # class: 'o'
Operator.Word: "bold #004461", # class: 'ow' - like keywords

Punctuation: "bold #000000", # class: 'p'

# Text: "", # class: ''
Whitespace: "underline #f8f8f8", # class: 'w'
Error: "#a40000 border:#ef2929", # class: 'err'
Other: "#000000", # class 'x'
Comment: "italic #8f5902", # class: 'c'
Comment.Preproc: "noitalic", # class: 'cp'
Keyword: "bold #004461", # class: 'k'
Keyword.Constant: "bold #004461", # class: 'kc'
Keyword.Declaration: "bold #004461", # class: 'kd'
Keyword.Namespace: "bold #004461", # class: 'kn'
Keyword.Pseudo: "bold #004461", # class: 'kp'
Keyword.Reserved: "bold #004461", # class: 'kr'
Keyword.Type: "bold #004461", # class: 'kt'
Operator: "#582800", # class: 'o'
Operator.Word: "bold #004461", # class: 'ow' - like keywords
Punctuation: "bold #000000", # class: 'p'
# because special names such as Name.Class, Name.Function, etc.
# are not recognized as such later in the parsing, we choose them
# to look the same as ordinary variables.
Name: "#000000", # class: 'n'
Name.Attribute: "#c4a000", # class: 'na' - to be revised
Name.Builtin: "#004461", # class: 'nb'
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
Name.Class: "#000000", # class: 'nc' - to be revised
Name.Constant: "#000000", # class: 'no' - to be revised
Name.Decorator: "#888", # class: 'nd' - to be revised
Name.Entity: "#ce5c00", # class: 'ni'
Name.Exception: "bold #cc0000", # class: 'ne'
Name.Function: "#000000", # class: 'nf'
Name.Property: "#000000", # class: 'py'
Name.Label: "#f57900", # class: 'nl'
Name.Namespace: "#000000", # class: 'nn' - to be revised
Name.Other: "#000000", # class: 'nx'
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
Name.Variable: "#000000", # class: 'nv' - to be revised
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised

Number: "#990000", # class: 'm'

Literal: "#000000", # class: 'l'
Literal.Date: "#000000", # class: 'ld'

String: "#4e9a06", # class: 's'
String.Backtick: "#4e9a06", # class: 'sb'
String.Char: "#4e9a06", # class: 'sc'
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
String.Double: "#4e9a06", # class: 's2'
String.Escape: "#4e9a06", # class: 'se'
String.Heredoc: "#4e9a06", # class: 'sh'
String.Interpol: "#4e9a06", # class: 'si'
String.Other: "#4e9a06", # class: 'sx'
String.Regex: "#4e9a06", # class: 'sr'
String.Single: "#4e9a06", # class: 's1'
String.Symbol: "#4e9a06", # class: 'ss'

Generic: "#000000", # class: 'g'
Generic.Deleted: "#a40000", # class: 'gd'
Generic.Emph: "italic #000000", # class: 'ge'
Generic.Error: "#ef2929", # class: 'gr'
Generic.Heading: "bold #000080", # class: 'gh'
Generic.Inserted: "#00A000", # class: 'gi'
Generic.Output: "#888", # class: 'go'
Generic.Prompt: "#745334", # class: 'gp'
Generic.Strong: "bold #000000", # class: 'gs'
Generic.Subheading: "bold #800080", # class: 'gu'
Generic.Traceback: "bold #a40000", # class: 'gt'
Name: "#000000", # class: 'n'
Name.Attribute: "#c4a000", # class: 'na' - to be revised
Name.Builtin: "#004461", # class: 'nb'
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
Name.Class: "#000000", # class: 'nc' - to be revised
Name.Constant: "#000000", # class: 'no' - to be revised
Name.Decorator: "#888", # class: 'nd' - to be revised
Name.Entity: "#ce5c00", # class: 'ni'
Name.Exception: "bold #cc0000", # class: 'ne'
Name.Function: "#000000", # class: 'nf'
Name.Property: "#000000", # class: 'py'
Name.Label: "#f57900", # class: 'nl'
Name.Namespace: "#000000", # class: 'nn' - to be revised
Name.Other: "#000000", # class: 'nx'
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
Name.Variable: "#000000", # class: 'nv' - to be revised
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
Number: "#990000", # class: 'm'
Literal: "#000000", # class: 'l'
Literal.Date: "#000000", # class: 'ld'
String: "#4e9a06", # class: 's'
String.Backtick: "#4e9a06", # class: 'sb'
String.Char: "#4e9a06", # class: 'sc'
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
String.Double: "#4e9a06", # class: 's2'
String.Escape: "#4e9a06", # class: 'se'
String.Heredoc: "#4e9a06", # class: 'sh'
String.Interpol: "#4e9a06", # class: 'si'
String.Other: "#4e9a06", # class: 'sx'
String.Regex: "#4e9a06", # class: 'sr'
String.Single: "#4e9a06", # class: 's1'
String.Symbol: "#4e9a06", # class: 'ss'
Generic: "#000000", # class: 'g'
Generic.Deleted: "#a40000", # class: 'gd'
Generic.Emph: "italic #000000", # class: 'ge'
Generic.Error: "#ef2929", # class: 'gr'
Generic.Heading: "bold #000080", # class: 'gh'
Generic.Inserted: "#00A000", # class: 'gi'
Generic.Output: "#888", # class: 'go'
Generic.Prompt: "#745334", # class: 'gp'
Generic.Strong: "bold #000000", # class: 'gs'
Generic.Subheading: "bold #800080", # class: 'gu'
Generic.Traceback: "bold #a40000", # class: 'gt'
}
52 changes: 28 additions & 24 deletions alabaster/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,41 @@ stylesheet = alabaster.css
pygments_style = alabaster.support.Alabaster

[options]
logo =
logo_name = false
logo_text_align = left
analytics_id =
badge_branch = master
canonical_url =
codecov_button = false
description =
description_font_style = normal
github_user =
github_repo =
github_button = true
donate_url =
extra_nav_links =
fixed_sidebar = false
github_banner = false
github_type = watch
github_button = true
github_count = true
badge_branch = master
travis_button = false
codecov_button = false
gratipay_user =
github_repo =
github_type = watch
github_user =
gittip_user =
analytics_id =
touch_icon =
canonical_url =
extra_nav_links =
sidebar_includehidden = true
sidebar_collapse = true
gratipay_user =
logo =
logo_name = false
logo_text_align = left
opencollective =
opencollective_button_color = white
page_width = 940px
relbar_border =
show_powered_by = true
show_related = false
show_relbars = false
show_relbar_top =
show_relbar_bottom =
show_relbar_top =
show_relbars = false
sidebar_collapse = true
sidebar_includehidden = true
sidebar_width = 220px
tidelift_url =
touch_icon =
travis_button = false

gray_1 = #444
gray_2 = #EEE
Expand Down Expand Up @@ -115,12 +123,8 @@ code_bg = #ecf0f3
code_text = #222
code_hover = #EEE
code_font_size = 0.9em
code_font_family = 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace
code_font_family = 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace
font_family = Georgia, serif
head_font_family =
caption_font_family = inherit
code_highlight = #FFC
page_width = 940px
sidebar_width = 220px
fixed_sidebar = false
relbar_border =
14 changes: 9 additions & 5 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
sphinx>=1.3,<1.7
invoke>=0.10.1
invocations>=0.6.2
sphinx>=1.3,<1.8
invoke>=1.0.0
invocations>=1.2.0
semantic_version>=2.4,<2.5
wheel==0.24
twine==1.11.0
releases>=1.2.0,<2.0
flake8==2.4.0
releases>=1.5.1,<2.0
flake8==3.6.0

# Install ourselves direct, even when being used on eg RTD. Otherwise we can't
# dogfood our own changes until release to PyPI.
-e .
Loading

0 comments on commit 4fc1b6b

Please sign in to comment.