-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: flattening output files for typedoc
- Loading branch information
Showing
3 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 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,22 @@ | ||
## Adjusts the markdown files to remove relative links | ||
## Since we want all the files to be named after the module, this will make | ||
## those adjustments. | ||
find . -type d | while read dir; do | ||
# URL encode the file without spaces | ||
ESCAPED_FILE=$(echo "$dir.md" | tail -c+3 | sed 's/ /-/g') | ||
FILE=$(echo "$dir/globals.md") | ||
if [[ -e "$FILE" ]] | ||
then | ||
echo "Adjusting $FILE" | ||
(cd "$dir" && | ||
# Adjust all relative links back up to the root | ||
sed -E 's/\(\.\.\/(.+)(\/globals\.md)(.+)\)/(.\/\1.md\3)/g' globals.md | | ||
# Adjust all references to packages.md to HOME.md | ||
sed -E 's/\(..\/packages.md\)/(\.\/HOME.md)/g' | | ||
# Adjust all local references to new file name | ||
sed -E "s/\(globals\.md(.+)\)/(\.\/$ESCAPED_FILE)/g" >> "$dir.md" | ||
) | ||
(cd "$dir" && rm -rf globals.md index.md) | ||
fi | ||
done | ||
echo "END OF LINE" |
This file contains 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