You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: update miscellaneous parts of the source to reasonably modern language alternatives, remove polyfills, improve some JSDoc comments, remove traces of IE
BREAKING: In a minority of cases syntax updates may break apps running in very old browsers (such as Internet Explorer), or apps that build Docsify in a custom way with old build tools. To upgrade, build Docsify for older browsers in a custom way, or update existing build tools to handle newer syntax.
DEPRECATED: `$docsify.themeColor` is deprecated and will be eventually removed, use a `--theme-color` CSS variable in your style sheet.
Copy file name to clipboardExpand all lines: docs/configuration.md
+21-14Lines changed: 21 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -244,7 +244,7 @@ See https://github.com/lukeed/tinydate#patterns
244
244
window.$docsify= {
245
245
formatUpdated:'{MM}/{DD} {HH}:{mm}',
246
246
247
-
formatUpdated:function(time) {
247
+
formatUpdated(time) {
248
248
// ...
249
249
250
250
return time;
@@ -341,14 +341,14 @@ window.$docsify = {
341
341
markdown: {
342
342
smartypants:true,
343
343
renderer: {
344
-
link:function() {
344
+
link() {
345
345
// ...
346
346
},
347
347
},
348
348
},
349
349
350
350
// function
351
-
markdown:function(marked, renderer) {
351
+
markdown(marked, renderer) {
352
352
// ...
353
353
return marked;
354
354
},
@@ -689,18 +689,17 @@ window.$docsify = {
689
689
'/foo':'# Custom Markdown',
690
690
691
691
// RegEx match w/ synchronous function
692
-
'/bar/(.*)':function(route, matched) {
692
+
'/bar/(.*)'(route, matched) {
693
693
return'# Custom Markdown';
694
694
},
695
695
696
696
// RegEx match w/ asynchronous function
697
-
'/baz/(.*)':function (route, matched, next) {
698
-
// Requires `fetch` polyfill for legacy browsers (https://github.github.io/fetch/)
697
+
'/baz/(.*)'(route, matched, next) {
699
698
fetch('/api/users?id=12345')
700
-
.then(function (response) {
699
+
.then(response=> {
701
700
next('# Custom Markdown');
702
701
})
703
-
.catch(function (err) {
702
+
.catch(err=> {
704
703
// Handle error...
705
704
});
706
705
},
@@ -714,7 +713,7 @@ Other than strings, route functions can return a falsy value (`null` \ `undefine
714
713
window.$docsify= {
715
714
routes: {
716
715
// accepts everything other than dogs (synchronous)
717
-
'/pets/(.+)':function(route, matched) {
716
+
'/pets/(.+)'(route, matched) {
718
717
if (matched[0] ==='dogs') {
719
718
returnnull;
720
719
} else {
@@ -723,7 +722,7 @@ window.$docsify = {
723
722
}
724
723
725
724
// accepts everything other than cats (asynchronous)
726
-
'/pets/(.*)':function(route, matched, next) {
725
+
'/pets/(.*)'(route, matched, next) {
727
726
if (matched[0] ==='cats') {
728
727
next();
729
728
} else {
@@ -741,12 +740,12 @@ Finally, if you have a specific path that has a real markdown file (and therefor
741
740
window.$docsify= {
742
741
routes: {
743
742
// if you look up /pets/cats, docsify will skip all routes and look for "pets/cats.md"
744
-
'/pets/cats':function(route, matched) {
743
+
'/pets/cats'(route, matched) {
745
744
returnfalse;
746
745
}
747
746
748
747
// but any other pet should generate dynamic content right here
749
-
'/pets/(.+)':function(route, matched) {
748
+
'/pets/(.+)'(route, matched) {
750
749
constpet= matched[0];
751
750
return`your pet is ${pet} (but not a cat)`;
752
751
}
@@ -777,11 +776,19 @@ If you have a link to the homepage in the sidebar and want it to be shown as act
777
776
778
777
For more details, see [#1131](https://github.com/docsifyjs/docsify/issues/1131).
779
778
780
-
## themeColor
779
+
## themeColor (_deprecated_)
780
+
781
+
> **Warning** Deprecated. Use the CSS var `--theme-color` in your `<style>` sheet. Example:
782
+
>
783
+
> <style>
784
+
>:root {
785
+
> --theme-color: deeppink;
786
+
> }
787
+
> </style>
781
788
782
789
- Type: `String`
783
790
784
-
Customize the theme color. Use [CSS3 variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables) feature and polyfill in older browsers.
0 commit comments