Skip to content

Commit

Permalink
[DOCS] Reorganizing docs directory structure (elastic#1679)
Browse files Browse the repository at this point in the history
* reorganize directory structure of docs

* update links

* top-level index is controlled by a template

* move generated field files into a dedicated dir

* account for new usage dir location in tooling

* new fields/ locations

handle new /fields location for index vs field doc files

* correct the j2 index template

* move images directory
  • Loading branch information
ebeahan committed Dec 6, 2021
1 parent 16fc898 commit d92daa1
Show file tree
Hide file tree
Showing 28 changed files with 22 additions and 24 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ Guidelines].



include::using.asciidoc[]
include::fields.asciidoc[]
include::field-values.asciidoc[]
include::migrating.asciidoc[]
include::additional.asciidoc[]
include::using-ecs/index.asciidoc[]
include::fields/fields.asciidoc[]
include::fields/field-values.asciidoc[]
include::migrating/index.asciidoc[]
include::additional-info/index.asciidoc[]
4 changes: 0 additions & 4 deletions docs/logstash.asciidoc.disabled

This file was deleted.

File renamed without changes.
1 change: 0 additions & 1 deletion docs/migrating.asciidoc → docs/migrating/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ If you have a custom pipeline or application you would like to convert to ECS,
please have a look at <<ecs-converting>>.

include::products-solutions.asciidoc[]
// include::logstash.asciidoc[]
include::converting.asciidoc[]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions docs/using.asciidoc → docs/using-ecs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ ECS fields, head over to <<ecs-custom-fields-in-ecs>>.
<<ecs-mapping-network-events, Mapping network events>> provides a detailed walk-through of how to best map and
categorize an example network event to the schema.

include::using-getting-started.asciidoc[][]
include::using-guidelines.asciidoc[]
include::using-conventions.asciidoc[]
include::using-custom-fields.asciidoc[]
include::using-mapping-network-events.asciidoc[]
include::getting-started.asciidoc[][]
include::guidelines.asciidoc[]
include::conventions.asciidoc[]
include::custom-fields.asciidoc[]
include::mapping-network-events.asciidoc[]
File renamed without changes.
9 changes: 6 additions & 3 deletions scripts/generators/asciidoc_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@


def generate(nested, ecs_generated_version, out_dir):
# fields docs now have a dedicated docs subdir: docs/fields
fields_docs_dir = out_dir + '/fields'

save_asciidoc(path.join(out_dir, 'index.asciidoc'), page_index(ecs_generated_version))
save_asciidoc(path.join(out_dir, 'fields.asciidoc'), page_field_index(nested, ecs_generated_version))
save_asciidoc(path.join(out_dir, 'field-details.asciidoc'), page_field_details(nested))
save_asciidoc(path.join(out_dir, 'field-values.asciidoc'), page_field_values(nested))
save_asciidoc(path.join(fields_docs_dir, 'fields.asciidoc'), page_field_index(nested, ecs_generated_version))
save_asciidoc(path.join(fields_docs_dir, 'field-details.asciidoc'), page_field_details(nested))
save_asciidoc(path.join(fields_docs_dir, 'field-values.asciidoc'), page_field_values(nested))

# Helpers

Expand Down
2 changes: 1 addition & 1 deletion scripts/generators/ecs_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def path_exists_in_git_tree(tree, file_path):


def usage_doc_files():
usage_docs_dir = os.path.join(os.path.dirname(__file__), '../../docs/usage')
usage_docs_dir = os.path.join(os.path.dirname(__file__), '../../docs/fields/usage')
usage_docs_path = pathlib.Path(usage_docs_dir)
if usage_docs_path.is_dir():
return [x.name for x in usage_docs_path.glob('*.asciidoc') if x.is_file()]
Expand Down
10 changes: 5 additions & 5 deletions scripts/templates/index.j2
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ Guidelines].



include::using.asciidoc[]
include::fields.asciidoc[]
include::field-values.asciidoc[]
include::migrating.asciidoc[]
include::additional.asciidoc[]
include::using-ecs/index.asciidoc[]
include::fields/fields.asciidoc[]
include::fields/field-values.asciidoc[]
include::migrating/index.asciidoc[]
include::additional-info/index.asciidoc[]

0 comments on commit d92daa1

Please sign in to comment.