Rich Content

1
Last updated last month

On the Web, we've become accustomed to content that goes beyond text. GitBook lets you add semantics and interaction to your content.

Headings

Headings are what structures your documents. Heading levels 1 and 2 will appear in the document's navigation on the right.

The mini table of contents shows the first two levels of headings

All headings have an anchor near them which is a link that your readers can use to point to a particular section of your documentation.

Headings generate anchor links

GitBook offers 3 levels of headings, which should be enough to properly structure your argument.

GitBook offers 3 levels of headings

Hints & Callouts

A great way to bring the reader's attention to specific elements is to use hints

Tabs

You can structure your content in tabs. Here is an example that list instructions relevant to specific platforms:

Windows
OSX
Linux

Here are the instructions concerning Windows

Here are the instructions concerning OSX

Here are the instructions concerning Linux

If some tabs titles are repeated across the page, switching to a given tab will automatically switch to this tab for the rest of the page.

Windows
OSX
Linux

Here are more instructions concerning Windows

If you picked OSX earlier, this should become the default active tab.

If you picked Linux earlier, this should become the default active tab.

Code

You can have multi tabs code blocks, each one with its own language:

index.js
App.js
index.html
import * as React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, window.document.getElementById('root'));

Api Methods

You can find below a live example of what an API method block looks like. Notice how it becomes accessible from the page's table of content on the right side. To create an API method block, open the commands palette using the + on the left, or hitting Cmd+/ or Ctrl+/.

get
List your repositories

https://api.github.com
/user/repos
List repositories that the authenticated user has explicit permission (:read, :write, or :admin) to access.
Request
Response
Query Parameters
visibility
optional
string
Can be one of "all", "public", or "private". Default: "all".
sort
optional
string
Can be one of "created", "updated", "pushed", "full_name". Default: "full_name".
200: OK
[
{
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}
}
]