jekyll-theme-zer0 0.10.4 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +459 -0
- data/README.md +24 -8
- data/_data/navigation/about.yml +39 -11
- data/_data/navigation/docs.yml +53 -23
- data/_data/navigation/home.yml +27 -9
- data/_data/navigation/main.yml +27 -8
- data/_data/navigation/posts.yml +22 -6
- data/_data/navigation/quickstart.yml +8 -3
- data/_includes/README.md +2 -0
- data/_includes/components/js-cdn.html +4 -1
- data/_includes/components/post-card.html +2 -11
- data/_includes/components/preview-image.html +32 -0
- data/_includes/content/intro.html +5 -6
- data/_includes/core/footer.html +5 -3
- data/_includes/core/header.html +14 -0
- data/_includes/navigation/sidebar-categories.html +20 -9
- data/_includes/navigation/sidebar-folders.html +8 -7
- data/_includes/navigation/sidebar-right.html +16 -10
- data/_layouts/blog.html +15 -45
- data/_layouts/category.html +4 -24
- data/_layouts/collection.html +2 -12
- data/_layouts/default.html +1 -1
- data/_layouts/journals.html +2 -12
- data/_layouts/notebook.html +296 -0
- data/_sass/core/_docs.scss +1 -1
- data/_sass/custom.scss +55 -18
- data/_sass/notebooks.scss +458 -0
- data/assets/images/notebooks/test-notebook_files/test-notebook_4_0.png +0 -0
- data/assets/js/sidebar.js +511 -0
- data/scripts/README.md +128 -105
- data/scripts/analyze-commits.sh +9 -311
- data/scripts/bin/build +22 -22
- data/scripts/build +7 -111
- data/scripts/convert-notebooks.sh +415 -0
- data/scripts/features/validate_preview_urls.py +500 -0
- data/scripts/fix-markdown-format.sh +8 -262
- data/scripts/generate-preview-images.sh +7 -787
- data/scripts/install-preview-generator.sh +8 -528
- data/scripts/lib/README.md +5 -5
- data/scripts/lib/gem.sh +19 -7
- data/scripts/release +7 -236
- data/scripts/setup.sh +9 -153
- data/scripts/test-auto-version.sh +7 -256
- data/scripts/test-mermaid.sh +7 -287
- data/scripts/test.sh +9 -154
- metadata +9 -10
- data/scripts/features/preview_generator.py +0 -646
- data/scripts/lib/test/run_tests.sh +0 -140
- data/scripts/lib/test/test_changelog.sh +0 -87
- data/scripts/lib/test/test_gem.sh +0 -68
- data/scripts/lib/test/test_git.sh +0 -82
- data/scripts/lib/test/test_validation.sh +0 -72
- data/scripts/lib/test/test_version.sh +0 -96
- data/scripts/version.sh +0 -178
|
@@ -1,265 +1,11 @@
|
|
|
1
|
-
#!/
|
|
1
|
+
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
3
|
+
# ============================================================================
|
|
4
|
+
# WRAPPER: This script forwards to scripts/utils/fix-markdown
|
|
5
|
+
#
|
|
6
|
+
# The canonical location is scripts/utils/fix-markdown. This wrapper exists
|
|
7
|
+
# for backward compatibility with existing workflows.
|
|
8
|
+
# ============================================================================
|
|
7
9
|
|
|
8
|
-
set -euo pipefail
|
|
9
|
-
|
|
10
|
-
# Configuration
|
|
11
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# Colors for output
|
|
15
|
-
RED='\033[0;31m'
|
|
16
|
-
GREEN='\033[0;32m'
|
|
17
|
-
YELLOW='\033[1;33m'
|
|
18
|
-
BLUE='\033[0;34m'
|
|
19
|
-
NC='\033[0m' # No Color
|
|
20
|
-
|
|
21
|
-
# Logging functions
|
|
22
|
-
log_info() {
|
|
23
|
-
echo -e "${BLUE}[INFO]${NC} $1"
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
log_success() {
|
|
27
|
-
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
log_warning() {
|
|
31
|
-
echo -e "${YELLOW}[WARNING]${NC} $1"
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
log_error() {
|
|
35
|
-
echo -e "${RED}[ERROR]${NC} $1"
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
# Function to fix common markdown issues
|
|
39
|
-
fix_markdown_file() {
|
|
40
|
-
local file="$1"
|
|
41
|
-
local temp_file="${file}.tmp"
|
|
42
|
-
|
|
43
|
-
log_info "Fixing markdown formatting in: $file"
|
|
44
|
-
|
|
45
|
-
# Create backup
|
|
46
|
-
cp "$file" "${file}.backup"
|
|
47
|
-
|
|
48
|
-
# Apply fixes using sed (macOS compatible)
|
|
49
|
-
sed -e 's/[[:space:]]*$//' \
|
|
50
|
-
-e '/^#/a\
|
|
51
|
-
' \
|
|
52
|
-
-e '/^##/a\
|
|
53
|
-
' \
|
|
54
|
-
-e '/^###/a\
|
|
55
|
-
' \
|
|
56
|
-
-e '/^####/a\
|
|
57
|
-
' \
|
|
58
|
-
-e '/^#####/a\
|
|
59
|
-
' \
|
|
60
|
-
-e '/^######/a\
|
|
61
|
-
' \
|
|
62
|
-
-e '/^- /i\
|
|
63
|
-
' \
|
|
64
|
-
-e '/^* /i\
|
|
65
|
-
' \
|
|
66
|
-
-e '/^+ /i\
|
|
67
|
-
' \
|
|
68
|
-
-e '/^[0-9]/i\
|
|
69
|
-
' \
|
|
70
|
-
-e 's/```$/```bash/' \
|
|
71
|
-
-e 's/^```[[:space:]]*$/```bash/' \
|
|
72
|
-
"$file" > "$temp_file"
|
|
73
|
-
|
|
74
|
-
# Additional fixes with awk for more complex patterns
|
|
75
|
-
awk '
|
|
76
|
-
BEGIN { prev_was_heading = 0; prev_was_list = 0 }
|
|
77
|
-
|
|
78
|
-
# Handle headings - ensure blank line before and after
|
|
79
|
-
/^#/ {
|
|
80
|
-
if (NR > 1 && prev_line != "" && !prev_was_heading) print ""
|
|
81
|
-
print $0
|
|
82
|
-
prev_was_heading = 1
|
|
83
|
-
prev_was_list = 0
|
|
84
|
-
prev_line = $0
|
|
85
|
-
next
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
# Handle list items - ensure blank line before first item
|
|
89
|
-
/^[[:space:]]*[-*+]/ || /^[[:space:]]*[0-9]+\./ {
|
|
90
|
-
if (!prev_was_list && prev_line != "" && !prev_was_heading) print ""
|
|
91
|
-
print $0
|
|
92
|
-
prev_was_list = 1
|
|
93
|
-
prev_was_heading = 0
|
|
94
|
-
prev_line = $0
|
|
95
|
-
next
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
# Handle code blocks - ensure they have language specification
|
|
99
|
-
/^```[[:space:]]*$/ {
|
|
100
|
-
print "```bash"
|
|
101
|
-
prev_was_heading = 0
|
|
102
|
-
prev_was_list = 0
|
|
103
|
-
prev_line = $0
|
|
104
|
-
next
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
# Regular lines
|
|
108
|
-
{
|
|
109
|
-
print $0
|
|
110
|
-
prev_was_heading = 0
|
|
111
|
-
prev_was_list = 0
|
|
112
|
-
prev_line = $0
|
|
113
|
-
}
|
|
114
|
-
' "$temp_file" > "$file"
|
|
115
|
-
|
|
116
|
-
# Clean up
|
|
117
|
-
rm "$temp_file"
|
|
118
|
-
|
|
119
|
-
log_success "Fixed formatting in: $file"
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
# Function to remove trailing whitespace
|
|
123
|
-
remove_trailing_whitespace() {
|
|
124
|
-
local file="$1"
|
|
125
|
-
log_info "Removing trailing whitespace from: $file"
|
|
126
|
-
|
|
127
|
-
# Remove trailing whitespace
|
|
128
|
-
sed -i '' 's/[[:space:]]*$//' "$file"
|
|
129
|
-
|
|
130
|
-
log_success "Removed trailing whitespace from: $file"
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
# Function to fix heading punctuation
|
|
134
|
-
fix_heading_punctuation() {
|
|
135
|
-
local file="$1"
|
|
136
|
-
log_info "Fixing heading punctuation in: $file"
|
|
137
|
-
|
|
138
|
-
# Remove trailing punctuation from headings
|
|
139
|
-
sed -i '' 's/^\(#\+[[:space:]]*.*\)[.!?:;,]*[[:space:]]*$/\1/' "$file"
|
|
140
|
-
|
|
141
|
-
log_success "Fixed heading punctuation in: $file"
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
# Function to fix emphasis formatting
|
|
145
|
-
fix_emphasis_formatting() {
|
|
146
|
-
local file="$1"
|
|
147
|
-
log_info "Fixing emphasis formatting in: $file"
|
|
148
|
-
|
|
149
|
-
# Fix common emphasis issues
|
|
150
|
-
sed -i '' \
|
|
151
|
-
-e 's/\*\*\([^*]*\) \*\*/\*\*\1\*\*/g' \
|
|
152
|
-
-e 's/\*\([^*]*\) \*/\*\1\*/g' \
|
|
153
|
-
"$file"
|
|
154
|
-
|
|
155
|
-
log_success "Fixed emphasis formatting in: $file"
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
# Main execution function
|
|
159
|
-
main() {
|
|
160
|
-
log_info "Starting markdown formatting fixes..."
|
|
161
|
-
|
|
162
|
-
# Find all markdown files
|
|
163
|
-
local md_files
|
|
164
|
-
mapfile -t md_files < <(find "$PROJECT_ROOT" -name "*.md" \
|
|
165
|
-
-not -path "*/node_modules/*" \
|
|
166
|
-
-not -path "*/.git/*" \
|
|
167
|
-
-not -path "*/vendor/*" \
|
|
168
|
-
-not -path "*/_site/*")
|
|
169
|
-
|
|
170
|
-
if [ ${#md_files[@]} -eq 0 ]; then
|
|
171
|
-
log_warning "No markdown files found"
|
|
172
|
-
return 0
|
|
173
|
-
fi
|
|
174
|
-
|
|
175
|
-
log_info "Found ${#md_files[@]} markdown files to process"
|
|
176
|
-
|
|
177
|
-
# Process each file
|
|
178
|
-
for file in "${md_files[@]}"; do
|
|
179
|
-
if [ -f "$file" ]; then
|
|
180
|
-
remove_trailing_whitespace "$file"
|
|
181
|
-
fix_heading_punctuation "$file"
|
|
182
|
-
fix_emphasis_formatting "$file"
|
|
183
|
-
fix_markdown_file "$file"
|
|
184
|
-
fi
|
|
185
|
-
done
|
|
186
|
-
|
|
187
|
-
log_success "Completed markdown formatting fixes for ${#md_files[@]} files"
|
|
188
|
-
|
|
189
|
-
# Provide summary
|
|
190
|
-
echo
|
|
191
|
-
log_info "Summary of fixes applied:"
|
|
192
|
-
echo " ✓ Removed trailing whitespace"
|
|
193
|
-
echo " ✓ Added blank lines around headings"
|
|
194
|
-
echo " ✓ Added blank lines before list items"
|
|
195
|
-
echo " ✓ Fixed code block language specifications"
|
|
196
|
-
echo " ✓ Fixed heading punctuation"
|
|
197
|
-
echo " ✓ Fixed emphasis formatting"
|
|
198
|
-
echo
|
|
199
|
-
log_info "Backup files created with .backup extension"
|
|
200
|
-
log_info "Run 'git diff' to review changes before committing"
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
# Help function
|
|
204
|
-
show_help() {
|
|
205
|
-
cat << EOF
|
|
206
|
-
Markdown Formatting Fix Script
|
|
207
|
-
|
|
208
|
-
USAGE:
|
|
209
|
-
$0 [OPTIONS]
|
|
210
|
-
|
|
211
|
-
OPTIONS:
|
|
212
|
-
-h, --help Show this help message
|
|
213
|
-
--dry-run Show what would be fixed without making changes
|
|
214
|
-
--file FILE Fix only the specified file
|
|
215
|
-
|
|
216
|
-
EXAMPLES:
|
|
217
|
-
$0 # Fix all markdown files
|
|
218
|
-
$0 --file README.md # Fix only README.md
|
|
219
|
-
$0 --dry-run # Preview changes without applying
|
|
220
|
-
|
|
221
|
-
This script fixes common markdown linting violations:
|
|
222
|
-
- Trailing whitespace
|
|
223
|
-
- Missing blank lines around headings
|
|
224
|
-
- Missing blank lines before lists
|
|
225
|
-
- Code blocks without language specification
|
|
226
|
-
- Heading punctuation issues
|
|
227
|
-
- Emphasis formatting problems
|
|
228
|
-
|
|
229
|
-
EOF
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
# Parse command line arguments
|
|
233
|
-
case "${1:-}" in
|
|
234
|
-
-h|--help)
|
|
235
|
-
show_help
|
|
236
|
-
exit 0
|
|
237
|
-
;;
|
|
238
|
-
--dry-run)
|
|
239
|
-
log_info "DRY RUN MODE - No changes will be made"
|
|
240
|
-
# Implementation for dry run would go here
|
|
241
|
-
exit 0
|
|
242
|
-
;;
|
|
243
|
-
--file)
|
|
244
|
-
if [ -n "${2:-}" ] && [ -f "$2" ]; then
|
|
245
|
-
log_info "Fixing single file: $2"
|
|
246
|
-
remove_trailing_whitespace "$2"
|
|
247
|
-
fix_heading_punctuation "$2"
|
|
248
|
-
fix_emphasis_formatting "$2"
|
|
249
|
-
fix_markdown_file "$2"
|
|
250
|
-
log_success "Completed fixing: $2"
|
|
251
|
-
else
|
|
252
|
-
log_error "File not found: ${2:-}"
|
|
253
|
-
exit 1
|
|
254
|
-
fi
|
|
255
|
-
exit 0
|
|
256
|
-
;;
|
|
257
|
-
"")
|
|
258
|
-
main
|
|
259
|
-
;;
|
|
260
|
-
*)
|
|
261
|
-
log_error "Unknown option: $1"
|
|
262
|
-
show_help
|
|
263
|
-
exit 1
|
|
264
|
-
;;
|
|
265
|
-
esac
|
|
11
|
+
exec "$SCRIPT_DIR/utils/fix-markdown" "$@"
|