2021-01-30 20:15:59 +03:00
|
|
|
# A Script to try and create the table for the readme.md file
|
2021-05-19 15:50:57 +03:00
|
|
|
# | Category | File |
|
|
|
|
# | ---------------- | ----------------------------------------------------------------------------- |
|
|
|
|
# | coloring | [24bit-1.nu](./coloring\24bit-1.nu) |
|
|
|
|
# | coloring | [color_table.nu](./coloring\color_table.nu) |
|
|
|
|
# | coloring | [color_tables.nu](./coloring\color_tables.nu) |
|
|
|
|
# | coloring | [gradient.nu](./coloring\gradient.nu) |
|
2021-01-30 20:15:59 +03:00
|
|
|
|
|
|
|
# Right now there is still manual manipulation in order to update the README.md
|
|
|
|
# Hopefully, in the future someone will contribute a script to make this automatic.
|
|
|
|
|
2021-05-19 15:50:57 +03:00
|
|
|
let nu_files = (ls **/*.nu)
|
|
|
|
let nu_table = (echo $nu_files |
|
2021-01-30 20:15:59 +03:00
|
|
|
get name |
|
2021-05-19 15:50:57 +03:00
|
|
|
wrap File |
|
2021-05-25 00:24:34 +03:00
|
|
|
insert Category { |it|
|
|
|
|
let cat = (echo $it.File | path dirname)
|
2021-05-26 20:34:59 +03:00
|
|
|
|
2021-01-30 20:15:59 +03:00
|
|
|
if $cat == "" {
|
2021-05-24 21:37:07 +03:00
|
|
|
"not assigned yet"
|
2021-01-30 20:15:59 +03:00
|
|
|
} {
|
2021-05-24 21:37:07 +03:00
|
|
|
$cat
|
2021-01-30 20:15:59 +03:00
|
|
|
}
|
2021-05-19 15:50:57 +03:00
|
|
|
} | where Category !~ ".git" | select Category File | sort-by Category)
|
2021-01-30 20:15:59 +03:00
|
|
|
|
|
|
|
# Let's fix the file now
|
2021-05-25 00:24:34 +03:00
|
|
|
let nu_table = (echo $nu_table | update File { |it|
|
|
|
|
let file_path = (echo $it.File)
|
2021-05-19 15:50:57 +03:00
|
|
|
let file_name = (echo $file_path | path basename)
|
|
|
|
let file_link = (build-string "[" $file_name "]" "(./" $file_path ")")
|
2021-01-30 20:15:59 +03:00
|
|
|
echo $file_link
|
|
|
|
})
|
2021-05-24 21:37:07 +03:00
|
|
|
$nu_table | to md --pretty
|