Skip to content

Commit

Permalink
Merge pull request #680 from mozilla/git-link
Browse files Browse the repository at this point in the history
Add "open on github" link to docs
  • Loading branch information
badboy authored Feb 4, 2020
2 parents 5827154 + 72f1612 commit 98f3dd9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
18 changes: 16 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,23 @@ jobs:
- run:
name: Install mdbook
command: |
wget https://github.com/rust-lang-nursery/mdBook/releases/download/v0.3.0/mdbook-v0.3.0-x86_64-unknown-linux-gnu.tar.gz
tar -xvf mdbook-v0.3.0-x86_64-unknown-linux-gnu.tar.gz
MDBOOK_VERSION=v0.3.5
MDBOOK="mdbook-${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
MDBOOK_SHA256=e03cc253650fa0b4780fab4d75df64c48d35d48f452fcf61c5ec0ae652f9bd8e
curl -sfSL --retry 5 --retry-delay 10 -O "https://github.com/rust-lang-nursery/mdBook/releases/download/${MDBOOK_VERSION}/${MDBOOK}"
echo "${MDBOOK_SHA256} *${MDBOOK}" | shasum -a 256 -c -
tar -xvf "${MDBOOK}"
mv mdbook /usr/local/cargo/bin/mdbook
- run:
name: Install mdbook-open-on-gh
command: |
OPENON_VERSION=1.0.1
OPENON="mdbook-open-on-gh-${OPENON_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
OPENON_SHA256=ca5901ef58844f5a6e6b84aa31d99fc0bab1dd7f7d6913e1d8399a6a2dc80955
curl -sfSL --retry 5 --retry-delay 10 -O "https://github.com/badboy/mdbook-open-on-gh/releases/download/${OPENON_VERSION}/${OPENON}"
echo "${OPENON_SHA256} *${OPENON}" | shasum -a 256 -c -
tar -xvf "${OPENON}"
mv mdbook-open-on-gh /usr/local/cargo/bin/mdbook-open-on-gh
- run:
name: Build Rust documentation
command: bin/build-rust-docs.sh
Expand Down
8 changes: 6 additions & 2 deletions docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ build-dir = "book"
create-missing = false

[output.html]
additional-css = ["tabs.css"]
additional-js = ["tabs.js"]
additional-css = ["glean.css"]
additional-js = ["tabs.js"]
git-repository-url = "https://github.com/mozilla/glean"

[preprocessor.open-on-gh]
command = "mdbook-open-on-gh"
8 changes: 8 additions & 0 deletions docs/tabs.css → docs/glean.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@
border-top: none;
padding: 6px 12px;
}

/* The footer with the "Open on GitHub" link */
footer#open-on-gh {
font-size: 0.8em;
text-align: center;
border-top: 1px solid black;
padding: 5px 0;
}

0 comments on commit 98f3dd9

Please sign in to comment.