This project is a collection of Markdown files which get rendered to HTML and are displayed in the Layer developer portal, documentation section. It follows simple rules of navigation definition, folder and file naming structure.
File navigation.yaml
contains the definition of the documentation navigation. Make sure you edit this file when removing or adding new content.
For more information look at the contents of the navigation file.
Each folder here represents a page
. Each folder contains Markdown files, one markdown file represent a section
in the page navigation.
If page is defined by platforms: true
inside the navigation file it must contains platform sub-folders, which then contain Markdown files i.e. sections
.
Page api
is treated differently than the rest of the pages. It contains data.json
file which is a rew JSON data used to generate API Reference page. The data is generated separately by a platform dependend JSON generator. It also contains an intro.md
which contains an introduction content of the API Reference page.
You should never need to edit the data.json files manually.
We are using marked parser which supports basic Markdown syntax as well as gfm syntax.
- You define code start section with standard markdown code definition ```
- Right after ``` you put the code syntax type
- Put the source code after that and end it with ```
iOS code snippet example:
```objectivec
EvernoteSession *session = [EvernoteSession sharedSession];
[session authenticateWithViewController:self completionHandler:^(NSError *error) {
if (error || !session.isAuthenticated) {
// authentication failed :(
// show an alert, etc
// ...
} else {
// authentication succeeded :)
// do something now that we're authenticated
// ...
}
}];
```
Android example:
```java
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch(requestCode) {
// Update UI when oauth activity returns result
case EvernoteSession.REQUEST_CODE_OAUTH:
if (resultCode == Activity.RESULT_OK) {
// Authentication was successful, do what you need to do in your app
}
break;
}
}
```
If you want your code snippet to be syntax highlighted you need to use one of the following types:
java
Javaobjectivec
ObjectiveCjson
JSONxml
XMLconsole
Console output or scriptgroovy
Groovy
On top of the "standard" Markdown we are doing some custom parsing which is described below. We have a set of predefined tags that you can use inside markdown file which will render into a certain HTML component. This is a stanalone component that usually takes up the whole page width.
To show a content that is less relevant we can hide it inside a collapsable component which can be expanded by clicking an action at the bottom.
```collapse
This content is going to be hidden...
```
To emphasise a paragraph you can use the following syntax.
```emphasis
This is a very important message.
```