Skip to content

Commit b7374cd

Browse files
authored
PRO-512 - Update dev-portal workflow to combine README with detailed documentation (#184)
- Add special handling for Norigin-Spatial-Navigation - Combine README from repo with detailed content from dev portal - Use marker for insertion point - Clean up dev portal links to prevent circular references - Ensure fresh combination on each run (no accumulation) - Tested with real 659-line detailed documentation file
1 parent a668d62 commit b7374cd

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/dev-portal.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,40 @@ jobs:
3737
mv ./temp/projectA/* ./projectB/docs/$REPO_NAME/
3838
echo "Readme files moved to /docs/$REPO_NAME/"
3939
40+
# Special handling for Norigin-Spatial-Navigation
41+
# This section combines the README from the repo with detailed content from the dev portal
42+
if [ "$REPO_NAME" = "Norigin-Spatial-Navigation" ]; then
43+
echo "Combining README with detailed documentation for Spatial Navigation"
44+
45+
# Define file paths
46+
README_FILE="./projectB/docs/$REPO_NAME/README.md" # The README pulled from the repo
47+
DETAILED_DOCS="./projectB/docs/Spat-Nav/Detailed_README_SpatNav.md" # The detailed content file
48+
49+
# Check if the detailed docs file exists
50+
if [ -f "$DETAILED_DOCS" ]; then
51+
echo "Found detailed documentation file: $DETAILED_DOCS"
52+
53+
# Use sed to replace the marker with the detailed content
54+
# The 'r' command reads the file and inserts it after the line containing the marker
55+
# The second sed command removes the marker line itself
56+
sed -i '/<!-- INSERT_DETAILED_README_SPATNAV_HERE -->/r ./projectB/docs/Spat-Nav/Detailed_README_SpatNav.md' "$README_FILE"
57+
sed -i '/<!-- INSERT_DETAILED_README_SPATNAV_HERE -->/d' "$README_FILE"
58+
59+
# Remove dev portal link (if it exists) - this prevents the link from appearing in the dev portal
60+
# Remove lines containing common dev portal link patterns
61+
sed -i '/^# Developer Portal$/d' "$README_FILE" # Remove the heading
62+
sed -i '/\[.*dev.*portal.*\]/d' "$README_FILE" # Remove markdown links to dev portal
63+
sed -i '/\[.*developer.*portal.*\]/d' "$README_FILE" # Remove markdown links to developer portal
64+
sed -i '/https:\/\/.*dev.*portal.*/d' "$README_FILE" # Remove direct URLs to dev portal
65+
sed -i '/For more detailed documentation.*visit our.*Developer Portal/d' "$README_FILE" # Remove the descriptive text
66+
67+
echo "Successfully combined README with detailed documentation"
68+
else
69+
echo "Warning: Detailed documentation file not found at $DETAILED_DOCS"
70+
echo "The marker will remain in the README"
71+
fi
72+
fi
73+
4074
mkdir -p ./projectB/static/$IMAGES_FOLDER
4175
mkdir -p ./projectA/$IMAGES_FOLDER
4276
if [[ `ls ./projectA/$IMAGES_FOLDER` != "" ]]

0 commit comments

Comments
 (0)