11import process from 'node:process'
22import { getDirname , path } from '@vuepress/utils'
3- import { defineUserConfig , defaultTheme } from 'vuepress'
3+ import { defaultTheme , defineUserConfig } from 'vuepress'
44import { mdEnhancePlugin } from 'vuepress-plugin-md-enhance'
55import { copyCodePlugin } from 'vuepress-plugin-copy-code2'
66import { searchProPlugin } from 'vuepress-plugin-search-pro'
@@ -19,12 +19,12 @@ export default defineUserConfig({
1919 title : 'Python 笔记' ,
2020 description : 'Python 笔记' ,
2121 head : [
22- [ 'link' , { rel : 'icon' , href : `${ BASE_PATH } favicon.svg` } ]
22+ [ 'link' , { rel : 'icon' , href : `${ BASE_PATH } favicon.svg` } ] ,
2323 ] ,
2424 base : BASE_PATH ,
2525 markdown : {
2626 code : {
27- lineNumbers : 10
27+ lineNumbers : 10 ,
2828 } ,
2929 importCode : {
3030 handleImportPath : str => str
@@ -71,7 +71,7 @@ export default defineUserConfig({
7171 card : true ,
7272 codetabs : true ,
7373 include : {
74- resolvePath : file => {
74+ resolvePath : ( file ) => {
7575 if ( file . startsWith ( '@' ) )
7676 return file . replace ( '@' , CURRENT_PATH )
7777 if ( file . startsWith ( '/' ) )
@@ -96,45 +96,54 @@ export default defineUserConfig({
9696 {
9797 matcher : '@def' ,
9898 replacer : ( { tag } ) => {
99- if ( tag === 'em' ) return {
100- tag : 'Badge' ,
101- attrs : { type : 'tip' } ,
102- content : '定义'
99+ if ( tag === 'em' ) {
100+ return {
101+ tag : 'Badge' ,
102+ attrs : { type : 'tip' } ,
103+ content : '定义' ,
104+ }
103105 }
104- }
106+ } ,
105107 } ,
106108 {
107109 matcher : / @ 3 .[ 0 - 9 ] + \+ / ,
108110 replacer : ( { tag, content } ) => {
109- if ( tag === 'em' ) return {
110- tag : 'Badge' ,
111- attrs : { type : 'tip' } ,
112- content : content . replace ( '@' , '' )
111+ if ( tag === 'em' ) {
112+ return {
113+ tag : 'Badge' ,
114+ attrs : { type : 'tip' } ,
115+ content : content . replace ( '@' , '' ) ,
116+ }
113117 }
114- }
118+ } ,
115119 } ,
116120 {
117121 matcher : '@TODO' ,
118122 replacer : ( { tag } ) => {
119- if ( tag === 'em' ) return {
120- tag : 'Badge' ,
121- attrs : { type : 'danger' } ,
122- content : 'TODO'
123+ if ( tag === 'em' ) {
124+ return {
125+ tag : 'Badge' ,
126+ attrs : { type : 'danger' } ,
127+ content : 'TODO' ,
128+ }
123129 }
124- }
125- }
126- ]
130+ } ,
131+ } ,
132+ ] ,
127133 } , false ) ,
128134 searchProPlugin ( { } ) ,
129135 autoCatalogPlugin ( {
130136 orderGetter : ( { title, routeMeta } ) => {
131- if ( routeMeta . order ) return routeMeta . order as number
137+ if ( routeMeta . order )
138+ return routeMeta . order as number
132139 const prefix = title . match ( / ^ \d + . / )
133- if ( prefix ) return parseInt ( prefix [ 0 ] )
140+ if ( prefix )
141+ return Number . parseInt ( prefix [ 0 ] )
134142 const suffix = title . match ( / \d + $ / )
135- if ( suffix ) return parseInt ( suffix [ 0 ] )
143+ if ( suffix )
144+ return Number . parseInt ( suffix [ 0 ] )
136145 return 0
137- }
146+ } ,
138147 } ) ,
139148 copyCodePlugin ( {
140149 showInMobile : true ,
0 commit comments