-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
73 changed files
with
512 additions
and
586 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
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
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,17 +1,17 @@ | ||
import fs from 'fs'; | ||
import { relative } from './util.js'; | ||
var read = fs.readFileSync; | ||
var write = fs.writeFileSync; | ||
const read = fs.readFileSync; | ||
const write = fs.writeFileSync; | ||
const pkgPath = relative(import.meta, '..', 'package.json'); | ||
const pkg = JSON.parse(read(pkgPath).toString()); | ||
var version = process.env.VERSION || pkg.version; | ||
const version = process.env.VERSION || pkg.version; | ||
|
||
var file = relative(import.meta, '..', 'docs', '_coverpage.md'); | ||
var cover = read(file, 'utf8').toString(); | ||
const file = relative(import.meta, '..', 'docs', '_coverpage.md'); | ||
let cover = read(file, 'utf8').toString(); | ||
|
||
console.log('Replace version number in cover page...'); | ||
cover = cover.replace( | ||
/<small>(\S+)?<\/small>/g, | ||
'<small>' + version + '</small>' | ||
/* html */ `<small>${version}</small>` | ||
); | ||
write(file, cover); |
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
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,16 +1,16 @@ | ||
import fetch from 'fetch' | ||
import fetch from 'fetch'; | ||
|
||
const URL = 'https://example.com' | ||
const PORT = 8080 | ||
const URL = 'https://example.com'; | ||
const PORT = 8080; | ||
|
||
/// [demo] | ||
const result = fetch(`${URL}:${PORT}`) | ||
.then(function (response) { | ||
return response.json() | ||
}) | ||
.then(function (myJson) { | ||
console.log(JSON.stringify(myJson)) | ||
.then(response => { | ||
return response.json(); | ||
}) | ||
.then(myJson => { | ||
console.log(JSON.stringify(myJson)); | ||
}); | ||
/// [demo] | ||
|
||
result.then(console.log).catch(console.error) | ||
result.then(console.log).catch(console.error); |
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
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
Oops, something went wrong.
7da3521
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docsify-preview – ./
docsify-preview-docsifyjs.vercel.app
docsify-preview.vercel.app
docsify-preview-git-develop-docsifyjs.vercel.app
www.docsifyjs.org
docsifyjs.org