LoopBack community site, http://loopback.io. This website now includes the LoopBack documentation.
NOTE: The website is served from the gh-pages
branch.
This repository is provided under the MIT License.
To preview the website locally:
-
Install Ruby and Bundler if you don't have them already.
-
cd
to the repository directory and run the following command:
$ cd loopback.io
$ bundle install
Bundler will look in the Gemfile for which gems to install. The github-pages
gem includes the same version of Jekyll and other dependencies as used by GitHub Pages, so that your local setup mirrors GitHub Pages as closely as possible.
Run Jekyll using the following command:
$ npm start
Then, load http://localhost:4001/ on your browser.
NOTE: The docs part will be at http://localhost:4001/doc. It's not yet linked from the main "overview" part of the site, but will be once we launch (RSN).
Jekyll uses a variant of Markdown known as Kramdown.
Jekyll uses the Liquid template engine for templating.
The documentation incorporates README files from a number of LoopBack example repositories. We use the get-readmes utility to fetch the README files directly from GitHub. Here is how to update the READMEs
npm install
(first time/setup only)npm run fetch-readmes
From there, the README markdown files are incorporated into documentation articles using the standard Jekyll "include" syntax as follows (for example):
---
title: "Angular example app"
lang: en
layout: readme
source: loopback-example-angular
keywords: LoopBack
tags:
sidebar: lb2_sidebar
permalink: /doc/en/lb2/Angular-example-app.html
summary: A brief tutorial on creating an Angular client app using the Loopback AngularJS SDK.
---
{% include readmes/loopback-example-angular.md %}
There is an additional npm script
that "lints" the readmes for markdown formatting problems. It is currently "experimental", see #49 for more info.
You can run this script thus:
$ npm run lint-readmes