-
Notifications
You must be signed in to change notification settings - Fork 447
Add usage docs section #988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ebeahan
merged 13 commits into
elastic:master
from
ebeahan:feature/free-form-text-sections
Oct 8, 2020
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c2e2eb9
add usage doc file helper
ebeahan e103bd3
add usage file check against fieldset name
ebeahan f97c9a0
add condiitonal check for usage_doc
ebeahan 1e033e0
add coverage for check_for_usage_doc
ebeahan c69a790
increase chunking level
ebeahan 5792f9b
adjust for whitespace
ebeahan a85d931
adding usage directory and readme
ebeahan 176b5e9
fix linting errors
ebeahan 8231f0a
changelog
ebeahan cfb7683
Update docs/usage/README.md
ebeahan a51de95
incorrect markdown in asciidoc template
ebeahan 2b9325c
add conditional sentence if usage doc is present
ebeahan 0669458
note expected anchor convention
ebeahan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Usage Docs | ||
|
|
||
| ECS fields can benefit from additional context and examples which describe their real-world usage. This directory provides a place in the documentation to capture these usage details. AsciiDoc markdown files can be added for any fieldset defined in ECS. | ||
|
|
||
| ## Adding a Usage Doc | ||
|
|
||
| 1. Create an AsciiDoc formatted file with the `.asciidoc` file extension. | ||
| 2. Save the file in this directory (`docs/usage`), naming it after its associated field set (e.g. a usage document for the fields defined in `schemas/base.yml` fields would be named `docs/usage/base.asciidoc`). | ||
| 3. The anchor at the top of the file (e.g. `[[ecs-base-usage]]`) must use the following convention for valid link references in the generated docs: `[[ecs-<<fieldset-name>>-usage]]`. | ||
| 4. Run `make`. The asciidoc generator will generate the ECS field reference, including the present usage docs. | ||
|
|
||
| If the filename doesn't match a currently defined fieldset, the usage document will not appear on the ECS docs site. This logic is handled in the AsciiDoc generator scripts, `scripts/generators/asciidoc_fields.py`. | ||
|
|
||
| ## Template | ||
|
|
||
| The following is a simple AsciiDoc template as a starting point: | ||
|
|
||
| ```asciidoc | ||
|
|
||
| [[ecs-fieldset-usage]] | ||
| ==== Fieldset Usage | ||
|
|
||
| Add relevant text here. | ||
|
|
||
| [discrete] | ||
| ===== New Section header | ||
|
|
||
| Text for the new section. | ||
|
|
||
| [discrete] | ||
| ===== Examples | ||
|
|
||
| [source,sh] | ||
| ----------- | ||
| { | ||
| "key": "value" | ||
| } | ||
| ----------- | ||
|
|
||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.