content
download ready
Course information:
Continue the previous tutorial
Now make some changes to the website
Drag readme.md into the subline (other editors can also)
just enter something
Then ctrl+s save
Then ctrl interrupt the cmd process
Again
gitbook serve
D:\giitbook_project>gitbook serve
Live reload server started on port: 35729
Press CTRL+C to quit ...
info: 7 plugins are installed
info: loading plugin "livereload"... OK
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 1 pages
info: found 0 asset files
info: >> generation finished with success in 0.5s !
Starting server ...
Serving book on http://localhost:4000
This creates a static web page
gitbook can also generate html (in the book folder of the corresponding subdirectory)
Then download vscode
Download Visual Studio Code - Mac, Linux, Windowshttps://code.visualstudio.com/Download
Drag the project file directly into vscode to open it
vscode configuration
Extended installation
Keep clicking OK until the extension shown below appears and then install it.
Install this extension
At this point, you can operate on the markdown file
Initial configuration
Type npm init in the vscode terminal
Then keep blanking until the end of yes
PS D:\前端\vswebdesgin> npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help init` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (vswebdesgin)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to D:\前端\vswebdesgin\package.json:
{
"name": "vswebdesgin",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this OK? (yes)
PS D:\前端\vswebdesgin>
After success, the following json file appears
change file code
{
"name": "vswebdesgin",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"serve": "gitbook serve",
"build": "gitbook build"
},
"author": "",
"license": "ISC"
}
Runtime error resolution reference
then run successfully
PS D:\前端\vswebdesgin> gitbook serve
Live reload server started on port: 35729
Press CTRL+C to quit ...
info: 7 plugins are installed
info: loading plugin "livereload"... OK
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 1 pages
info: found 1 asset files
info: >> generation finished with success in 0.6s !
Starting server ...
Serving book on http://localhost:4000
PS D:\前端\vswebdesgin> npm run serve
npm ERR! missing script: serve
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\hu211\AppData\Roaming\npm-cache\_logs\2022-02-28T12_34_12_988Z-debug.log
PS D:\前端\vswebdesgin> npm run serve
The reason for this error is because package.json is not saved
ctrl+s to save and run
PS D:\前端\vswebdesgin> npm run serve
> [email protected] serve D:\前端\vswebdesgin
> gitbook serve
Live reload server started on port: 35729
Press CTRL+C to quit ...
info: 7 plugins are installed
info: loading plugin "livereload"... OK
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 1 asset files
info: >> generation finished with success in 2.3s !
Starting server ...
Serving book on http://localhost:4000
Profile creation
create, bookignore
The function of this file is to prevent some files in the parent directory from being packaged into the output of the book.
gitbook is configured via book.js so we are going to create this
Write the following configuration code in this file
module.exports = {
//书籍信息
titile:"书名",
description:"描述",
isbn:"图书编号",
author:"作者",
lang:"zh-cn",
//插件列表
"plugins": [],
//插件全局配置
"pluginsConfig":{},
//模板变量
variables:{
//自定义
},
};
The following is the original author's code address
book.js Truffle/electronic-book-demo - Gitee.com
Worship the big man again
The following are editors that require a markdown syntax
The above is the last version of typora free
The following is the macOS version
It can be seen that the function is still very strong