twitter-bootstrap 编译 Twitter bootstrap 3 文档(如何)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15318984/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Compile Twitter bootstrap 3 docs (How to)?
提问by Harry
I'm trying to compile bootstrap 3. I have the repo cloned on my local. I run make in the bootstrap directory.
我正在尝试编译引导程序 3。我在本地克隆了 repo。我在引导目录中运行 make 。
aaas-imac:bootstrap aaa$ make
Building Bootstrap...
--------------------------------------------------
Running JSHint on JavaScript... ? Done
Compiling LESS with Recess... ? Done
Prepping documentation assets... ? Done
Compiling and minifying JavaScript... ? Done
--------------------------------------------------
Success!
Thanks for using Bootstrap,
<3 @mdo and @fat
aaas-imac:bootstrap aaa$
I don't see the compiled docs anywhere?
我在任何地方都没有看到编译的文档?
采纳答案by Kisuka
Bootstrap 3.0's docs are built using Jekyll. To view the docs locally, you'll need to install Jekyllto run a local server.
Bootstrap 3.0 的文档是使用Jekyll构建的。要在本地查看文档,您需要安装 Jekyll以运行本地服务器。
回答by Bass Jobsen
To install Jekyll and build: (Note for windows see: https://stackoverflow.com/a/16853614/1596547)
安装 Jekyll 并构建:(Windows 注释请参见:https: //stackoverflow.com/a/16853614/1596547)
- install rubygems (sudo
apt-get install rubygems) - (sudo)
gem install jekyll go to the./docsdir of your bootstrap install (see also: Explore and install Twitter Bootstrap 3)- run
jekyll --serverfrom your bootstrap dir - visit
http://localhost:9001/in your browserhttp://localhost:9001/docs.html
- 安装 rubygems ( sudo
apt-get install rubygems) - (须藤)
gem install jekyll 转到./docs引导安装的目录(另请参阅:探索和安装 Twitter Bootstrap 3)jekyll --server从你的引导目录运行http://localhost:9001/在浏览器中访问http://localhost:9001/docs.html
NB the default port for WEBrick will be 9001. If this port is not avaible an other port will be used: WARN TCPServer Error: Address already in use - bind(2)
INFO WEBrick::HTTPServer#start: pid=30728 port=4000
注意 WEBrick 的默认端口为 9001。如果此端口不可用,将使用其他端口: WARN TCPServer Error: Address already in use - bind(2)
INFO WEBrick::HTTPServer#start: pid=30728 port=4000
When you visit http://localhost:9001/you will find a home screen. The "View docs" button links to /docs/ while the docs are on docs.htmlSee below:
当您访问时,http://localhost:9001/您会发现一个主屏幕。当文档位于 docs.html 时,“查看文档”按钮链接到 /docs/见下文:


Now (jul 10 2013) the navbar links seems broken (missing .html) so use http://localhost:9001/javascript.htmlin stead of http://localhost:9001/javascript. See also: https://github.com/twitter/bootstrap/pull/8443
现在(2013年7月10日)导航栏链接似乎打破(失踪的.html),所以在使用http://localhost:9001/javascript.html中代替http://localhost:9001/javascript。另见:https: //github.com/twitter/bootstrap/pull/8443
Using git(jekyll already installed):
使用 git(已经安装了 jekyll):
git clone --branch 3.0.0-wip git://github.com/twitter/bootstrap.git
cd bootstrap
jekyll --server
visit http://localhost:9001/or http://localhost:4000/
访问http://localhost:9001/或http://localhost:4000/
UPDATE@lee-whitneysuggests to use jekyll serveinstead of jekyll --server. The jekyll servecommand creates a directory with the html files of the docs. You could serve this files on a (local) webserver. jekyll servedon't start a (jekyll) server. I test this commands on linux (Ubuntu 12.04LTS) with Jekyll 0.12.1
UPDATE @李-惠特尼建议使用jekyll serve来代替jekyll --server。该jekyll serve命令使用文档的 html 文件创建一个目录。您可以在(本地)网络服务器上提供这些文件。jekyll serve不要启动(jekyll)服务器。我在 linux (Ubuntu 12.04LTS) 上用 Jekyll 0.12.1 测试这个命令
回答by Abhishek Goel
In Windows ( perfectly tested by me not sure of linux ) :
在 Windows 中(我完全测试过,不确定 linux):
Step1 : Download Bootstrap3 : github.com/twitter/bootstrap/archive/3.0.0-wip.zip
Step2 : Download Ruby : Click Here
Step3 : Download Devkit : Click Hereand extract it to some directory.
Step4 : Go to devkit direcory via ruby terminal and execute following commands
步骤 1:下载 Bootstrap3:github.com/twitter/bootstrap/archive/3.0.0-wip.zip
步骤 2:下载 Ruby:单击此处
步骤 3:下载 Devkit:单击此处并将其解压缩到某个目录。
Step4:通过ruby终端进入devkit目录并执行以下命令
ruby dk.rb init
ruby dk.rb install
gem install jekyll --version '= 0.11.0'
Version step is very crucial as I was not able to compile the docs in latest version of jekyll so I switched to older version.
版本步骤非常关键,因为我无法在最新版本的 jekyll 中编译文档,所以我切换到旧版本。
Step5 : go to the root dir of your bootstrap directory
Step6 : run jekyll --server
Step7 : visit localhost:9001/ or localhost:4000/ in your browser ( one of them will surely work )
步骤5:转到引导程序目录的根目录步骤
6:运行jekyll --server 步骤
7:在浏览器中访问localhost:9001/ 或localhost:4000/(其中之一肯定会工作)
回答by Thoshi B
I tried Abhishek's method and it did work. But not completely. I still got some Fluid errors.
我尝试了 Abhishek 的方法,它确实有效。但不完全。我仍然遇到一些流体错误。
So I did a lot of digging around and found a solution. Compiling Bootstrap 3 is bit more annoying than 2.3.2
所以我做了很多挖掘并找到了解决方案。编译 Bootstrap 3 比 2.3.2 更烦人
Do the following to compile and get it running.
执行以下操作以编译并运行它。
- Get Bootstrap 3 master zip
- Get Ruby 1.9.3
- Get DevKit
- Install Python 2.7 and update the PATH Environment Variable with the python directory
Get Jekyll 1.x as mentioned on the GitHUb page of Bootstrap.
Go to devkit directory via ruby terminal and execute following commandsruby dk.rb init
ruby dk.rb install
gem install jekyllUninstall pygments 0.5.2 and install pygments 0.5.0
gem uninstall pygments.rb --version "=0.5.2"
gem install pygments.rb --version "=0.5.0"Go to the root directory of the extracted bootstrap source in your terminal and run the following
chcp 65001
jekyll serve
- 获取 Bootstrap 3 主 zip
- 获取 Ruby 1.9.3
- 获取开发工具包
- 安装 Python 2.7 并使用 python 目录更新 PATH 环境变量
获取在 Bootstrap 的 GitHUb 页面上提到的 Jekyll 1.x。
通过 ruby 终端进入 devkit 目录并执行以下命令ruby dk.rb init
ruby dk.rb 安装
gem 安装jekyll卸载 pygments 0.5.2 并安装 pygments 0.5.0
gem 卸载 pygments.rb --version "=0.5.2"
gem install pygments.rb --version "=0.5.0"转到终端中提取的引导程序源的根目录并运行以下命令
chcp 65001
jekyll 服务
Now browse to localhost:9001 and there, you should see the docs hosted locally.
现在浏览到 localhost:9001,您应该会看到本地托管的文档。
NOTE: Once compiled, you can access those pages without having to run the jekyll serve command every time. Just open the html pages as you would do with any locally saved web page.
Also, feel free to delete the extracted DevKit files as you won't be using them again for viewing the docs.
注意:编译后,您可以访问这些页面,而无需每次都运行 jekyll serve 命令。只需像打开任何本地保存的网页一样打开 html 页面即可。
此外,请随意删除提取的 DevKit 文件,因为您将不会再次使用它们来查看文档。
回答by Alejandro Casanova
Here are the compressed docs, no need to do anything but read. Full downloadable Bootstrap 3 docs.
这是压缩的文档,除了阅读之外无需做任何事情。完整可下载的 Bootstrap 3 文档。
http://web3canvas.com/item/bootstrap-3-docs/
http://web3canvas.com/item/bootstrap-3-docs/
Enjoy!
享受!
回答by Charl Kruger
Here is the complete solution
这是完整的解决方案
To install Jekyll, Rouge and build:
要安装 Jekyll、Rouge 并构建:
if you dont have ruby installed - http://jekyll-windows.juthilo.com/2-jekyll-gem/
如果你没有安装 ruby - http://jekyll-windows.juthilo.com/2-jekyll-gem/
- from comand promt, cd into your bootstrap folder
- run
npm install- if you run into problems, do anpm update - if jekyll was not install, run
gem install jekyll - then run
gem install rouge - run
jekyll serverfrom your bootstrap folder - visit http://localhost:9001/
- 从命令提示符, cd 进入您的引导程序文件夹
- 运行
npm install- 如果遇到问题,请执行npm update - 如果 jekyll 没有安装,运行
gem install jekyll - 然后运行
gem install rouge jekyll server从引导文件夹运行- 访问http://localhost:9001/
回答by brg
Update: For Bootstrap version 3.3.4
Update: For Bootstrap version 3.3.4
To run the Twitter Bootstrap(v3.3.4)docs locally, I performed following steps and hope it might help others.
为了在Twitter Bootstrap(v3.3.4)本地运行文档,我执行了以下步骤并希望它可以帮助其他人。
Steps:
脚步:
gem install jekyll(need to haveRuby,Rubygemsinstalled)git clone --branch gh-pages git://github.com/twitter/bootstrap.git(now
gh-pagesbranch holds all docs stuff)cd bootstrapjekyll serve- Visit
http://127.0.0.1:4000/default server url
gem install jekyll(需要有Ruby,Rubygems安装)git clone --branch gh-pages git://github.com/twitter/bootstrap.git(现在
gh-pages分支包含所有文档内容)cd bootstrapjekyll serve- 访问
http://127.0.0.1:4000/默认服务器 url

