I have compiled the newest angular.js and find out that links in the doc all point to absolute URL angularjs.org/.... I want to be able to read the doc locally.
8 Answers
You have to run a webserver ("python -m SimpleHTTPServer) to properly browse the docs.
As an alternative, you might want to try Dash for offline documentation for many APIs - http://kapeli.com/dash
2 Comments
"Dash" which is mentioned in another answer costs around $20.
For a free solution, check out http://devdocs.io/
Clone the angular source code in order to have access to the docs directory of all released (and yet unreleased) versions locally.
Comments
Local AngularJS API Docs
Here's how I hosted the Angular.JS documentation locally, on my Mac:
- Download the zipped version of the Angular.JS Build, which contains both the builds of AngularJS, as well as documentation and other extras.
- Unzip the Angular.JS docs folder.
- Download and install Node.JS.
- Using Mac Terminal, install the npm package http-server globally so that it can be run from the command line.
$ sudo npm install -g http-server
- cd to the Angular.JS docs folder and start-up
http-server.
$ http-server -a 127.0.0.1
Starting up http-server, serving ./ on: http://127.0.0.1:8080
- Use your browser to view the docs @ http://127.0.0.1:8080/index-production.html
Note:
Using the default served by http-server (http://0.0.0.0:8080) and http://0.0.0.0:8080/index-production.html in Chrome will end up in a google search. Alternatively you can create a bookmark and Chrome will stop searching for it.
4 Comments
http-server serves the content in :8080 in all your computer's interfaces. If you have 5 interfaces, with 5 different IP addresses. Listening on 0.0.0.0:8080 means that you can get the content from any of those 5 addresses.If you want a complete local AngularJS documentation, you can clone the angular/angular.js repository on Github. The nodejs webserver is already included.
You just need to install nodejs dependencies (npm install) and build (grunt package), and you can run the local webserver with grunt webserver.
All the documentation (API, tutorials, etc ...) will be available on your computer at http://localhost:8000/build/docs
Comments
For a free and open source version of Dash, use Zeal to provide offline documentation. It's also very nice when integrated with your editor (Submlime in my case).