Root urls for everyone!

Also refator to only list all the triples once
This commit is contained in:
Alex Crichton 2015-09-17 10:05:36 -07:00
parent dab1ead5fa
commit 730a17fd1c
2 changed files with 44 additions and 22 deletions

View File

@ -7,29 +7,17 @@ mkdir -p target/doc
cp ci/landing-page-head.html target/doc/index.html
doc() {
local _target=$1
echo documenting $_target
rustdoc -o target/doc/$_target --target $_target src/lib.rs --cfg dox \
TARGETS=`grep html_root_url src/lib.rs | sed 's/.*".*\/\(.*\)"/\1/'`
for target in $TARGETS; do
echo documenting $target
rustdoc -o target/doc/$target --target $target src/lib.rs --cfg dox \
--crate-name libc
echo "<li><a href="$_target/libc/index.html">$_target</a></li>" \
echo "<li><a href="$target/libc/index.html">$target</a></li>" \
>> target/doc/index.html
}
doc x86_64-unknown-linux-gnu
doc i686-unknown-linux-gnu
doc x86_64-apple-darwin
doc i686-apple-darwin
doc x86_64-pc-windows-gnu
doc x86_64-pc-windows-msvc
doc i686-pc-windows-gnu
doc i686-pc-windows-msvc
doc arm-unknown-linux-gnueabihf
doc mips-unknown-linux-gnu
doc arm-linux-androideabi
doc x86_64-unknown-linux-musl
done
cat ci/landing-page-footer.html >> target/doc/index.html

View File

@ -14,8 +14,42 @@
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico")]
#![cfg_attr(all(target_os = "linux", target_arch = "x86_64"),
doc(html_root_url = "http://alexcrichton.com/libc/x86_64-unknown-linux-gnu"))]
#![cfg_attr(all(target_os = "linux", target_arch = "x86_64"), doc(
html_root_url = "http://alexcrichton.com/libc/x86_64-unknown-linux-gnu"
))]
#![cfg_attr(all(target_os = "linux", target_arch = "x86"), doc(
html_root_url = "http://alexcrichton.com/libc/i686-unknown-linux-gnu"
))]
#![cfg_attr(all(target_os = "linux", target_arch = "arm"), doc(
html_root_url = "http://alexcrichton.com/libc/arm-unknown-linux-gnueabihf"
))]
#![cfg_attr(all(target_os = "linux", target_arch = "mips"), doc(
html_root_url = "http://alexcrichton.com/libc/mips-unknown-linux-gnu"
))]
#![cfg_attr(all(target_os = "linux", target_env = "musl"), doc(
html_root_url = "http://alexcrichton.com/libc/x86_64-unknown-linux-musl"
))]
#![cfg_attr(all(target_os = "macos", target_arch = "x86_64"), doc(
html_root_url = "http://alexcrichton.com/libc/x86_64-apple-darwin"
))]
#![cfg_attr(all(target_os = "macos", target_arch = "x86"), doc(
html_root_url = "http://alexcrichton.com/libc/i686-apple-darwin"
))]
#![cfg_attr(all(windows, target_arch = "x86_64", target_env = "gnu"), doc(
html_root_url = "http://alexcrichton.com/libc/x86_64-pc-windows-gnu"
))]
#![cfg_attr(all(windows, target_arch = "i686", target_env = "gnu"), doc(
html_root_url = "http://alexcrichton.com/libc/i686-pc-windows-gnu"
))]
#![cfg_attr(all(windows, target_arch = "x86_64", target_env = "msvc"), doc(
html_root_url = "http://alexcrichton.com/libc/x86_64-pc-windows-msvc"
))]
#![cfg_attr(all(windows, target_arch = "i686", target_env = "msvc"), doc(
html_root_url = "http://alexcrichton.com/libc/i686-pc-windows-msvc"
))]
#![cfg_attr(all(target_os = "android"), doc(
html_root_url = "http://alexcrichton.com/libc/arm-linux-androideabi"
))]
#[macro_use] mod macros;
mod dox;