Skip to content

Commit 42e9c78

Browse files
authored
Update docs (#154)
1 parent a612efe commit 42e9c78

File tree

9 files changed

+281
-32
lines changed

9 files changed

+281
-32
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ docs/build/
55
Manifest.toml
66
.vscode
77
.DS_Store
8+
docs/src/assets/themes

docs/Project.toml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
22
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4+
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
45
PairPlots = "43a3c2be-4208-490b-832a-a21dcd55d7da"
56
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
67
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

docs/make.jl

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
using TableTransforms
1+
using Documenter, TableTransforms
2+
using DocumenterTools: Themes
3+
24
using TransformsBase
3-
using Documenter
5+
6+
Themes.compile(joinpath(@__DIR__,"src/assets/light.scss"), joinpath(@__DIR__,"src/assets/themes/documenter-light.css"))
7+
Themes.compile(joinpath(@__DIR__,"src/assets/dark.scss"), joinpath(@__DIR__,"src/assets/themes/documenter-dark.css"))
48

59
DocMeta.setdocmeta!(TableTransforms, :DocTestSetup, :(using TableTransforms); recursive=true)
610

@@ -15,15 +19,12 @@ makedocs(;
1519
format=Documenter.HTML(;
1620
prettyurls=get(ENV, "CI", "false") == "true",
1721
canonical="https://JuliaML.github.io/TableTransforms.jl",
18-
assets=String[]
22+
assets=["assets/favicon.ico", asset("https://fonts.googleapis.com/css?family=Montserrat|Source+Code+Pro&display=swap", class=:css)]
1923
),
2024
pages=[
2125
"Home" => "index.md",
22-
"Transforms" => [
23-
"transforms/builtin.md",
24-
"transforms/external.md"
25-
],
26-
"related.md"
26+
"Transforms" => "transforms.md",
27+
"Related" => "related.md"
2728
]
2829
)
2930

docs/src/assets/dark.scss

+151
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
@charset "UTF-8";
2+
// The customizable varibles can be found here:
3+
// https://github.com/JuliaDocs/Documenter.jl/tree/master/assets/html/scss
4+
// under documenter/_variables or documenter/_overrides. But some stuff are Bulma defaults
5+
// as well, so you may need to look them up too: https://bulma.io/documentation/customize/variables/
6+
7+
8+
////////////////////////////////////////////////////////////////////////
9+
////////////////////////////////////////////////////////////////////////
10+
// Thse define the template:
11+
$maincolor: rgb(78, 134, 151); // main color of the org theme
12+
$secondcolor: rgb(197, 96, 255); // secondary color that serves as accents
13+
// it is used as-is for links in light theme
14+
$mainwhite: #fff; // color representing white
15+
$mainblack: #202020; // color representing black
16+
$darkbg: #1e1e20; // dark theme main page background
17+
18+
// These commands set up the fonts for the main text and code blocks.
19+
// the fonts must be included into the assets of the `makdocs` command, with e.g.
20+
// format = Documenter.HTML(
21+
// prettyurls = CI,
22+
// assets = [
23+
// "assets/logo.ico",
24+
// asset("https://fonts.googleapis.com/css?family=Montserrat|Source+Code+Pro&display=swap", class=:css),
25+
// ],
26+
// ),
27+
$family-sans-serif: 'Montserrat', sans-serif;
28+
$family-monospace: 'Source Code Pro', monospace;
29+
////////////////////////////////////////////////////////////////////////
30+
////////////////////////////////////////////////////////////////////////
31+
32+
// variables controlling the siderbar's shadow
33+
$shadow-color: #bbb !default;
34+
$shadow-size: 0.2rem !default;
35+
$shadow-blur: 0.4rem !default;
36+
37+
// Two cool helper functions:
38+
$lightness-unit: 8% !default;
39+
// Uses adjust-color to create a darker version of $color
40+
@function darken-color($color, $factor) {
41+
@return adjust-color($color, $lightness: -$factor*$lightness-unit);
42+
}
43+
// Uses adjust-color to create a lighter version of $color
44+
@function lighten-color($color, $factor) {
45+
@return adjust-color($color, $lightness: $factor*$lightness-unit);
46+
}
47+
// This template file overrides some of the Documenter theme variables to customize the theme:
48+
$themename: "documenter-dark"; // CSS file must be called `$(themename).css`
49+
// Instruct documenter/*.scss files that this is a dark theme
50+
$documenter-is-dark-theme: true;
51+
52+
$boldcolor: lighten-color($maincolor, 4.5);
53+
54+
$body-background-color: $darkbg; // main page background
55+
56+
// this is the color the links get, and also when they are hovered
57+
$link: lighten-color($secondcolor, 2);
58+
$link-hover: lighten-color($link, 3);
59+
60+
// Main text color:
61+
$text: darken-color($mainwhite, 0.2);
62+
// Bold text color, also affects headers
63+
$text-strong: $boldcolor;
64+
65+
// Code text color:
66+
$code: #fff;
67+
//$code-background: rgba(0.5,0,0, 0.05);
68+
$codebg: darken-color($maincolor, 3);
69+
$code-background: $codebg; // for inline code
70+
$pre-background: $codebg; // for code blocks
71+
$documenter-docstring-header-background: lighten-color($body-background-color, 0.5);
72+
73+
// Sidebar
74+
$documenter-sidebar-background: darken-color($maincolor, 1.2); //background color for sidebar
75+
$documenter-sidebar-color: $text; //font color for sidebar
76+
$documenter-sidebar-menu-hover-color: $documenter-sidebar-color;
77+
$documenter-sidebar-menu-hover-background: darken-color($documenter-sidebar-background, 1.2);
78+
79+
$documenter-sidebar-menu-active-background: $darkbg;
80+
$documenter-sidebar-menu-active-color: $mainwhite;
81+
$documenter-sidebar-menu-active-hover-background: darken-color($documenter-sidebar-background, 1);
82+
$documenter-sidebar-menu-active-hover-color: $documenter-sidebar-menu-active-color;
83+
// these two change what happens with input boxes (the search box):
84+
$input-hover-border-color: $secondcolor;
85+
$input-focus-border-color: $mainwhite;
86+
87+
$documenter-docstring-shadow: 3px 3px 4px invert($shadow-color);
88+
89+
// Admonition stuff
90+
$admbg: lighten-color($body-background-color, 0.5);
91+
$admonition-background: (
92+
'default': $admbg, 'info': $admbg, 'success': $admbg, 'warning': $admbg,
93+
'danger': $admbg, 'compat': $admbg
94+
);
95+
$admonition-header-background: (
96+
'default': #ba3f1f, 'warning': #a88b17, 'danger': #c7524c,
97+
'success': #42ac68, 'info': #28c);
98+
99+
// All secondary themes have to be nested in a theme--$(themename) class. When Documenter
100+
// switches themes, it applies this class to <html> and then disables the primary
101+
// stylesheet.
102+
@import "documenter/utilities";
103+
@import "documenter/variables";
104+
@import "bulma/utilities/all";
105+
@import "bulma/base/minireset.sass";
106+
@import "bulma/base/helpers.sass";
107+
108+
html.theme--#{$themename} {
109+
@import "bulma/base/generic.sass";
110+
111+
@import "documenter/overrides";
112+
113+
@import "bulma/elements/all";
114+
@import "bulma/form/all";
115+
@import "bulma/components/all";
116+
@import "bulma/grid/all";
117+
@import "bulma/layout/all";
118+
119+
// Additional overrides, if need be
120+
121+
@import "documenter/elements";
122+
@import "documenter/components/all";
123+
@import "documenter/patches";
124+
@import "documenter/layout/all";
125+
126+
@import "documenter/theme_overrides";
127+
128+
// $shadow-color: #202224;
129+
130+
#documenter .docs-sidebar { // This makes sidebar have shadow at all displays
131+
border-right: none;
132+
box-shadow: 1.2*$shadow-size 0rem 1*$shadow-blur invert($shadow-color);
133+
134+
form.docs-search > input { // these controls are for the searchbar
135+
color: $mainwhite;
136+
background-color: darken-color($documenter-sidebar-background, 1);
137+
border-color: darken-color($documenter-sidebar-background, 2);
138+
margin-top: 1.0rem;
139+
margin-bottom: 1.0rem; // adjust the margings between search and other elements
140+
&::placeholder {
141+
color: $mainwhite; // placeholder text color ("Search here...")
142+
}
143+
}
144+
}
145+
// FIXME: Hack to get a proper theme for highlight.js in the dark theme
146+
@import "highlightjs/a11y-dark";
147+
// Also, a11y-dark does not highlight string interpolation properly.
148+
.hljs-subst {
149+
color: #f8f8f2;
150+
}
151+
}

docs/src/assets/light.scss

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
@charset "UTF-8";
2+
// The customizable varibles can be found here:
3+
// https://github.com/JuliaDocs/Documenter.jl/tree/master/assets/html/scss
4+
// under documenter/_variables or documenter/_overrides. But some stuff are Bulma defaults
5+
// as well, so you may need to look them up too: https://bulma.io/documentation/customize/variables/
6+
7+
8+
////////////////////////////////////////////////////////////////////////
9+
////////////////////////////////////////////////////////////////////////
10+
// These define the template:
11+
$maincolor: rgb(78, 134, 151); // main color of the org theme
12+
$secondcolor: rgb(48, 23, 140); // secondary color that serves as accents
13+
// it is used as-is for links in light theme
14+
$mainwhite: #fff; // color representing white
15+
$mainblack: #202020; // color representing black
16+
$darkbg: #1e1e20; // dark theme main page background
17+
18+
// These commands set up the fonts for the main text and code blocks.
19+
// the fonts must be included into the assets of the `makdocs` command, with e.g.
20+
// format = Documenter.HTML(
21+
// prettyurls = CI,
22+
// assets = [
23+
// "assets/logo.ico",
24+
// asset("https://fonts.googleapis.com/css?family=Montserrat|Source+Code+Pro&display=swap", class=:css),
25+
// ],
26+
// ),
27+
$family-sans-serif: 'Montserrat', sans-serif;
28+
$family-monospace: 'Source Code Pro', monospace;
29+
////////////////////////////////////////////////////////////////////////
30+
////////////////////////////////////////////////////////////////////////
31+
32+
// variables controlling the siderbar's shadow
33+
$shadow-color: #bbb !default;
34+
$shadow-size: 0.2rem !default;
35+
$shadow-blur: 0.4rem !default;
36+
37+
// Two cool helper functions:
38+
$lightness-unit: 8% !default;
39+
// Uses adjust-color to create a darker version of $color
40+
@function darken-color($color, $factor) {
41+
@return adjust-color($color, $lightness: -$factor*$lightness-unit);
42+
}
43+
// Uses adjust-color to create a lighter version of $color
44+
@function lighten-color($color, $factor) {
45+
@return adjust-color($color, $lightness: $factor*$lightness-unit);
46+
}
47+
// This template file overrides some of the Documenter theme variables to customize the theme:
48+
$themename: "documenter-light"; // CSS file must be called `$(themename).css`
49+
50+
$boldcolor: $maincolor; // darken-color($maincolor, 1);
51+
52+
$body-background-color: $mainwhite; // main page background
53+
54+
// Sidebar
55+
$documenter-sidebar-background: $maincolor; //background color for sidebar
56+
$documenter-sidebar-color: $mainwhite; //font color all sidebar
57+
$documenter-sidebar-menu-hover-color: $documenter-sidebar-color; // text color
58+
$documenter-sidebar-menu-hover-background: darken-color($documenter-sidebar-background, 1.5);
59+
60+
$documenter-sidebar-menu-active-background: $mainwhite;
61+
$documenter-sidebar-menu-active-color: $mainblack;
62+
$documenter-sidebar-menu-active-hover-background: lighten-color($documenter-sidebar-background, 5.2);
63+
$documenter-sidebar-menu-active-hover-color: $documenter-sidebar-menu-active-color;
64+
65+
// this is the color the links get, and also when they are hovered
66+
$link: $secondcolor;
67+
$link-hover: darken-color($link, 1);
68+
69+
// Main text color:
70+
$text: $mainblack;
71+
// Bold text color, also affects headers
72+
$text-strong: $boldcolor;
73+
74+
// Section headers (markdown ###) text color:
75+
// TODO
76+
77+
// Code text color:
78+
$code: #000000;
79+
//$code-background: rgba(0.5,0,0, 0.05);
80+
$codebg: lighten-color($maincolor, 6.2);
81+
// $codebg: lighten-color($secondcolor, 8);
82+
$code-background: $codebg; // for inline code
83+
$pre-background: $codebg; // for code blocks
84+
$documenter-docstring-header-background: darken-color($body-background-color, 0.4);
85+
86+
// main text font size
87+
$body-font-size: 1.0em; // the default is 1.0
88+
// Sidebar text font size
89+
$documenter-sidebar-size: 1.0em; // the default is 1.0 as well
90+
91+
// these two change what happens with input boxes (the search box):
92+
$input-hover-border-color: $secondcolor;
93+
$input-focus-border-color: $mainwhite;
94+
95+
// Include the original theme which will now use the updated variables.
96+
// This should be the last thing in the SCSS file.
97+
@import "documenter-light";
98+
99+
#documenter .docs-sidebar { // This makes sidebar have shadow at all displays
100+
border-right: none;
101+
box-shadow: 1.2*$shadow-size 0rem 1*$shadow-blur $shadow-color;
102+
103+
form.docs-search > input { // these controls are for the searchbar
104+
color: $mainwhite;
105+
background-color: darken-color($documenter-sidebar-background, 1);
106+
border-color: darken-color($documenter-sidebar-background, 2);
107+
margin-top: 1.0rem;
108+
margin-bottom: 1.0rem; // adjust the margings between search and other elements
109+
&::placeholder {
110+
color: $mainwhite; // placeholder text color ("Search here...")
111+
}
112+
}
113+
}
114+
115+
#documenter .content p { // Justify text in paragraphs
116+
text-align: justify;
117+
}

docs/src/related.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Related packages
1+
# Related
22

33
- [FeatureTransforms.jl](https://github.com/invenia/FeatureTransforms.jl)
44
has transforms, but they are not fully revertible. Some of their

docs/src/transforms/builtin.md docs/src/transforms.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Built-in
1+
# Transforms
22

33
Below is the list of tranforms that are are available in this package.
44

docs/src/transforms/external.md

-21
This file was deleted.

src/transforms/projectionpursuit.jl

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ ProjectionPursuit(tol=1e-4, maxiter=250, deg=5, perc=.95, n=100)
3030
See [https://doi.org/10.2307/2289161](https://doi.org/10.2307/2289161) for
3131
further details.
3232
"""
33-
3433
struct ProjectionPursuit{T} <: StatelessFeatureTransform
3534
tol::T
3635
maxiter::Int

0 commit comments

Comments
 (0)