mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
ingest JavaScript map to nu to md
You can create JavaScript `Map`'s from arrays. When encoded as JSON they can be shared to nu and easily converted to markdown for documentation and the like.
This commit is contained in:
parent
161bd55c99
commit
079bd207c5
2 changed files with 8 additions and 0 deletions
2
cool_oneliners/js_map_to_markdown.nu
Normal file
2
cool_oneliners/js_map_to_markdown.nu
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Ingest JavaScript Map JSON into nu then to markdown
|
||||
open ../sample_data/js_map.json | each { echo [[Español English]; [ $it.0 $it.1]] } | to md
|
6
sample_data/js_map.json
Normal file
6
sample_data/js_map.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
["cero", "zero"],
|
||||
["uno", "one"],
|
||||
["dos", "two"],
|
||||
["tres", "three"]
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue