jekyll-theme-zer0 0.7.2 → 0.10.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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +272 -3
  3. data/README.md +83 -21
  4. data/_data/README.md +4 -5
  5. data/_includes/README.md +1 -1
  6. data/_includes/stats/README.md +14 -2
  7. data/_layouts/README.md +3 -3
  8. data/_plugins/preview_image_generator.rb +258 -0
  9. data/_plugins/theme_version.rb +88 -0
  10. data/_sass/core/_theme.scss +4 -1
  11. data/assets/images/previews/git-workflow-best-practices-for-modern-teams.png +0 -0
  12. data/scripts/README.md +443 -0
  13. data/scripts/analyze-commits.sh +313 -0
  14. data/scripts/bin/build +115 -0
  15. data/scripts/bin/release +240 -0
  16. data/scripts/bin/test +203 -0
  17. data/scripts/build +115 -0
  18. data/scripts/example-usage.sh +102 -0
  19. data/scripts/features/generate-preview-images +846 -0
  20. data/scripts/features/install-preview-generator +531 -0
  21. data/scripts/features/preview_generator.py +646 -0
  22. data/scripts/fix-markdown-format.sh +265 -0
  23. data/scripts/generate-preview-images.sh +791 -0
  24. data/scripts/install-preview-generator.sh +531 -0
  25. data/scripts/lib/README.md +291 -0
  26. data/scripts/lib/changelog.sh +313 -0
  27. data/scripts/lib/common.sh +154 -0
  28. data/scripts/lib/gem.sh +226 -0
  29. data/scripts/lib/git.sh +205 -0
  30. data/scripts/lib/preview_generator.py +646 -0
  31. data/scripts/lib/test/run_tests.sh +140 -0
  32. data/scripts/lib/test/test_changelog.sh +87 -0
  33. data/scripts/lib/test/test_gem.sh +68 -0
  34. data/scripts/lib/test/test_git.sh +82 -0
  35. data/scripts/lib/test/test_validation.sh +72 -0
  36. data/scripts/lib/test/test_version.sh +96 -0
  37. data/scripts/lib/validation.sh +139 -0
  38. data/scripts/lib/version.sh +178 -0
  39. data/scripts/release +240 -0
  40. data/scripts/setup.sh +155 -0
  41. data/scripts/test/integration/auto-version +243 -0
  42. data/scripts/test/integration/mermaid +252 -0
  43. data/scripts/test/lib/run_tests.sh +151 -0
  44. data/scripts/test/lib/test_changelog.sh +90 -0
  45. data/scripts/test/lib/test_gem.sh +71 -0
  46. data/scripts/test/lib/test_git.sh +85 -0
  47. data/scripts/test/lib/test_validation.sh +75 -0
  48. data/scripts/test/lib/test_version.sh +101 -0
  49. data/scripts/test/theme/validate +120 -0
  50. data/scripts/test-auto-version.sh +260 -0
  51. data/scripts/test-mermaid.sh +251 -0
  52. data/scripts/test.sh +156 -0
  53. data/scripts/utils/analyze-commits +300 -0
  54. data/scripts/utils/fix-markdown +251 -0
  55. data/scripts/utils/setup +137 -0
  56. data/scripts/version.sh +178 -0
  57. metadata +50 -2
@@ -0,0 +1,265 @@
1
+ #!/usr/bin/env bash
2
+
3
+ #
4
+ # Markdown Formatting Fix Script
5
+ # Addresses common markdown linting violations across the repository
6
+ #
7
+
8
+ set -euo pipefail
9
+
10
+ # Configuration
11
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
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