Skip to content

Commit

Permalink
feat: Add script to link docs to workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
j3soon committed Nov 5, 2024
1 parent 030f593 commit a19fd21
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 6 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ mkdocs serve
# Go to https://127.0.0.1:8000 to view the site.
```

## Linking the README
## Link Documentation to ROS2 Workspaces

```sh
rm docs/index.md
ln "${PWD}/README.md" docs/index.md
scripts/setup_link.sh
```

## Acknowledgement
Expand Down
3 changes: 3 additions & 0 deletions aloha_ws/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
/install
/log

# Soft Links
/docs

# Custom ignores
/isaacsim/assets
/src/interbotix_ros_manipulators/interbotix_ros_xsarms/interbotix_xsarm_descriptions/urdf/*.urdf
3 changes: 3 additions & 0 deletions cartographer_ws/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
/build
/install
/log

# Soft Links
/docs
5 changes: 2 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ mkdocs serve
# Go to https://127.0.0.1:8000 to view the site.
```

## Linking the README
## Link Documentation to ROS2 Workspaces

```sh
rm docs/index.md
ln "${PWD}/README.md" docs/index.md
scripts/setup_link.sh
```

## Acknowledgement
Expand Down
3 changes: 3 additions & 0 deletions gazebo_world_ws/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
/build
/install
/log

# Soft Links
/docs
3 changes: 3 additions & 0 deletions husky_ws/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
/build
/install
/log

# Soft Links
/docs
3 changes: 3 additions & 0 deletions kobuki_ws/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
/build
/install
/log

# Soft Links
/docs
3 changes: 3 additions & 0 deletions orbslam3_ws/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
/install
/log

# Soft Links
/docs

# ROS2 bag files
V1_02_medium.bag
V1_02_medium/
10 changes: 10 additions & 0 deletions ros1_bridge_ws/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Visual Studio Code
.vscode

# ROS2 basic directories
/build
/install
/log

# Soft Links
/docs
3 changes: 3 additions & 0 deletions rtabmap_ws/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
/build
/install
/log

# Soft Links
/docs
34 changes: 34 additions & 0 deletions scripts/setup_link.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash -e

# Get the directory of this script.
# Reference: https://stackoverflow.com/q/59895
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)"

cd "$SCRIPT_DIR/.."

workspaces=(
"template_ws"
"orbslam3_ws"
"rtabmap_ws"
"ros1_bridge_ws"
"cartographer_ws"
"husky_ws"
"kobuki_ws"
"vlp_ws"
"gazebo_world_ws"
"aloha_ws"
)

# Link docs index
rm docs/index.md || true
ln "${PWD}/README.md" docs/index.md

# Loop through each workspace and link its docs
for ws in "${workspaces[@]}"
do
ws_hyphen="$(echo $ws | sed "s/_/-/g")"
rm "${ws}/docs" || true
ln -s "${PWD}/docs/${ws_hyphen}" "${ws}/docs"
done

echo "Done."
3 changes: 3 additions & 0 deletions template_ws/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
/build
/install
/log

# Soft Links
/docs
3 changes: 3 additions & 0 deletions tests/diff_base/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
/build
/install
/log

# Soft Links
/docs
{PLACEHOLDER_MULTILINE}
3 changes: 3 additions & 0 deletions vlp_ws/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
/build
/install
/log

# Soft Links
/docs

0 comments on commit a19fd21

Please sign in to comment.