Skip to content

Commit 156551b

Browse files
authored
ci: auto-update rank index (#756)
* ci: auto-update rank index * chore: extend indices with challenge ID
1 parent b1d0260 commit 156551b

File tree

10 files changed

+1511
-1645
lines changed

10 files changed

+1511
-1645
lines changed

.github/workflows/kata-pr-init.yml

+13
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ jobs:
4545
echo "$DESC"
4646
} > "$BASEDIR/README.md"
4747
48+
- name: Update index
49+
env:
50+
JSON: ${{ steps.kata.outputs.json }}
51+
run: |
52+
RANK=$(echo $JSON | jq -r '.rank.name // "beta"' | sed 's/ /-/g')
53+
base_dir="./kata/$RANK"
54+
for d in "$base_dir"/*/; do
55+
[[ -f "$d/README.md" ]] || { echo "WARN: No README.md in $d" >&2; continue; }
56+
title=$(sed -n '1s/^# \[\(.\)\(.*\)\](.*$/\1\2/p' "$d/README.md")
57+
id=$(sed -n '1s/.*\/\([^"]*\)".*$/\1/p' "$d/README.md")
58+
echo "- [$title]($(basename "$d") \"$id\")"
59+
done > "$base_dir/index.md"
60+
4861
- name: Commit changes
4962
id: git
5063
env:

kata/2-kyu/index.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# E
2-
- [Evaluate mathematical expression](evaluate-mathematical-expression)
1+
- [Evaluate mathematical expression](evaluate-mathematical-expression "52a78825cdfc2cfc87000005")

kata/3-kyu/index.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
# M
2-
- [Make a spiral](make-a-spiral)
3-
# P
4-
- [Path Finder #3: the Alpinist](path-finder-number-3-the-alpinist)
1+
- [Make a spiral](make-a-spiral "534e01fbbb17187c7e0000c6")
2+
- [Path Finder #3: the Alpinist](path-finder-number-3-the-alpinist "576986639772456f6f00030c")

kata/4-kyu/index.md

+26-39
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,26 @@
1-
# A
2-
- [Adding Big Numbers](adding-big-numbers)
3-
# C
4-
- [Catching Car Mileage Numbers](catching-car-mileage-numbers)
5-
- [Codewars style ranking system](codewars-style-ranking-system)
6-
- [Connect Four](connect-four-1)
7-
# D
8-
- [Decode the Morse code, advanced](decode-the-morse-code-advanced)
9-
# E
10-
- [Escaping The Matrix](escaping-the-matrix)
11-
# F
12-
- [Find the unknown digit](find-the-unknown-digit)
13-
# H
14-
- [Human readable duration format](human-readable-duration-format)
15-
# L
16-
- [Last digits of N^2 == N](last-digits-of-n-2-equals-equals-n)
17-
# M
18-
- [Matrix Determinant](matrix-determinant)
19-
- [Most frequently used words in a text](most-frequently-used-words-in-a-text)
20-
# N
21-
- [Next bigger number with the same digits](next-bigger-number-with-the-same-digits)
22-
# P
23-
- [ParseInt() reloaded](parseint-reloaded)
24-
- [Pyramid Slide Down](pyramid-slide-down)
25-
# R
26-
- [Range Extraction](range-extraction)
27-
- [Recover a secret string from random triplets](recover-a-secret-string-from-random-triplets)
28-
- [Roman Numerals Helper](roman-numerals-helper)
29-
# S
30-
- [Snail](snail)
31-
- [So Many Permutations!](so-many-permutations)
32-
- [Strings Mix](strings-mix)
33-
- [Strip Comments](strip-comments)
34-
- [Sum by Factors](sum-by-factors)
35-
- [Sum of Intervals](sum-of-intervals)
36-
- [Sum Strings as Numbers](sum-strings-as-numbers)
37-
# T
38-
- [The observed PIN](the-observed-pin)
39-
- [Twice linear](twice-linear)
1+
- [Adding Big Numbers](adding-big-numbers "525f4206b73515bffb000b21")
2+
- [Catching Car Mileage Numbers](catching-car-mileage-numbers "52c4dd683bfd3b434c000292")
3+
- [Codewars style ranking system](codewars-style-ranking-system "51fda2d95d6efda45e00004e")
4+
- [Connect Four](connect-four-1 "56882731514ec3ec3d000009")
5+
- [Decode the Morse code, advanced](decode-the-morse-code-advanced "54b72c16cd7f5154e9000457")
6+
- [Escaping The Matrix](escaping-the-matrix "5595c56aa6ca910f27000155")
7+
- [Find the unknown digit](find-the-unknown-digit "546d15cebed2e10334000ed9")
8+
- [Human readable duration format](human-readable-duration-format "52742f58faf5485cae000b9a")
9+
- [Last digits of N^2 == N](last-digits-of-n-2-equals-equals-n "584dee06fe9c9aef810001e8")
10+
- [Matrix Determinant](matrix-determinant "52a382ee44408cea2500074c")
11+
- [Most frequently used words in a text](most-frequently-used-words-in-a-text "51e056fe544cf36c410000fb")
12+
- [Next bigger number with the same digits](next-bigger-number-with-the-same-digits "55983863da40caa2c900004e")
13+
- [parseInt() reloaded](parseint-reloaded "525c7c5ab6aecef16e0001a5")
14+
- [Pyramid Slide Down](pyramid-slide-down "551f23362ff852e2ab000037")
15+
- [Range Extraction](range-extraction "51ba717bb08c1cd60f00002f")
16+
- [Recover a secret string from random triplets](recover-a-secret-string-from-random-triplets "53f40dff5f9d31b813000774")
17+
- [Roman Numerals Helper](roman-numerals-helper "51b66044bce5799a7f000003")
18+
- [Snail](snail "521c2db8ddc89b9b7a0000c1")
19+
- [So Many Permutations!](so-many-permutations "5254ca2719453dcc0b00027d")
20+
- [Strings Mix](strings-mix "5629db57620258aa9d000014")
21+
- [Strip Comments](strip-comments "51c8e37cee245da6b40000bd")
22+
- [Sum by Factors](sum-by-factors "54d496788776e49e6b00052f")
23+
- [Sum of Intervals](sum-of-intervals "52b7ed099cdc285c300001cd")
24+
- [Sum Strings as Numbers](sum-strings-as-numbers "5324945e2ece5e1f32000370")
25+
- [The observed PIN](the-observed-pin "5263c6999e0f40dee200059d")
26+
- [Twice linear](twice-linear "5672682212c8ecf83e000050")

kata/5-kyu/index.md

+48-66
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,48 @@
1-
# A
2-
- [A Man and his Umbrellas](a-man-and-his-umbrellas)
3-
- [A Simple Music Encoder](a-simple-music-encoder)
4-
- [Airport Arrivals/Departures - #1](airport-arrivals-slash-departures-number-1)
5-
# B
6-
- [Best travel](best-travel)
7-
# C
8-
- [Calculate Fibonacci return count of digit occurrences](calculate-fibonacci-return-count-of-digit-occurrences)
9-
- [Can you get the loop ?](can-you-get-the-loop)
10-
- [Common Denominators](common-denominators)
11-
- [Containers](containers)
12-
- [Convert A Hex String To RGB](convert-a-hex-string-to-rgb)
13-
- [Count IP Addresses](count-ip-addresses)
14-
# D
15-
- [Digits](digits)
16-
- [Directions Reduction](directions-reduction)
17-
# F
18-
- [Fibonacci Streaming](fibonacci-streaming)
19-
- [First non-repeating character](first-non-repeating-character)
20-
- [First Variation on Caesar Cipher](first-variation-on-caesar-cipher)
21-
# G
22-
- [Gap in Primes](gap-in-primes)
23-
- [Greed is Good](greed-is-good)
24-
# H
25-
- [Human Readable Time](human-readable-time)
26-
# I
27-
- [Int32 to IPv4](int32-to-ipv4)
28-
- [Integers: Recreation One](integers-recreation-one)
29-
- [Is my friend cheating?](is-my-friend-cheating)
30-
- [Is the King in check ?](is-the-king-in-check)
31-
# J
32-
- [Josephus Permutation](josephus-permutation)
33-
- [Josephus Survivor](josephus-survivor)
34-
# L
35-
- [Land perimeter](land-perimeter)
36-
- [Last digit of a large number](last-digit-of-a-large-number)
37-
- [Let's Play Darts!](lets-play-darts)
38-
# M
39-
- [Maximum Contiguous Sum](maximum-contiguous-sum)
40-
- [Maximum subarray sum](maximum-subarray-sum)
41-
- [Mean Square Error](mean-square-error)
42-
- [Merged String Checker](merged-string-checker)
43-
# N
44-
- [Not very secure](not-very-secure)
45-
- [Number of trailing zeros of N!](number-of-trailing-zeros-of-n)
46-
# O
47-
- [One-Semicolon Fibonacci Stream](one-semicolon-fibonacci-stream)
48-
# P
49-
- [PaginationHelper](paginationhelper)
50-
- [Perimeter of squares in a rectangle](perimeter-of-squares-in-a-rectangle)
51-
- [Pete, the baker](pete-the-baker)
52-
- [Pick peaks](pick-peaks)
53-
- [Primes in numbers](primes-in-numbers)
54-
- [Product of consecutive Fib numbers](product-of-consecutive-fib-numbers)
55-
# R
56-
- [RGB To Hex Conversion](rgb-to-hex-conversion)
57-
- [ROT13](rot13)
58-
# S
59-
- [Scramblies](scramblies)
60-
- [Simple Pig Latin](simple-pig-latin)
61-
- [String incrementer](string-incrementer)
62-
# T
63-
- [Tic-Tac-Toe Checker](tic-tac-toe-checker)
64-
# W
65-
- [Weight for weight](weight-for-weight)
66-
- [What's a Perfect Power anyway?](whats-a-perfect-power-anyway)
1+
- [A Man and his Umbrellas](a-man-and-his-umbrellas "58298e19c983caf4ba000c8d")
2+
- [A Simple Music Encoder](a-simple-music-encoder "58db9545facc51e3db00000a")
3+
- [Airport Arrivals/Departures - #1](airport-arrivals-slash-departures-number-1 "57feb00f08d102352400026e")
4+
- [Best travel](best-travel "55e7280b40e1c4a06d0000aa")
5+
- [Calculate Fibonacci return count of digit occurrences](calculate-fibonacci-return-count-of-digit-occurrences "5779f894ec8832493f00002d")
6+
- [Can you get the loop ?](can-you-get-the-loop "52a89c2ea8ddc5547a000863")
7+
- [Common Denominators](common-denominators "54d7660d2daf68c619000d95")
8+
- [Containers](containers "5b80dea49895f71f3e00002d")
9+
- [Convert A Hex String To RGB](convert-a-hex-string-to-rgb "5282b48bb70058e4c4000fa7")
10+
- [Count IP Addresses](count-ip-addresses "526989a41034285187000de4")
11+
- [Digits](digits "638b042bf418c453377f28ad")
12+
- [Directions Reduction](directions-reduction "550f22f4d758534c1100025a")
13+
- [Fibonacci Streaming](fibonacci-streaming "55695bc4f75bbaea5100016b")
14+
- [First non-repeating character](first-non-repeating-character "52bc74d4ac05d0945d00054e")
15+
- [First Variation on Caesar Cipher](first-variation-on-caesar-cipher "5508249a98b3234f420000fb")
16+
- [Gap in Primes](gap-in-primes "561e9c843a2ef5a40c0000a4")
17+
- [Greed is Good](greed-is-good "5270d0d18625160ada0000e4")
18+
- [Human Readable Time](human-readable-time "52685f7382004e774f0001f7")
19+
- [int32 to IPv4](int32-to-ipv4 "52e88b39ffb6ac53a400022e")
20+
- [Integers: Recreation One](integers-recreation-one "55aa075506463dac6600010d")
21+
- [Is my friend cheating?](is-my-friend-cheating "5547cc7dcad755e480000004")
22+
- [Is the King in check ?](is-the-king-in-check "5e28ae347036fa001a504bbe")
23+
- [Josephus Permutation](josephus-permutation "5550d638a99ddb113e0000a2")
24+
- [Josephus Survivor](josephus-survivor "555624b601231dc7a400017a")
25+
- [Land perimeter](land-perimeter "5839c48f0cf94640a20001d3")
26+
- [Last digit of a large number](last-digit-of-a-large-number "5511b2f550906349a70004e1")
27+
- [Let's Play Darts!](lets-play-darts "5870db16056584eab0000006")
28+
- [Maximum Contiguous Sum](maximum-contiguous-sum "52f4261c95d6bff39a003096")
29+
- [Maximum subarray sum](maximum-subarray-sum "54521e9ec8e60bc4de000d6c")
30+
- [Mean Square Error](mean-square-error "51edd51599a189fe7f000015")
31+
- [Merged String Checker](merged-string-checker "54c9fcad28ec4c6e680011aa")
32+
- [Not very secure](not-very-secure "526dbd6c8c0eb53254000110")
33+
- [Number of trailing zeros of N!](number-of-trailing-zeros-of-n "52f787eb172a8b4ae1000a34")
34+
- [One-Semicolon Fibonacci Stream](one-semicolon-fibonacci-stream "59e625bf3d09a7471d00020e")
35+
- [PaginationHelper](paginationhelper "515bb423de843ea99400000a")
36+
- [Perimeter of squares in a rectangle](perimeter-of-squares-in-a-rectangle "559a28007caad2ac4e000083")
37+
- [Pete, the baker](pete-the-baker "525c65e51bf619685c000059")
38+
- [Pick peaks](pick-peaks "5279f6fe5ab7f447890006a7")
39+
- [Primes in numbers](primes-in-numbers "54d512e62a5e54c96200019e")
40+
- [Product of consecutive Fib numbers](product-of-consecutive-fib-numbers "5541f58a944b85ce6d00006a")
41+
- [RGB To Hex Conversion](rgb-to-hex-conversion "513e08acc600c94f01000001")
42+
- [ROT13](rot13 "52223df9e8f98c7aa7000062")
43+
- [Scramblies](scramblies "55c04b4cc56a697bb0000048")
44+
- [Simple Pig Latin](simple-pig-latin "520b9d2ad5c005041100000f")
45+
- [String incrementer](string-incrementer "54a91a4883a7de5d7800009c")
46+
- [Tic-Tac-Toe Checker](tic-tac-toe-checker "525caa5c1bf619d28c000335")
47+
- [Weight for weight](weight-for-weight "55c6126177c9441a570000cc")
48+
- [What's a Perfect Power anyway?](whats-a-perfect-power-anyway "54d4c8b08776e4ad92000835")

0 commit comments

Comments
 (0)