As described in Including READMEs, the LoopBack documentation includes README markdown files from a number of repositories, including examples, connectors, and components. This enables single-sourcing the information in the README so you’ll see the same information in the documentation (this site), GitHub, and npm (for repositories published to npm).
readme layout to incorporate the README file into the documentation;
--- title: "MongoDB Connector Tutorial" lang: en layout: readme source: loopback-example-database keywords: LoopBack tags: example_app sidebar: lb2_sidebar permalink: /doc/en/lb2/Connecting-to-MongoDB.html summary: A brief tutorial on using the LoopBack MongoDB connector. ---
readme layout automatically includes the markdown file specified
source property. You must specify the
source property and a file with that name must exist in the
In the example above, there must be a
layout readme also links to the repository containing the original README file.
By default, it links to the master branch. To link to a different branch,
page.branch property; for example:
... source: loopback-example-database branch: mysql ...
The README files fetched from branches are named differently to distinguis them. Thus, the above example includes the readme file named
_includes/readmes/loopback-example-database-mysql and links to the
mysql branch in the
strongloop/loopback-example-database GitHub repo.