GitBook API Example
This commit is contained in:
commit
a70a8d122e
|
@ -0,0 +1,16 @@
|
||||||
|
# Node rules:
|
||||||
|
## Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
## Dependency directory
|
||||||
|
## Commenting this out is preferred by some people, see
|
||||||
|
## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Book build output
|
||||||
|
_book
|
||||||
|
|
||||||
|
# eBook build output
|
||||||
|
*.epub
|
||||||
|
*.mobi
|
||||||
|
*.pdf
|
|
@ -0,0 +1,3 @@
|
||||||
|
# My Awesome API
|
||||||
|
|
||||||
|
This file file serves as your book's preface, a great place to describe your book's content and ideas.
|
|
@ -0,0 +1,9 @@
|
||||||
|
# Summary
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
* [My Awesome API](README.md)
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
* [Defining Methods](methods.md)
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"plugins": [ "theme-api" ],
|
||||||
|
"pluginsConfig": {
|
||||||
|
"theme-api": {
|
||||||
|
"languages": [
|
||||||
|
{
|
||||||
|
"lang": "js",
|
||||||
|
"name": "JavaScript",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"lang": "go",
|
||||||
|
"name": "Go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Defining Methods
|
||||||
|
|
||||||
|
Methods allow you to smoothly display code examples in different languages.
|
||||||
|
|
||||||
|
{% method %}
|
||||||
|
## My first method
|
||||||
|
|
||||||
|
My first method exposes how to print a message in JavaScript and Go.
|
||||||
|
|
||||||
|
{% sample lang="js" %}
|
||||||
|
Here is how to print a message to `stdout` using JavaScript.
|
||||||
|
|
||||||
|
```js
|
||||||
|
console.log('My first method');
|
||||||
|
```
|
||||||
|
|
||||||
|
{% sample lang="go" %}
|
||||||
|
Here is how to print a message to `stdout` using Go.
|
||||||
|
|
||||||
|
```go
|
||||||
|
fmt.Println("My first method")
|
||||||
|
```
|
||||||
|
|
||||||
|
{% common %}
|
||||||
|
Whatever language you are using, the result will be the same.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ My first method
|
||||||
|
```
|
||||||
|
{% endmethod %}
|
Loading…
Reference in New Issue