Skip to content

Commit

Permalink
Relocate webidl (#56)
Browse files Browse the repository at this point in the history
* Move webidl to APIs/idl

* Change webidl title

* Change webidl location

* Use top level idl dir
  • Loading branch information
peterbrightwell authored Jul 14, 2022
1 parent 50c0f69 commit 3f8c4e0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
23 changes: 9 additions & 14 deletions extract-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ function render_docs {
echo "Copying images"
cp -r "$docs_dir/images" "../$target_dir/$docs_dir"
fi

if [ -d "$docs_dir/idl" ] ; then
echo "Copying idl"
cp -r "$docs_dir/idl" "../$target_dir/$docs_dir"
fi
}

# Render RAML in the specified relative path
Expand Down Expand Up @@ -220,21 +215,21 @@ function render_examples {

}

# Render WebIDL in the specified relative path
# Render Web IDL in the specified relative path
function render_webidl {
webidl_dir=$1
idl_dir=$1

for i in "$webidl_dir"/*.webidl; do
for i in "$idl_dir"/*.webidl; do
HTML_EXAMPLE=${i%%.webidl}.html
render-webidl.sh -n "$i" "Framework definitions ${i##*/}" >> "$HTML_EXAMPLE"
done

echo "Moving webidl"
mkdir -p "../$target_dir/$webidl_dir"
for i in "$webidl_dir"/*.html; do
mv "$i" "../$target_dir/$webidl_dir"
mkdir -p "../$target_dir/$idl_dir"
for i in "$idl_dir"/*.html; do
mv "$i" "../$target_dir/$idl_dir"
done
cp -r ../.scripts/codemirror "../$target_dir/$webidl_dir"
cp -r ../.scripts/codemirror "../$target_dir/$idl_dir"

}

Expand Down Expand Up @@ -307,8 +302,8 @@ function extract_and_render {
render_examples testingfacade/examples
fi

if [ -d APIs/idl ]; then
render_webidl APIs/idl
if [ -d idl ]; then
render_webidl idl
fi
fi # AMWA_ID
)
Expand Down
22 changes: 21 additions & 1 deletion make-indexes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,23 @@ function do_examples_index

}

function do_idl_index
{
set -x
idl_dir="$1"

INDEX_IDL="$idl_dir/$INDEX"
echo -e "\n### [Web IDL]($idl_dir) $tree_text\n" >> "$INDEX"
echo -e "## Web IDL $tree_text\n" > "$INDEX_IDL"
for webidl in "$idl_dir"/*.html; do
no_ext="${webidl%%.html}"
linktext="${no_ext##*/}"
echo "- [$linktext]($webidl)" >> "$INDEX"
echo "- [$linktext](${webidl##*/})" >> "$INDEX_IDL"
done
set +x
}

function do_tree {
tree=$1
label=$2 # because of spelling of plurals
Expand All @@ -186,7 +203,7 @@ function do_tree {
if [[ "$AMWA_ID" == "NMOS-PARAMETER-REGISTERS" ]]; then
echo "{% include register_table.html %}" >> "$INDEX"

# Other repos may have (possibly numbered) docs/, APIs/, APIs/schemas/, schemas/, examples/
# Other repos may have (possibly numbered) docs/, APIs/, APIs/schemas/, schemas/, examples/, idl/
else
if [[ "$label" == "branch" && "$dirname" == "main" ]]; then
# avoid "...for branch main" in repos where that might cause confusion
Expand Down Expand Up @@ -218,6 +235,9 @@ function do_tree {
do_examples_index testingfacade/examples
fi

if [ -d idl ]; then
do_idl_index idl
fi
fi
)
done
Expand Down

0 comments on commit 3f8c4e0

Please sign in to comment.