Merge pull request #4383 from roc-lang/docs-updates

"Different names" tip in builtin docs
This commit is contained in:
Richard Feldman 2022-10-24 11:39:29 -07:00 committed by GitHub
commit bdc565762b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 187 additions and 8 deletions

View file

@ -138,8 +138,7 @@ pub fn generate_docs_html(filenames: Vec<PathBuf>) {
}
fn sidebar_link_url(module: &ModuleDocumentation) -> String {
let url = format!("{}{}/", base_url(), module.name.as_str());
url
format!("{}{}", base_url(), module.name.as_str())
}
fn page_title(package: &Documentation, module: &ModuleDocumentation) -> String {

View file

@ -15,7 +15,7 @@
<body>
<nav id="sidebar-nav">
<input id="module-search" aria-labelledby="search-link" type="text" placeholder="Search" />
<label for="module-search" id="search-link"><span id="search-link-text">Search</span> <span id="search-link-hint">(shortcut: S)</span></label>
<label for="module-search" id="search-link"><span id="search-link-text">Search</span> <span id="search-link-hint">(press <span id="search-shortcut-key">s</span>)</span></label>
<div class="module-links">
<!-- Module links -->
</div>
@ -24,7 +24,7 @@
<!-- if the window gets big, this extends the purple bar on the top header to the left edge of the window -->
</div>
<header class="top-header">
<nav class="pkg-and-logo">
<div class="pkg-and-logo">
<a class="logo" href="/" aria-labelledby="logo-link">
<svg viewBox="0 -6 51 58" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="logo-link" role="img">
<title id="logo-link">Return to Roc packages</title>
@ -32,7 +32,7 @@
</svg>
</a>
<!-- Package Name and Version -->
</nav>
</div>
<div class="top-header-triangle">
<!-- if the window gets big, this extends the purple bar on the top header to the left edge of the window -->
</div>

View file

@ -451,9 +451,17 @@ pre {
}
#search-link-hint {
font-style: italic;
margin-left: 1em;
opacity: 0.7;
opacity: 0.6;
}
#search-shortcut-key {
font-family: monospace;
border: 1px solid #666;
padding: 1px 3px 3px;
font-style: normal;
border-radius: 4px;
line-height: 15px;
}
@media (prefers-color-scheme: dark) {
@ -480,6 +488,10 @@ pre {
}
@media only screen and (max-device-width: 480px) and (orientation: portrait) {
#search-link-hint {
display: none;
}
.search-button {
display: block; /* This is only visible in mobile. */
}