Installation via npm Bootstrap v3.3.7

在某一个基于 Bootstrap 的页面上,打开 Run Bootlint 书签,将出现一个弹出窗口,通知您是否检测到问题,如果存在问题,请打开开发人员工具并选择控制台选项卡

1. Install V3 through npm, as shown in Figure 1
npm install bootstrap@3

通过 npm 进行安装 v3
Figure 1

2. Install Grunt to compile css and javascript files. Due to the slow installation speed of npm, finally choose cnpm, as shown in Figure 2
(1) Install grunt-cli in the global environment:npm install -g grunt-cli
(2) Enter the /bootstrap/ root directory, and then execute cnpm install command. npm will read the package.json file and automatically install all the dependencies listed in this file.

安装 Grunt,以 编译 CSS 和 JavaScript 文件,由于 npm 安装速度较慢,最终选择 cnpm
Figure 2

3. Execute Grunt dist command, compile only css and javascript files, as shown in Figure 3

执行 grunt dist 命令,仅编译 CSS 和 JavaScript 文件
Figure 3

4. Install Bootlint, which is the HTML detection tool officially supported by Bootstrap, as shown in Figure 4
cnpm install -g bootlint

安装 Bootlint,其是 Bootstrap 官方所支持的 HTML 检测工具
Figure 4

5. Execute the detection on the command line, as shown in Figure 5
Bootlint index.html

在命令行中执行检测
Figure 5

6. Run Bootlint in the browser, refer to the website: https://github.com/twbs/bootlint , as shown in Figure 6
(1) Create a new bookmark in the browser
(2) Set the name:run bootlint
(3) Set the URL:
javascript:(function(){var s=document.createElement(“script”); s.onload=function() {bootlint.ShowLintReportForCurrentDocument([]);};s.src=”https://maxcdn.bootstrapcdn.com/bootlint/la test/bootlint.min.js”;document.body.appendChild(s)})();

7. On a Bootstrap-based page, open the Run Bootlint bookmark, and a pop-up window will appear to notify you whether the problem is detected. If there is a problem, please open the developer tool and select the console tab, as shown in Figure 7

在某一个基于 Bootstrap 的页面上,打开 Run Bootlint 书签,将出现一个弹出窗口,通知您是否检测到问题,如果存在问题,请打开开发人员工具并选择控制台选项卡
Figure 7

 

 

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.