Skip to content

Commit

Permalink
remove unnecessary swizzled files
Browse files Browse the repository at this point in the history
  • Loading branch information
nahbee10 committed Nov 15, 2024
1 parent e6a2c1a commit 96d2cd1
Show file tree
Hide file tree
Showing 21 changed files with 2,601 additions and 470 deletions.
2,552 changes: 2,552 additions & 0 deletions file_tree.json

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions generate_file_tree.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
TARGET_FOLDER="docs"

# Initialize an empty JSON array
echo "[]" > file_tree.json

# Traverse all files and folders in the target folder
find "$TARGET_FOLDER" -type d | while read -r dir; do
# Check for _category_.json in the folder
if [ -f "$dir/_category_.json" ]; then
# Extract the 'label' field from the _category_.json
label=$(jq -r '.label' "$dir/_category_.json")

# If label is null or empty, default to folder name
[ -z "$label" ] && label=$(basename "$dir")

# Add folder to the JSON array
jq --arg path "$dir" --arg title "$label" \
'. += [{"path": $path, "title": $title, "type": "folder"}]' \
file_tree.json > tmp.json && mv tmp.json file_tree.json
fi
done

# Traverse all Markdown files in the target folder
find "$TARGET_FOLDER" -type f -name "*.md" | while read -r file; do
# Extract file path relative to the folder
relative_path="${file#"$TARGET_FOLDER/"}"

# Extract the title from the Markdown file (e.g., first-level heading)
title=$(grep -m 1 "^# " "$file" | sed 's/^# //')

# If no title is found, use the filename without extension
if [ -z "$title" ]; then
title=$(basename "$file" .md)
fi

# Add a JSON object for the file
jq --arg path "$relative_path" --arg title "$title" \
'. += [{"path": $path, "title": $title, "type": "file"}]' \
file_tree.json > tmp.json && mv tmp.json file_tree.json
done

# Output the generated JSON
cat file_tree.json
6 changes: 6 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,9 @@
.col.docItemCol_src-theme-DocItem-Layout-styles-module {
@apply sm:!max-w-full md:!max-w-[75%];
}
.container {
@apply !mt-nav-h;
}
.theme-doc-footer-edit-meta-row {
@apply !hidden;
}
37 changes: 0 additions & 37 deletions src/theme/DocItem/Content/index.js

This file was deleted.

54 changes: 0 additions & 54 deletions src/theme/DocItem/Footer/index.js

This file was deleted.

11 changes: 0 additions & 11 deletions src/theme/DocItem/Footer/styles.module.css

This file was deleted.

14 changes: 0 additions & 14 deletions src/theme/DocItem/Metadata/index.js

This file was deleted.

11 changes: 0 additions & 11 deletions src/theme/DocItem/Paginator/index.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/theme/DocItem/TOC/Desktop/index.js

This file was deleted.

17 changes: 0 additions & 17 deletions src/theme/DocItem/TOC/Mobile/index.js

This file was deleted.

12 changes: 0 additions & 12 deletions src/theme/DocItem/TOC/Mobile/styles.module.css

This file was deleted.

19 changes: 0 additions & 19 deletions src/theme/DocItem/index.js

This file was deleted.

26 changes: 0 additions & 26 deletions src/theme/DocPage/Layout/Main/index.js

This file was deleted.

19 changes: 0 additions & 19 deletions src/theme/DocPage/Layout/Main/styles.module.css

This file was deleted.

27 changes: 0 additions & 27 deletions src/theme/DocPage/Layout/Sidebar/ExpandButton/index.js

This file was deleted.

27 changes: 0 additions & 27 deletions src/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css

This file was deleted.

Loading

0 comments on commit 96d2cd1

Please sign in to comment.