chore: add prettier config

This commit is contained in:
Yang Libin 2023-05-25 01:35:57 +00:00
parent 0d29af96c1
commit 43d8ff7212
9 changed files with 3115 additions and 222 deletions

View File

@ -1,7 +1,7 @@
module.exports = {
contents: ["summary.md"],
pathToPublic: "pdf/advanced-java.pdf",
pdfOptions: "<options for puppeteer.pdf()>",
contents: ['summary.md'],
pathToPublic: 'pdf/advanced-java.pdf',
pdfOptions: '<options for puppeteer.pdf()>',
removeTemp: true,
emulateMedia: "screen",
emulateMedia: 'screen',
};

1
.gitignore vendored
View File

@ -25,7 +25,6 @@ yarn-debug.log*
yarn-error.log*
dist
package-lock.json
lib
node_modules

3
.prettierignore Normal file
View File

@ -0,0 +1,3 @@
.idea/
.github/
node_modules/

View File

@ -1,30 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="UTF-8" />
<title>互联网 Java 工程师进阶知识完全扫盲 - Doocs 技术社区</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="keywords" content="doc,docs,doocs,documentation,github,gitee,advanced-java,yanglbme" />
<meta name="description" content="互联网 Java 工程师进阶知识完全扫盲,项目维护者:杨立滨" />
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<link rel="stylesheet" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/themes/vue.css" />
<link rel="stylesheet" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-darklight-theme@latest/dist/style.min.css">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png" />
<meta
name="keywords"
content="doc,docs,doocs,documentation,github,gitee,advanced-java,yanglbme"
/>
<meta
name="description"
content="互联网 Java 工程师进阶知识完全扫盲,项目维护者:杨立滨"
/>
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<link
rel="stylesheet"
href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/themes/vue.css"
/>
<link
rel="stylesheet"
href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-darklight-theme@latest/dist/style.min.css"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="images/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="images/favicon-16x16.png"
/>
<style>
.markdown-section code {
font-weight: 400;
}
article>p>img {
article > p > img {
background-color: #f4f4f4;
}
</style>
</head>
</head>
<body>
<body>
<nav>
<ul>
<li>
@ -51,19 +74,19 @@
<div id="app">本系列知识由 Doocs 技术社区总结发布</div>
<script>
window.$docsify = {
name: "advanced-java",
name: 'advanced-java',
maxLevel: 3,
auto2top: true,
coverpage: true,
coverpage: "docs/extra-page/cover.md",
loadSidebar: "summary.md",
coverpage: 'docs/extra-page/cover.md',
loadSidebar: 'summary.md',
alias: {
"/.*/.*/summary": "summary.md",
"/.*/summary.md": "summary.md",
'/.*/.*/summary': 'summary.md',
'/.*/summary.md': 'summary.md',
},
pagination: {
previousText: "上一篇",
nextText: "下一篇",
previousText: '上一篇',
nextText: '下一篇',
crossChapter: true,
crossChapterText: true,
},
@ -72,17 +95,17 @@
ignores: ['/README.md'],
image: {
margin: '0.2em',
isRound: true
}
isRound: true,
},
},
search: {
maxAge: 1800000,
paths: [
"/docs/high-concurrency/",
"/docs/distributed-system/",
"/docs/high-availability/",
"/docs/micro-services/",
"/docs/big-data/",
'/docs/high-concurrency/',
'/docs/distributed-system/',
'/docs/high-availability/',
'/docs/micro-services/',
'/docs/big-data/',
],
depth: 3,
},
@ -99,30 +122,36 @@
},
light: {
highlightColor: '#e96900',
}
},
},
plugins: [
function (hook, vm) {
hook.beforeEach(function (content) {
const en = vm.route.file.indexOf("README_EN") > -1;
const en = vm.route.file.indexOf('README_EN') > -1;
if (/githubusercontent\.com/.test(vm.route.file)) {
url = vm.route.file
.replace("raw.githubusercontent.com", "github.com")
.replace(/\/main/, "/blob/main");
.replace(
'raw.githubusercontent.com',
'github.com',
)
.replace(/\/main/, '/blob/main');
} else {
url =
"https://github.com/doocs/advanced-java/blob/main/" +
'https://github.com/doocs/advanced-java/blob/main/' +
vm.route.file;
}
const github = `[GitHub](${url})`;
const gitee = `[Gitee](${url.replace("github", "gitee")})`;
const gitee = `[Gitee](${url.replace(
'github',
'gitee',
)})`;
const editHtml = en
? `:memo: Edit on ${github} / ${gitee}\n`
: `:memo: ${github} / ${gitee} 编辑\n`;
if (vm.route.path == "/") {
if (vm.route.path == '/') {
return editHtml + content;
}
const subscription = `---
@ -153,8 +182,8 @@
});
hook.afterEach(function (html) {
const currentYear = new Date().getFullYear()
const footer = `<footer><span>Copyright © 2018-${currentYear} <a href="https://github.com/doocs" target="_blank">Doocs</a>. All Rights Reserved.</footer>`
const currentYear = new Date().getFullYear();
const footer = `<footer><span>Copyright © 2018-${currentYear} <a href="https://github.com/doocs" target="_blank">Doocs</a>. All Rights Reserved.</footer>`;
return html + footer;
});
},
@ -169,14 +198,13 @@
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-pagination/dist/docsify-pagination.min.js"></script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-darklight-theme@latest/dist/index.min.js"></script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-contributors@latest/dist/index.min.js"></script>
</body>
</body>
<!--
<!--
cdn.jsdelivr.net
test1.jsdelivr.net
testingcf.jsdelivr.net
fastly.jsdelivr.net
gcore.jsdelivr.net
-->
</html>

2862
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,7 @@
},
"homepage": "https://github.com/doocs/advanced-java#readme",
"devDependencies": {
"docsify-pdf-converter": "^2.0.7"
"docsify-pdf-converter": "^2.0.7",
"prettier": "2.8.8"
}
}