Code Review Changes

This commit is contained in:
itmuckel 2023-03-15 19:14:53 +01:00
parent cc70413e05
commit 97f68974a9
No known key found for this signature in database
GPG key ID: B31FDD4A4136F0E5
3 changed files with 21 additions and 4 deletions

View file

@ -18,6 +18,8 @@ use std::path::{Path, PathBuf};
const BUILD_DIR: &str = "./generated-docs";
const LINK_SVG: &str = include_str!("./static/link.svg");
pub fn generate_docs_html(root_file: PathBuf) {
let build_dir = Path::new(BUILD_DIR);
let loaded_module = load_module_for_docs(root_file);
@ -154,7 +156,7 @@ fn render_module_documentation(
let href = format!("#{name}");
let mut content = String::new();
push_html(&mut content, "a", vec![("href", href.as_str())], "🔗");
push_html(&mut content, "a", vec![("href", href.as_str())], LINK_SVG);
push_html(&mut content, "strong", vec![], name);
for type_var in &doc_def.type_vars {

View file

@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" fill="currentColor"><!--!
Font Awesome Free 6.3.0 by @fontawesome - https://fontawesome.com License -
https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
Copyright 2023 Fonticons, Inc. -->
<path
d="M562.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L405.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C189.5 251.2 196 330 246 380c56.5 56.5 148 56.5 204.5 0L562.8 267.7zM43.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C57 372 57 321 88.5 289.5L200.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C416.5 260.8 410 182 360 132c-56.5-56.5-148-56.5-204.5 0L43.2 244.3z" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -83,10 +83,13 @@ table tr td {
.entry-name a {
visibility: hidden;
font-size: 12px;
margin-left: -7px;
display: inline-block;
width: 18px;
height: 14px;
margin-left: -8px;
margin-right: 4px;
vertical-align: top;
user-select: none;
color: var(--violet);
}
.entry-name:hover a {
@ -94,6 +97,11 @@ table tr td {
text-decoration: none;
}
.entry-name:not(:hover) a {
visibility: hidden;
transition: visibility 2s;
}
.pkg-full-name a {
padding-top: 12px;
padding-bottom: 16px;