Add KaTeX to rendered docs. (#832)

This adds a single test formula to the `zebra-chain` docs.  We can remove it
after merging this and running it through CI to confirm that it works.
This commit is contained in:
Henry de Valence 2020-08-05 17:34:30 -07:00 committed by GitHub
parent 867dd0b475
commit a987394782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -43,6 +43,8 @@ jobs:
- name: Build external docs
run: |
cargo doc --no-deps
env:
RUSTDOCFLAGS: "--html-in-header katex-header.html"
- name: Deploy external docs to firebase
uses: w9jds/firebase-action@v1.5.0
@ -55,6 +57,8 @@ jobs:
- name: Build internal docs
run: |
cargo doc --no-deps --document-private-items
env:
RUSTDOCFLAGS: "--html-in-header katex-header.html"
- name: Deploy external docs to firebase
uses: w9jds/firebase-action@v1.5.0

8
katex-header.html Normal file
View File

@ -0,0 +1,8 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
<style>
.katex { font-size: 1em !important; }
pre.rust, .docblock code, .docblock-short code { font-size: 0.85em !important; }
</style>

View File

@ -1,4 +1,6 @@
//! Blockchain-related datastructures for Zebra. 🦓
//!
//! $$a^2 + b^2 = c^2$$
#![doc(html_favicon_url = "https://www.zfnd.org/images/zebra-favicon-128.png")]
#![doc(html_logo_url = "https://www.zfnd.org/images/zebra-icon.png")]