diff --git a/ARCs/arc-0062.md b/ARCs/arc-0062.md index 909c87a03..b818f368b 100644 --- a/ARCs/arc-0062.md +++ b/ARCs/arc-0062.md @@ -8,7 +8,7 @@ status: Last Call last-call-deadline: 2024-10-15 type: Standards Track category: Interface -sub-category: Explorer +sub-category: Asa created: 2024-06-12 requires: 2, 4, 22 --- diff --git a/_devportal/scripts/update-arcs.sh b/_devportal/scripts/update-arcs.sh index edfe9e674..c21e8db3b 100755 --- a/_devportal/scripts/update-arcs.sh +++ b/_devportal/scripts/update-arcs.sh @@ -52,19 +52,27 @@ for file in arc-*.md; do fi # 2. Replace links like [ARC-1](./arc-0001.md) with [ARC-1](/standards/arcs/arc-0001) - sed -i $SED_INLINE -E 's|\(\./arc-([0-9]+)\.md\)|(/standards/arcs/arc-000\1)|g' "$file" + sed -i $SED_INLINE -E 's|\(\./arc-([0-9]{4})\.md\)|(/standards/arcs/arc-\1)|g' "$file" if [[ $? -ne 0 ]]; then echo "Failed to update links in $file" continue fi - # 3. Handle anchors like [ARC-1](./arc-0001.md#interface-signtxnsopts) -> [ARC-1](/standards/arcs/arc-0001#interface-signtxnsopts) - sed -i $SED_INLINE -E 's|\(\./arc-([0-9]+)\.md(\#[a-zA-Z0-9-]+)?\)|(/standards/arcs/arc-000\1\2)|g' "$file" + # 3. Replace links like [here](../assets/arc-0062) with [here](https://github.com/algorandfoundation/ARCs/tree/main/assets/arc-0062) + sed -i $SED_INLINE -E 's|\(\.\./assets/arc-([0-9]{4})\)|\(https://github.com/algorandfoundation/ARCs/tree/main/assets/arc-\1\)|g' "$file" + if [[ $? -ne 0 ]]; then + echo "Failed to update asset links in $file" + continue + fi + + # 3a. Handle anchors like [ARC-1](./arc-0001.md#interface-signtxnsopts) -> [ARC-1](/standards/arcs/arc-0001#interface-signtxnsopts) + sed -i $SED_INLINE -E 's|\(\./arc-([0-9]{4})\.md(\#[a-zA-Z0-9_-]+)?\)|(/standards/arcs/arc-\1\2)|g' "$file" if [[ $? -ne 0 ]]; then echo "Failed to update anchored links in $file" continue fi + # 4. Ensure exactly one blank line between the end of the front matter and the Abstract section sed -i $SED_INLINE -E '/^---$/,/^## Abstract$/ { /^\s*$/d; }' "$file" if [[ $? -ne 0 ]]; then @@ -116,6 +124,8 @@ sidebar:\\ echo "Failed to replace '../assets' in $file" continue fi + + else echo "No markdown files found matching pattern 'arc-*.md'" fi