Skip to content

Commit aec155e

Browse files
committed
Add in dynamic nav for examples
1 parent 6b9c868 commit aec155e

File tree

5 files changed

+33
-21
lines changed

5 files changed

+33
-21
lines changed

.github/workflows/docs-site-deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
path: .cache
2828
restore-keys: |
2929
mkdocs-material-
30-
- run: pip install mkdocs-material mkdocs-open-in-new-tab "mkdocs-material[imaging]" mike
30+
- run: pip install mkdocs-material mkdocs-open-in-new-tab "mkdocs-material[imaging]" mkdocs-awesome-pages-plugin mike
3131
- run: bash src/script/build_docs.sh
3232
- run: |
3333
latest_tag=$(git describe --tags --abbrev=0)

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@
33
.idea
44
site
55
*.iml
6+
.cache
7+
8+
docs/changelog.md
9+
docs/contributing.md
10+
docs/home.md
11+
docs/vendors.md
12+
docs/examples/**/*.md

docs/examples/README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,46 @@ This folder contains mainly excerpts of data contracts to illustrate specific se
1717

1818
## Full example
1919

20-
- [Full example](all/full-example.odcs.yaml)
21-
- [Postgres AdventureWorks](all/postgresql-adventureworks-contract.odcs.yaml)
20+
- [Full example](all/full-example.md)
21+
- [Postgres AdventureWorks](all/postgresql-adventureworks-contract.md)
2222

2323
## Fundamentals
2424

25-
- [Table and column](fundamentals/table-column-description.odcs.yaml)
25+
- [Table and column](fundamentals/table-column-description.md)
2626

2727
## Dataset and schema
2828

29-
- [All schema types](schema/all-schema-types.odcs.yaml)
30-
- [Data types](data-types/all-data-types.odcs.yaml)
31-
- [Table with single column](schema/table-column.odcs.yaml)
32-
- [Table with columns and partitioning](schema/table-columns-with-partition.odcs.yaml)
29+
- [All schema types](schema/all-schema-types.md)
30+
- [Data types](data-types/all-data-types.md)
31+
- [Table with single column](schema/table-column.md)
32+
- [Table with columns and partitioning](schema/table-columns-with-partition.md)
3333

3434
## Data quality
3535

36-
- [Column accuracy](quality/column-accuracy.odcs.yaml)
37-
- [Column completeness](quality/column-completeness.odcs.yaml)
38-
- [Column custom](quality/column-custom.odcs.yaml)
39-
- [Column validity](quality/column-validity.odcs.yaml)
36+
- [Column accuracy](quality/column-accuracy.md)
37+
- [Column completeness](quality/column-completeness.md)
38+
- [Column custom](quality/column-custom.md)
39+
- [Column validity](quality/column-validity.md)
4040

4141
## Server
4242

43-
- [Azure server](server/azure-server.odcs.yaml)
44-
- [Kafka server](server/kafka-server.odcs.yaml)
43+
- [Azure server](server/azure-server.md)
44+
- [Kafka server](server/kafka-server.md)
4545

4646
## #
4747
This section covers # when you bill your customer for using this data product.
4848

4949
## Stakeholders
5050

51-
- [Stakeholders example](stakeholders/basic-four-dpo.odcs.yaml)
51+
- [Stakeholders example](stakeholders/basic-four-dpo.md)
5252

5353
## Roles
5454

55-
- [Service and operational roles](roles/service-and-operational-roles.odcs.yaml)
55+
- [Service and operational roles](roles/service-and-operational-roles.md)
5656

5757
## Service-level agreement
5858

59-
- [Database SLA](sla/database-table-sla.odcs.yaml)
59+
- [Database SLA](sla/database-table-sla.md)
6060

6161
## Other properties
6262
Coming soon.

mkdocs.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ plugins:
77
- open-in-new-tab
88
- search
99
- social
10+
- awesome-pages
1011

1112
theme:
1213
name: material
@@ -34,7 +35,9 @@ theme:
3435
nav:
3536
- Home: 'home.md'
3637
- Standard: 'README.md'
37-
- Examples: 'examples/README.md'
38+
- Examples:
39+
- 'examples/README.md'
40+
- '...'
3841
- Changelog: 'changelog.md'
3942
- Contributing: 'contributing.md'
4043
- Vendors: 'vendors.md'

src/script/build_docs.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ echo "Creating markdown file for each example"
1010
for f in docs/examples/**/*.yaml; do
1111
yaml_content=$(cat "$f")
1212
markdown_file_path="${f//odcs.yaml/md}"
13-
header="${f//docs\/examples\//}"
13+
file_name=$(basename "$f" .odcs.yaml)
14+
header=$(echo "${file_name//\-/ }" | sed -e "s/\b\(.\)/\u\1/g")
1415
echo "Creating file: $markdown_file_path"
1516
content=$(cat <<-END
1617
# ${header}
@@ -21,7 +22,8 @@ ${yaml_content}
2122
END
2223
)
2324
echo "$content" > "$markdown_file_path"
24-
escaped_header="${header//\//\\/}"
25+
base_path="${f//docs\/examples\//}"
26+
escaped_header="${base_path//\//\\/}"
2527
replacement_link="${escaped_header//odcs.yaml/md}"
26-
sed -i -e "s/$escaped_header/$replacement_link/g" docs/examples/README.md
28+
sed -i '' -e "s/$escaped_header/$replacement_link/g" docs/examples/README.md
2729
done

0 commit comments

Comments
 (0)