Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit14da142

Browse files
1 parentc98112e commit14da142

File tree

185 files changed

+78016
-69798
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+78016
-69798
lines changed

‎1383/404.html

Lines changed: 445 additions & 401 deletions
Large diffs are not rendered by default.

‎1383/algebra/all-submasks.html

Lines changed: 452 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/balanced-ternary.html

Lines changed: 452 additions & 417 deletions
Large diffs are not rendered by default.

‎1383/algebra/big-integer.html

Lines changed: 451 additions & 412 deletions
Large diffs are not rendered by default.

‎1383/algebra/binary-exp.html

Lines changed: 456 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/bit-manipulation.html

Lines changed: 469 additions & 414 deletions
Large diffs are not rendered by default.

‎1383/algebra/chinese-remainder-theorem.html

Lines changed: 451 additions & 412 deletions
Large diffs are not rendered by default.

‎1383/algebra/continued-fractions.html

Lines changed: 478 additions & 435 deletions
Large diffs are not rendered by default.

‎1383/algebra/discrete-log.html

Lines changed: 456 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/discrete-root.html

Lines changed: 452 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/divisors.html

Lines changed: 452 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/euclid-algorithm.html

Lines changed: 458 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/extended-euclid-algorithm.html

Lines changed: 452 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/factorial-divisors.html

Lines changed: 452 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/factorial-modulo.html

Lines changed: 452 additions & 417 deletions
Large diffs are not rendered by default.

‎1383/algebra/factoring-exp.html

Lines changed: 452 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/factorization.html

Lines changed: 467 additions & 415 deletions
Large diffs are not rendered by default.

‎1383/algebra/fft.html

Lines changed: 469 additions & 414 deletions
Large diffs are not rendered by default.

‎1383/algebra/fibonacci-numbers.html

Lines changed: 452 additions & 417 deletions
Large diffs are not rendered by default.

‎1383/algebra/garners-algorithm.html

Lines changed: 450 additions & 411 deletions
Large diffs are not rendered by default.

‎1383/algebra/gray-code.html

Lines changed: 452 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/linear-diophantine-equation.html

Lines changed: 459 additions & 418 deletions
Large diffs are not rendered by default.

‎1383/algebra/linear_congruence_equation.html

Lines changed: 451 additions & 412 deletions
Large diffs are not rendered by default.

‎1383/algebra/module-inverse.html

Lines changed: 452 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/montgomery_multiplication.html

Lines changed: 451 additions & 412 deletions
Large diffs are not rendered by default.

‎1383/algebra/phi-function.html

Lines changed: 466 additions & 415 deletions
Large diffs are not rendered by default.

‎1383/algebra/polynomial.html

Lines changed: 453 additions & 414 deletions
Large diffs are not rendered by default.

‎1383/algebra/primality_tests.html

Lines changed: 452 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/prime-sieve-linear.html

Lines changed: 452 additions & 413 deletions
Large diffs are not rendered by default.

‎1383/algebra/primitive-root.html

Lines changed: 452 additions & 417 deletions
Large diffs are not rendered by default.

‎1383/algebra/sieve-of-eratosthenes.html

Lines changed: 463 additions & 415 deletions
Large diffs are not rendered by default.

‎1383/assets/javascripts/bundle.83f73b43.min.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎1383/assets/javascripts/bundle.83f73b43.min.js.map

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎1383/assets/javascripts/bundle.c8b220af.min.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎1383/assets/javascripts/bundle.c8b220af.min.js.map

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
(function(){
2+
constcustomDynamicStyle=document.createElement("style");
3+
document.head.appendChild(customDynamicStyle);
4+
5+
constTOGGLE_BUTTON_REFERENCE_ELEMENT_NOT_FOUND_WARNING="[mkdocs-toggle-sidebar-plugin] Reference element for inserting 'toggle_button' not found. This version of the plugin may not be compatible with this version of the theme. Try updating both to the latest version. If that fails, you can open an GitHub issue.";
6+
7+
constloadBool=(name,default_value)=>{
8+
constvalue=localStorage.getItem(`TOGGLE_SIDEBAR_${name}`);
9+
if(value==null){
10+
returndefault_value;
11+
}else{
12+
returnvalue=="1";
13+
}
14+
}
15+
16+
constloadNavigationState=()=>loadBool("NAVIGATION",true);
17+
constloadTocState=()=>loadBool("TOC",true);
18+
19+
constsaveBool=(name,value)=>{
20+
localStorage.setItem(`TOGGLE_SIDEBAR_${name}`,value ?"1" :"0");
21+
}
22+
23+
consttoggleVisibility=(toggleNavigation,toggleTOC)=>{
24+
letnewNavigation=loadNavigationState();
25+
letnewTOC=loadTocState();
26+
27+
if(toggleNavigation){
28+
newNavigation=!newNavigation;
29+
saveBool("NAVIGATION",newNavigation);
30+
}
31+
if(toggleTOC){
32+
newTOC=!newTOC;
33+
saveBool("TOC",newTOC);
34+
}
35+
36+
_setVisibility(newNavigation,newTOC);
37+
}
38+
39+
const_setVisibility=(newNavigation,newTOC)=>{
40+
console.debug(`Setting new visibility: navigation=${newNavigation}, TOC=${newTOC}`);
41+
// combine this into one operation, so that it is more efficient (for toggling both) and easier to code with dynamic CSS generation
42+
customDynamicStyle.innerHTML=setCombinedVisibility(newNavigation,newTOC);
43+
}
44+
45+
// START OF INCLUDE
46+
// This gets replaced with the definitions of:
47+
// - setCombinedVisibility(showNavigation: bool, showTOC: bool) -> string (dynamic CSS)
48+
// - registerKeyboardEventHandler() -> void
49+
constsetCombinedVisibility=(showNavigation,showTOC)=>{
50+
// Hide the button when on mobile (and menu us shown as hamburger menu anyways).
51+
// The exact max-width is taken from the styling of the 'body > header > nav > a' element
52+
53+
letstyle=`
54+
.mkdocs-toggle-sidebar-button {
55+
cursor: pointer;
56+
margin-right: 5px;
57+
margin-left: 1rem;
58+
}
59+
60+
@media screen and (max-width: 76.1875em) {
61+
.mkdocs-toggle-sidebar-button {
62+
display: none;
63+
}
64+
}
65+
`;
66+
// The TOC has a different break point than the navigation.
67+
// It can be seen on the nav.md-nav--secondary:nth-child(1) element (60em)
68+
// If the screen is smaller, it is shown in the navigation section if you click the nested hamburger menu
69+
if(!showTOC){
70+
style+=`
71+
@media screen and (min-width: 60em) {
72+
div.md-sidebar.md-sidebar--secondary {
73+
display: none;
74+
}
75+
}
76+
`;
77+
}
78+
79+
// We always have to show the navigation in mobile view, otherwise the hamburger menu is broken
80+
if(!showNavigation){
81+
style+=`
82+
@media screen and (min-width: 76.1875em) {
83+
div.md-sidebar.md-sidebar--primary {
84+
display: none;
85+
}
86+
}
87+
`;
88+
}
89+
90+
returnstyle;
91+
}
92+
93+
constaddToggleButton=(toggleNavigation,toggleTOC)=>{
94+
consttoggleBtn=createDefaultToggleButton(toggleNavigation,toggleTOC);
95+
toggleBtn.classList.add("md-icon");
96+
97+
consttitleElement=document.querySelector(".md-header__title");
98+
if(titleElement){
99+
titleElement.parentNode.insertBefore(toggleBtn,titleElement.nextSibling);
100+
}else{
101+
console.warn(TOGGLE_BUTTON_REFERENCE_ELEMENT_NOT_FOUND_WARNING);
102+
}
103+
}
104+
105+
constregisterKeyboardEventHandler=()=>{
106+
// Custom key handlers: SEE https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/?h=key+bind#docsjavascriptsshortcutsjs
107+
keyboard$.subscribe(key=>{
108+
if(key.mode==="global"){
109+
if(coreEventListenerLogic(key.type)){
110+
// event handled, stop propagation
111+
key.claim();
112+
}
113+
}
114+
});
115+
}
116+
117+
// END OF INCLUDE
118+
119+
// argument: string, returns true if the key was handled and the event should be marked as already handled
120+
constcoreEventListenerLogic=(keyChar)=>{
121+
if(keyChar==="t"){
122+
toggleVisibility(false,true);
123+
returntrue;
124+
}elseif(keyChar==="m"){
125+
toggleVisibility(true,false);
126+
returntrue;
127+
}elseif(keyChar==="b"){
128+
toggleVisibility(true,true);
129+
returntrue;
130+
}else{
131+
returnfalse;
132+
}
133+
}
134+
135+
window.addEventListener("load",()=>{
136+
console.log("The mkdocs-toggle-sidebar-plugin is installed. It adds the following key bindings:\n T -> toggle table of contents sidebar\n M -> toggle navigation menu sidebar\n B -> toggle both sidebars (TOC and navigation)");
137+
138+
consttoggle_button="all";
139+
if(toggle_button=="none"){
140+
// do nothing
141+
}elseif(toggle_button=="navigation"){
142+
addToggleButton(true,false);
143+
}elseif(toggle_button=="toc"){
144+
addToggleButton(false,true);
145+
}elseif(toggle_button=="all"){
146+
addToggleButton(true,true);
147+
}else{
148+
console.error(`[mkdocs-toggle-sidebar-plugin] Unknown value for toggle_button: '${toggleButtonType}'`);
149+
}
150+
151+
registerKeyboardEventHandler();
152+
customDynamicStyle.innerHTML=setCombinedVisibility(loadNavigationState(),loadTocState());
153+
});
154+
155+
constcreateDefaultToggleButton=(toggleNavigation,toggleTOC)=>{
156+
consttoggleBtn=document.createElement("div");
157+
toggleBtn.className="mkdocs-toggle-sidebar-button";
158+
toggleBtn.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"></path></svg>`;
159+
if(toggleNavigation&&toggleTOC){
160+
toggleBtn.title="Toggle Navigation and Table of Contents";
161+
}elseif(toggleNavigation){
162+
toggleBtn.title="Toggle Navigation";
163+
}elseif(toggleTOC){
164+
toggleBtn.title="Toggle Table of Contents";
165+
}
166+
toggleBtn.addEventListener("click",()=>toggleVisibility(toggleNavigation,toggleTOC));
167+
returntoggleBtn;
168+
};
169+
170+
// Export functions that the user can call to modify the state
171+
window.MkdocsToggleSidebarPlugin={
172+
setNavigationVisibility:(show)=>{
173+
saveBool("NAVIGATION",show);
174+
_setVisibility(show,loadTocState());
175+
},
176+
setTocVisibility:(show)=>{
177+
saveBool("TOC",show);
178+
_setVisibility(loadNavigationState(),show);
179+
},
180+
setAllVisibility:(showNavigation,showTOC)=>{
181+
saveBool("NAVIGATION",showNavigation);
182+
saveBool("TOC",showTOC);
183+
_setVisibility(showNavigation,showTOC);
184+
},
185+
toggleNavigationVisibility:()=>toggleVisibility(true,false),
186+
toggleTocVisibility:()=>toggleVisibility(false,true),
187+
toggleAllVisibility:()=>toggleVisibility(true,true)
188+
};
189+
}());

‎1383/assets/javascripts/workers/search.6ce7567c.min.jsrenamed to‎1383/assets/javascripts/workers/search.f8cc74c7.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎1383/assets/javascripts/workers/search.6ce7567c.min.js.maprenamed to‎1383/assets/javascripts/workers/search.f8cc74c7.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎1383/assets/stylesheets/main.0253249f.min.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎1383/assets/stylesheets/main.0253249f.min.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎1383/assets/stylesheets/main.4af4bdda.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎1383/assets/stylesheets/main.4af4bdda.min.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp