Compile Twitter bootstrap 3 docs (How to)?

2019-01-17 07:00发布

I'm trying to compile bootstrap 3. I have the repo cloned on my local. I run make in the bootstrap directory.

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?

7条回答
smile是对你的礼貌
2楼-- · 2019-01-17 07:33

To install Jekyll and build: (Note for windows see: https://stackoverflow.com/a/16853614/1596547)

  1. install rubygems (sudo apt-get install rubygems)
  2. (sudo) gem install jekyll
  3. go to the ./docs dir of your bootstrap install (see also: Explore and install Twitter Bootstrap 3)
  4. run jekyll --server from your bootstrap dir
  5. visit http://localhost:9001/ http://localhost:9001/docs.html in your browser

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

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.html See below:

Twitter's Bootstrap 3.0.0 Docs

Now (jul 10 2013) the navbar links seems broken (missing .html) so use http://localhost:9001/javascript.html in stead of http://localhost:9001/javascript. See also: https://github.com/twitter/bootstrap/pull/8443

Using git (jekyll already installed):

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/

UPDATE @lee-whitney suggests to use jekyll serve instead of jekyll --server. The jekyll serve command creates a directory with the html files of the docs. You could serve this files on a (local) webserver. jekyll serve don't start a (jekyll) server. I test this commands on linux (Ubuntu 12.04LTS) with Jekyll 0.12.1

查看更多
成全新的幸福
3楼-- · 2019-01-17 07:35

Here is the complete solution

To install Jekyll, Rouge and build:

if you dont have ruby installed - http://jekyll-windows.juthilo.com/2-jekyll-gem/

  1. from comand promt, cd into your bootstrap folder
  2. run npm install - if you run into problems, do a npm update
  3. if jekyll was not install, run gem install jekyll
  4. then run gem install rouge
  5. run jekyll server from your bootstrap folder
  6. visit http://localhost:9001/
查看更多
4楼-- · 2019-01-17 07:36

Here are the compressed docs, no need to do anything but read. Full downloadable Bootstrap 3 docs.

http://web3canvas.com/item/bootstrap-3-docs/

Enjoy!

查看更多
该账号已被封号
5楼-- · 2019-01-17 07:37

Bootstrap 3.0's docs are built using Jekyll. To view the docs locally, you'll need to install Jekyll to run a local server.

查看更多
女痞
6楼-- · 2019-01-17 07:38

In Windows ( perfectly tested by me not sure of linux ) :

Step1 : Download Bootstrap3 : github.com/twitter/bootstrap/archive/3.0.0-wip.zip
Step2 : Download Ruby : Click Here
Step3 : Download Devkit : Click Here and extract it to some directory.
Step4 : Go to devkit direcory via ruby terminal and execute following commands

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.

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 )

查看更多
我命由我不由天
7楼-- · 2019-01-17 07:45

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.

Steps:

  • gem install jekyll (need to have Ruby, Rubygems installed)
  • git clone --branch gh-pages git://github.com/twitter/bootstrap.git

    (now gh-pages branch holds all docs stuff)

  • cd bootstrap
  • jekyll serve
  • Visit http://127.0.0.1:4000/ default server url
查看更多
登录 后发表回答