Skip to content

Commit

Permalink
File reference in docs (elastic#71)
Browse files Browse the repository at this point in the history
This adds an example on how part of the docs could be generated from existing files. This is especially useful for showing example data or longer configurations.
  • Loading branch information
ruflin authored Sep 10, 2019
1 parent 0c7e8c5 commit c4ef27a
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dev/package-examples/longdocs-1.0.4/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ This integration is considered to be in _beta_.

This is a [link](https://github.com/elastic/integrations-registry) inside the docs.

## Examples from a file

The following file shows how an event might look like:

```
{{ > ./data.json }}
```

## Template parts

Some part of our documentation will require templated documentation. An example of this is to link to the download links of the Beat with the same version as Kibana. The link below with the link text is an example:
Expand Down
55 changes: 55 additions & 0 deletions dev/package-examples/longdocs-1.0.4/docs/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"@timestamp": "2017-10-12T08:05:34.853Z",
"agent": {
"hostname": "host.example.com",
"name": "host.example.com"
},
"event": {
"dataset": "system.core",
"duration": 115000,
"module": "system"
},
"metricset": {
"name": "core"
},
"service": {
"type": "system"
},
"system": {
"core": {
"id": 0,
"idle": {
"pct": 0.84,
"ticks": 69564411
},
"iowait": {
"pct": 0,
"ticks": 419844
},
"irq": {
"pct": 0,
"ticks": 0
},
"nice": {
"pct": 0,
"ticks": 45632
},
"softirq": {
"pct": 0,
"ticks": 189966
},
"steal": {
"pct": 0,
"ticks": 0
},
"system": {
"pct": 0.08,
"ticks": 6211665
},
"user": {
"pct": 0.08,
"ticks": 18833962
}
}
}
}

0 comments on commit c4ef27a

Please sign in to comment.