scale website back
We have dedicated https://rust-analyzer.github.io/ now
This commit is contained in:
parent
6df2bcd7ca
commit
9a7c8d4b0f
8 changed files with 4 additions and 113 deletions
|
@ -5,8 +5,6 @@ gen-syntax = "run --package ra_tools --bin ra_tools -- gen-syntax"
|
||||||
# Extracts the tests from
|
# Extracts the tests from
|
||||||
gen-tests = "run --package ra_tools --bin ra_tools -- gen-tests"
|
gen-tests = "run --package ra_tools --bin ra_tools -- gen-tests"
|
||||||
|
|
||||||
build-website = "run --package website-gen"
|
|
||||||
|
|
||||||
# Installs the visual studio code extension
|
# Installs the visual studio code extension
|
||||||
install-ra = "run --package ra_tools --bin ra_tools -- install-ra"
|
install-ra = "run --package ra_tools --bin ra_tools -- install-ra"
|
||||||
install-code = "run --package ra_tools --bin ra_tools -- install-ra" # just an alias
|
install-code = "run --package ra_tools --bin ra_tools -- install-ra" # just an alias
|
||||||
|
|
|
@ -28,7 +28,7 @@ matrix:
|
||||||
language: rust
|
language: rust
|
||||||
rust: stable
|
rust: stable
|
||||||
script:
|
script:
|
||||||
- cargo build-website
|
- cargo doc --all --no-deps
|
||||||
env:
|
env:
|
||||||
- RUSTFLAGS="-D warnings", CARGO_INCREMENTAL=0
|
- RUSTFLAGS="-D warnings", CARGO_INCREMENTAL=0
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ deploy:
|
||||||
skip-cleanup: true
|
skip-cleanup: true
|
||||||
github-token: $DOCS_TOKEN # Set in the settings page of your repository, as a secure variable
|
github-token: $DOCS_TOKEN # Set in the settings page of your repository, as a secure variable
|
||||||
keep-history: false
|
keep-history: false
|
||||||
local-dir: target/website/
|
local-dir: target/doc
|
||||||
on:
|
on:
|
||||||
branch: master
|
branch: master
|
||||||
condition: $DEPLOY_DOCS = 1
|
condition: $DEPLOY_DOCS = 1
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [ "crates/*", "website/website-gen" ]
|
members = [ "crates/*" ]
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
debug = 1 # only line info
|
debug = 1 # only line info
|
||||||
|
|
|
@ -59,7 +59,7 @@ https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frls-2.2E0
|
||||||
## Quick Links
|
## Quick Links
|
||||||
|
|
||||||
* Work List: https://paper.dropbox.com/doc/RLS-2.0-work-list--AZ3BgHKKCtqszbsi3gi6sjchAQ-42vbnxzuKq2lKwW0mkn8Y
|
* Work List: https://paper.dropbox.com/doc/RLS-2.0-work-list--AZ3BgHKKCtqszbsi3gi6sjchAQ-42vbnxzuKq2lKwW0mkn8Y
|
||||||
* API docs: https://rust-analyzer.github.io/rust-analyzer/api-docs/ra_ide_api/
|
* API docs: https://rust-analyzer.github.io/rust-analyzer/ra_ide_api/
|
||||||
* CI: https://travis-ci.org/rust-analyzer/rust-analyzer
|
* CI: https://travis-ci.org/rust-analyzer/rust-analyzer
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html>
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Hello World! Site Title</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<h1>rust-analyzer</h1>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a href="./api-docs/ra_ide_api/">API Docs</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="./wasm-demo/">WASM Demo</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html>
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Hello World! Site Title</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
TBD
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
|
@ -1,9 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "website-gen"
|
|
||||||
version = "0.0.0"
|
|
||||||
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
|
|
||||||
edition = "2018"
|
|
||||||
publish = false
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
walkdir = "2.2.0"
|
|
|
@ -1,64 +0,0 @@
|
||||||
use std::{fs, path::Path, process::Command};
|
|
||||||
|
|
||||||
type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
|
|
||||||
|
|
||||||
/// This tool builds the github-pages website to the `./target/website` folder
|
|
||||||
fn main() {
|
|
||||||
if let Err(err) = try_main() {
|
|
||||||
eprintln!("{}", err);
|
|
||||||
std::process::exit(-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn try_main() -> Result<()> {
|
|
||||||
check_cwd()?;
|
|
||||||
build_scaffold()?;
|
|
||||||
build_docs()?;
|
|
||||||
println!("Finished\n./target/website/index.html");
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn cargo() -> Command {
|
|
||||||
Command::new("cargo")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn check_cwd() -> Result<()> {
|
|
||||||
let toml = std::fs::read_to_string("./Cargo.toml")?;
|
|
||||||
if !toml.contains("[workspace]") {
|
|
||||||
Err("website-gen should be run from the root of workspace")?;
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn build_docs() -> Result<()> {
|
|
||||||
let status = cargo().args(&["doc", "--all", "--no-deps"]).status()?;
|
|
||||||
if !status.success() {
|
|
||||||
Err("cargo doc failed")?;
|
|
||||||
}
|
|
||||||
sync_dir("./target/doc", "./target/website/api-docs")?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn build_scaffold() -> Result<()> {
|
|
||||||
sync_dir("./website/src", "./target/website")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn sync_dir(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> Result<()> {
|
|
||||||
return sync_dir(src.as_ref(), dst.as_ref());
|
|
||||||
|
|
||||||
fn sync_dir(src: &Path, dst: &Path) -> Result<()> {
|
|
||||||
let _ = fs::remove_dir_all(dst);
|
|
||||||
fs::create_dir_all(dst)?;
|
|
||||||
for entry in walkdir::WalkDir::new(src) {
|
|
||||||
let entry = entry?;
|
|
||||||
let src_path = entry.path();
|
|
||||||
let dst_path = dst.join(src_path.strip_prefix(src)?);
|
|
||||||
if src_path.is_dir() {
|
|
||||||
fs::create_dir_all(dst_path)?;
|
|
||||||
} else {
|
|
||||||
fs::copy(src_path, dst_path)?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue