Gitbook website makes vscode configuration (2)

content

download ready

vscode configuration

Extended installation 

 Initial configuration

Profile creation


 

download ready

Course information:

1. Node environment preparation Gitbook operation guide http://demo.kujiajia.xyz/%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87.html

Continue the previous tutorial

Use vscode to configure gitbook (1) change \hu211>node -vv10.23.0C:\Users\hu211>npm -v4.2.0 Update the npm version C:\Users\hu211>npm -g install [email protected]:\Users\hu211>npm -v6. 14.8 Next, download gitbookC:\Users\hu21. https://blog.csdn.net/weixin_50920579/article/details/123179462?spm=1001.2014.3001.5501

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

Could not load file C:\Users\Administrator\AppData\Roaming\npm\tsc.ps1 because scripting is prohibited on this system

 

 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

https://ghproxy.com/https://github.com/iuxt/src/releases/download/2.0/typora-0-11-18.exehttps://ghproxy.com/https://github.com/iuxt/src/releases/download/2.0/typora-0-11-18.exe

 The above is the last version of typora free

The following is the macOS version

https://ghproxy.com/https://github.com/iuxt/src/releases/download/2.0/typora-0-11-18.dmghttps://ghproxy.com/https://github.com/iuxt/src/releases/download/2.0/typora-0-11-18.dmg

 It can be seen that the function is still very strong

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324332608&siteId=291194637