Skip to content

Commit

Permalink
Docs: Tweak styling of Sphinx site (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobGM committed Sep 4, 2022
1 parent 8fcccae commit eff54c8
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 🦆 Patito
# <center><img height="30px" src="https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/samsung/78/duck_1f986.png"> Patito<center>

<p align="center">
<em>
Expand Down
128 changes: 128 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
:root {
--egg-yolk: #FFAA1E;
--cream: #FFF5E6;
--grapefruit: #FA3C0F;
--aubergine: #280F3C;
--lavender: #A573D2;
}

/* Unvisited links are Grapefruit colored */
a {
color: var(--grapefruit);
}

/* Visited links are Grapefruit colored */
a:visited {
color: var(--grapefruit);
}

/* Links become Aubergine colored on hover */
a:hover {
color: var(--aubergine);
text-decoration: underline;
}


/* Left sidebar in Cream color */
.wy-nav-side {
background-color: var(--cream);
}

/* All links in TOC tree as aubergine */
.wy-menu-vertical li a {
color: var(--aubergine);
}
.wy-menu-vertical li.current a {
color: var(--aubergine);
}

/* The current navigation tree is highlighted in Grapefruit */
.wy-menu-vertical li.current > a {
color: var(--grapefruit);
}

/* The top part of the navbar is highlighted in Egg Yolk */
.wy-side-nav-search {
background-color: var(--egg-yolk);
}

/* Also on mobile */
.wy-nav-top {
background: var(--egg-yolk);
}
.wy-nav-top a {
color: white;
}
.wy-nav-top a:visited {
color: white;
}
.wy-nav-top a:before {
content: "🦆";
}

/* Make link colors on top and bottom Egg Yolk to blend better in. */
.wy-breadcrumbs a {
color: var(--egg-yolk);
}
.wy-breadcrumbs a:visited {
color: var(--egg-yolk);
}
footer a {
color: var(--egg-yolk);
}
footer a:visited {
color: var(--egg-yolk);
}

/* Make the entire sidebar cream, also the part we have expanded */
.wy-menu-vertical li a {
background-color: var(--cream) !important;
/* Remove all borders around list elements in the navbar */
border-right: none !important;
border-bottom: none !important;
border-top: none !important;
}

/* Highlight list elements in sidebar on hover */
.wy-menu-vertical li a:hover {
background-color: white !important;
}

/* Make the logo color aubergine */
.wy-side-nav-search .icon a {
color: var(--grapefruit) !important;
}
.icon a:visited {
color: var(--grapefruit) !important;
}

/* Make the search field in the sidebar Cream colored */
.wy-side-nav-search input[type="text"] {
background-color: var(--cream);
border-color: var(--cream);
}

/* Make class/function signatures Oda colored */
.sig {
background: var(--cream) !important;
color: var(--aubergine) !important;
border-top: 3px solid var(--egg-yolk) !important;
}

/* Make all main headers Egg Yolk colored. */
h1 {
color: var(--egg-yolk);
}

/* Make code example background color Cream. */
.highlight {
background-color: var(--cream);
}

/* Make the icon color text white */
.wy-side-nav-search a {
color: white !important;
}
.wy-side-nav-search a:visited {
color: white !important;
}
2 changes: 1 addition & 1 deletion docs/api/patito/Relation/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ patito.Relation.types

.. currentmodule:: patito

.. autoproperty:: Relation.types
.. autoattribute:: Relation.types
14 changes: 14 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,17 @@
"collapse_navigation": False,
"navigation_depth": 5,
}

# These folders are copied to the documentation's HTML output
html_static_path = ["_static"]

# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
html_css_files = [
"css/custom.css",
]

html_logo = (
"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com"
"/thumbs/120/samsung/78/duck_1f986.png"
)
6 changes: 3 additions & 3 deletions src/patito/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1733,13 +1733,13 @@ def set_model(self, model): # type: ignore[no-untyped-def] # noqa: ANN
)

@property
def types(self) -> dict[str, DuckDBSQLType]:
def types(self) -> Dict[str, DuckDBSQLType]:
"""
Return the SQL types of all the columns of the given relation.
Returns:
A dictionary where the keys are the column names and the values are SQL
types as strings.
dict[str, str]: A dictionary where the keys are the column names and the
values are SQL types as strings.
Examples:
>>> import patito as pt
Expand Down

0 comments on commit eff54c8

Please sign in to comment.