|
| 1 | +#!/usr/bin/perl |
| 2 | +use strict; |
| 3 | +use warnings; |
| 4 | + |
| 5 | +my @colorscheme; |
| 6 | +my @syntax; |
| 7 | +my @language; |
| 8 | +my @formatter; |
| 9 | +my @linter; |
| 10 | +my @spell; |
| 11 | +my @search; |
| 12 | +my @manager; |
| 13 | +my @runner; |
| 14 | +my @cursor; |
| 15 | +my @selection; |
| 16 | +my @snippet_abbrev; |
| 17 | +my @git_integration; |
| 18 | +my @markdown_doc_tools; |
| 19 | +my @time_tracker; |
| 20 | +my @wiki_notes; |
| 21 | +my @ui_enhancement; |
| 22 | +my @uncategorized; |
| 23 | + |
| 24 | +while (<STDIN>) { |
| 25 | + chomp; |
| 26 | + next unless /^\* \[(.*?)\]\((.*?)\) : (.+)$/; |
| 27 | + |
| 28 | + my ($title, $url, $desc) = ($1, $2, $3); |
| 29 | + my $line = "* [$title]($url) : $desc"; |
| 30 | + my $eval = "$title: : $desc"; |
| 31 | + |
| 32 | + my $found = 0; |
| 33 | + if ($eval =~ /(color|scheme|colorscheme)/i) { |
| 34 | + push @colorscheme, $line; |
| 35 | + $found = 1; |
| 36 | + } |
| 37 | + if ($eval =~ /(syntax)/i) { |
| 38 | + push @syntax, $line; |
| 39 | + $found = 1; |
| 40 | + } |
| 41 | + if ($eval =~ /(lang)/i) { |
| 42 | + push @language, $line; |
| 43 | + $found = 1; |
| 44 | + } |
| 45 | + if ($eval =~ /(format|fmt)/i) { |
| 46 | + push @formatter, $line; |
| 47 | + $found = 1; |
| 48 | + } |
| 49 | + if ($eval =~ /(lint)/i) { |
| 50 | + push @linter, $line; |
| 51 | + $found = 1; |
| 52 | + } |
| 53 | + if ($eval =~ /(spell)/i) { |
| 54 | + push @spell, $line; |
| 55 | + $found = 1; |
| 56 | + } |
| 57 | + if ($eval =~ /(search)/i) { |
| 58 | + push @search, $line; |
| 59 | + $found = 1; |
| 60 | + } |
| 61 | + if ($eval =~ /(manager)/i) { |
| 62 | + push @manager, $line; |
| 63 | + $found = 1; |
| 64 | + } |
| 65 | + if ($eval =~ /(run|exec)/i) { |
| 66 | + push @runner, $line; |
| 67 | + $found = 1; |
| 68 | + } |
| 69 | + if ($eval =~ /(cursor)/i) { |
| 70 | + push @cursor, $line; |
| 71 | + $found = 1; |
| 72 | + } |
| 73 | + if ($eval =~ /(select)/i) { |
| 74 | + push @selection, $line; |
| 75 | + $found = 1; |
| 76 | + } |
| 77 | + if ($eval =~ /(snippet|abbrev|macro)/i) { |
| 78 | + push @snippet_abbrev, $line; |
| 79 | + $found = 1; |
| 80 | + } |
| 81 | + if ($eval =~ /(git|blame|status)/i) { |
| 82 | + push @git_integration, $line; |
| 83 | + $found = 1; |
| 84 | + } |
| 85 | + if ($eval =~ /(markdown|pandoc|preview)/i) { |
| 86 | + push @markdown_doc_tools, $line; |
| 87 | + $found = 1; |
| 88 | + } |
| 89 | + if ($eval =~ /(time|tracker)/i) { |
| 90 | + push @time_tracker, $line; |
| 91 | + $found = 1; |
| 92 | + } |
| 93 | + if ($eval =~ /(wiki|journal)/i) { |
| 94 | + push @wiki_notes, $line; |
| 95 | + $found = 1; |
| 96 | + } |
| 97 | + if ($eval =~ /(statusline|tooltip|resize|tab)/i) { |
| 98 | + push @ui_enhancement, $line; |
| 99 | + $found = 1; |
| 100 | + } |
| 101 | + |
| 102 | + if (!$found) { |
| 103 | + push @uncategorized, $line; |
| 104 | + } |
| 105 | +} |
| 106 | + |
| 107 | +sub print_section { |
| 108 | + my ($title, $entries) = @_; |
| 109 | + return unless @$entries; |
| 110 | + print "### $title\n\n"; |
| 111 | + print "$_\n" for @$entries; |
| 112 | + print "\n"; |
| 113 | +} |
| 114 | + |
| 115 | +print_section("Color Scheme", \@colorscheme); |
| 116 | +print_section("Syntax", \@syntax); |
| 117 | +print_section("Language", \@language); |
| 118 | +print_section("Formatter", \@formatter); |
| 119 | +print_section("Linter", \@linter); |
| 120 | +print_section("Spell Checker", \@spell); |
| 121 | +print_section("Search", \@search); |
| 122 | +print_section("File Manager", \@manager); |
| 123 | +print_section("Runner / Executor", \@runner); |
| 124 | +print_section("Cursor", \@cursor); |
| 125 | +print_section("Selection", \@selection); |
| 126 | +print_section("Snippet / Abbrev", \@snippet_abbrev); |
| 127 | +print_section("Git Integration", \@git_integration); |
| 128 | +print_section("Markdown / Doc Tools", \@markdown_doc_tools); |
| 129 | +print_section("Time / Tracker", \@time_tracker); |
| 130 | +print_section("Wiki / Notes", \@wiki_notes); |
| 131 | +print_section("UI Enhancement", \@ui_enhancement); |
| 132 | +print_section("Uncategorized", \@uncategorized); |
0 commit comments