-
-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docs] Fix inline code blocks and misc tweaks. (#2878)
* Fix code blocks and list items having overlap if they contain code blocks. * Fixes for interaction framework intro guide. * Add NuGet icon to top navbar. * tweak action triggers * Fix mobile navbar links. * Add relatively ugly hack to improve toc filter functionality. --------- Co-authored-by: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com>
- Loading branch information
1 parent
4efe3be
commit 3331614
Showing
4 changed files
with
83 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ on: | |
- '*' | ||
paths: | ||
- 'docs/**' | ||
branches: | ||
- 'dev' | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,69 @@ | ||
export default { | ||
iconLinks: [ | ||
export default | ||
{ | ||
iconLinks: | ||
[ | ||
{ | ||
icon: 'github', | ||
href: 'https://github.com/discord-net/Discord.Net', | ||
title: 'GitHub' | ||
}, | ||
{ | ||
icon: 'box-seam-fill', | ||
href: 'https://www.nuget.org/packages/Discord.Net/', | ||
title: 'NuGet' | ||
}, | ||
{ | ||
icon: 'discord', | ||
href: 'https://discord.gg/dnet', | ||
title: 'Discord' | ||
} | ||
] | ||
], | ||
start: () => | ||
{ | ||
// Ugly hack to improve toc filter. | ||
let target = document.getElementById("toc"); | ||
let config = { attributes: false, childList: true, subtree: true }; | ||
let observer = new MutationObserver((list) => | ||
{ | ||
for(const mutation of list) | ||
{ | ||
if(mutation.type === "childList" && mutation.target == target) | ||
{ | ||
let filter = target.getElementsByClassName("form-control")[0]; | ||
|
||
let filterValue = localStorage.getItem("tocFilter"); | ||
let scrollValue = localStorage.getItem("tocScroll"); | ||
|
||
if(filterValue && filterValue !== "") | ||
{ | ||
filter.value = filterValue; | ||
|
||
let inputEvent = new Event("input"); | ||
filter.dispatchEvent(inputEvent); | ||
} | ||
|
||
// Add event to store scroll pos. | ||
let tocDiv = target.getElementsByClassName("flex-fill")[0]; | ||
|
||
tocDiv.addEventListener("scroll", (event) => | ||
{ | ||
if (event.target.scrollTop >= 0) | ||
{ | ||
localStorage.setItem("tocScroll", event.target.scrollTop); | ||
} | ||
}); | ||
|
||
if(scrollValue && scrollValue >= 0) | ||
{ | ||
tocDiv.scroll(0, scrollValue); | ||
} | ||
|
||
observer.disconnect(); | ||
break; | ||
} | ||
} | ||
}); | ||
|
||
observer.observe(target, config); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters