Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client-side color-scheme handling #380

Merged
merged 14 commits into from Oct 2, 2020
108 changes: 107 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Expand Up @@ -56,3 +56,6 @@ rstest = "0.6"
regex = "1.3.9"
pretty_assertions = "0.6"
url = "2.1"

[build-dependencies]
grass = "0.10.3"
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -106,8 +106,11 @@ Sometimes this is just a more practical and quick way than doing things properly
username:sha512:hash (e.g. joe:123,
joe:sha256:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3)
-c, --color-scheme <color-scheme>
Default color scheme [default: Squirrel] [possible values: Archlinux, Zenburn,
Monokai, Squirrel]
Default color scheme [default: squirrel] [possible values: squirrel, archlinux, zenburn, monokai]

-d, --color-scheme-dark <color-scheme-dark>
Default color scheme [default: archlinux] [possible values: squirrel, archlinux, zenburn, monokai]

--index <index_file>
The name of a directory index file to serve, like "index.html"

Expand Down
18 changes: 18 additions & 0 deletions build.rs
@@ -0,0 +1,18 @@
use std::env;
use std::fs;
use std::path::Path;

fn main() {
svenstaro marked this conversation as resolved.
Show resolved Hide resolved
let out_dir = env::var_os("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("style.css");
fs::write(
&dest_path,
grass::from_string(
include_str!("data/style.scss").to_string(),
&grass::Options::default(),
)
.unwrap(),
)
.unwrap();
println!("cargo:rerun-if-changed=data/style.scss");
}