From 0b6cbee0788cc640b660ff34f3ac1712bbc932f2 Mon Sep 17 00:00:00 2001 From: Charissa Miller <48832936+clemiller@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:40:35 -0400 Subject: [PATCH] docs: capitalize schema titles & add stix bundle docs to overview page --- generate-docs.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/generate-docs.sh b/generate-docs.sh index f029117..cad53f6 100755 --- a/generate-docs.sh +++ b/generate-docs.sh @@ -24,6 +24,8 @@ find $SCHEMA_DIR -name "*.schema.ts" | while read schemaFile; do # skip stix-bundle for now if [[ "${fileName}" == "stix-bundle.schema.ts" ]]; then + # add to overview + echo "| STIX Bundle | SDO | [Schema](/docs/sdo/stix-bundle.schema) |" >> $OVERVIEW continue fi @@ -32,13 +34,14 @@ find $SCHEMA_DIR -name "*.schema.ts" | while read schemaFile; do # get schema title title=$(sed -e 's/-/ /g' <<< "${fileName%%.*}") - title="$(tr '[:lower:]' '[:upper:]' <<< "${title:0:1}")${title:1}" + title=$(echo "$title" | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2))}1') + # title="$(tr '[:lower:]' '[:upper:]' <<< "${title:0:1}")${title:1}" # set output file path outputFile="$OUTPUT_DIR/${relativePath/.ts/.md}" # convert zod schemas to md - npx zod2md --entry $schemaFile --title "$title schema" --output "$outputFile" + npx zod2md --entry $schemaFile --title "$title Schema" --output "$outputFile" # add schema to overview table schemaLink="${relativePath/.ts/.md}"