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
Merge pull request #2114 from docsifyjs/modernize-source-code
chore: update miscellaneous parts of the source to reasonably modern language alternatives, remove polyfills, improve some JSDoc comments, remove traces of IE
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
@@ -249,7 +249,7 @@ See https://github.com/lukeed/tinydate#patterns
249
249
window.$docsify= {
250
250
formatUpdated:'{MM}/{DD} {HH}:{mm}',
251
251
252
-
formatUpdated:function(time) {
252
+
formatUpdated(time) {
253
253
// ...
254
254
255
255
return time;
@@ -346,14 +346,14 @@ window.$docsify = {
346
346
markdown: {
347
347
smartypants:true,
348
348
renderer: {
349
-
link:function() {
349
+
link() {
350
350
// ...
351
351
},
352
352
},
353
353
},
354
354
355
355
// function
356
-
markdown:function(marked, renderer) {
356
+
markdown(marked, renderer) {
357
357
// ...
358
358
return marked;
359
359
},
@@ -747,18 +747,17 @@ window.$docsify = {
747
747
'/foo':'# Custom Markdown',
748
748
749
749
// RegEx match w/ synchronous function
750
-
'/bar/(.*)':function(route, matched) {
750
+
'/bar/(.*)'(route, matched) {
751
751
return'# Custom Markdown';
752
752
},
753
753
754
754
// RegEx match w/ asynchronous function
755
-
'/baz/(.*)':function (route, matched, next) {
756
-
// Requires `fetch` polyfill for legacy browsers (https://github.github.io/fetch/)
755
+
'/baz/(.*)'(route, matched, next) {
757
756
fetch('/api/users?id=12345')
758
-
.then(function (response) {
757
+
.then(response=> {
759
758
next('# Custom Markdown');
760
759
})
761
-
.catch(function (err) {
760
+
.catch(err=> {
762
761
// Handle error...
763
762
});
764
763
},
@@ -772,7 +771,7 @@ Other than strings, route functions can return a falsy value (`null` \ `undefine
772
771
window.$docsify= {
773
772
routes: {
774
773
// accepts everything other than dogs (synchronous)
775
-
'/pets/(.+)':function(route, matched) {
774
+
'/pets/(.+)'(route, matched) {
776
775
if (matched[0] ==='dogs') {
777
776
returnnull;
778
777
} else {
@@ -781,7 +780,7 @@ window.$docsify = {
781
780
}
782
781
783
782
// accepts everything other than cats (asynchronous)
784
-
'/pets/(.*)':function(route, matched, next) {
783
+
'/pets/(.*)'(route, matched, next) {
785
784
if (matched[0] ==='cats') {
786
785
next();
787
786
} else {
@@ -799,12 +798,12 @@ Finally, if you have a specific path that has a real markdown file (and therefor
799
798
window.$docsify= {
800
799
routes: {
801
800
// if you look up /pets/cats, docsify will skip all routes and look for "pets/cats.md"
802
-
'/pets/cats':function(route, matched) {
801
+
'/pets/cats'(route, matched) {
803
802
returnfalse;
804
803
}
805
804
806
805
// but any other pet should generate dynamic content right here
807
-
'/pets/(.+)':function(route, matched) {
806
+
'/pets/(.+)'(route, matched) {
808
807
constpet= matched[0];
809
808
return`your pet is ${pet} (but not a cat)`;
810
809
}
@@ -835,11 +834,19 @@ If you have a link to the homepage in the sidebar and want it to be shown as act
835
834
836
835
For more details, see [#1131](https://github.com/docsifyjs/docsify/issues/1131).
837
836
838
-
## themeColor
837
+
## themeColor (_deprecated_)
838
+
839
+
> **Warning** Deprecated. Use the CSS var `--theme-color` in your `<style>` sheet. Example:
840
+
>
841
+
> <style>
842
+
>:root {
843
+
> --theme-color: deeppink;
844
+
> }
845
+
> </style>
839
846
840
847
- Type: `String`
841
848
842
-
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