blob: 71251d01945d6ee0c39b4b4c15c24725eba48908 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/usr/bin/env bqn
files ← "README.md"⊸≢¨⊸/ (⍋(¬∊⟜"_.")⊸/¨)⊸⊏ ".md"⊸(-∘≠⊸↑≡⊣)¨⊸/ •file.List ""
gl ← "+-×÷⋆√⌊⌈∧∨¬|≤<>≥=≠≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!˙˜∘○⊸⟜⌾⊘◶⎊⎉˘⚇¨⌜⍟⁼´˝`←⇐↩⋄,.(){};:?⟨⟩‿·•𝕨𝕎𝕩𝕏𝕗𝔽𝕘𝔾𝕤𝕊𝕣¯π∞@#"
rows ← (⍋gl⊸⊐)⊸⊏˝⍉> {
data ← •FLines 𝕩
names ← (⊣∾", "∾⊢)´{(¬·∧`' '⊸=)⊸/⌾⌽(»·∧`⌾⌽':'⊸≠)⊸/𝕩}¨("## "≡3⊸↑)¨⊸/data
t‿d ← ∾/¨(⊏data)=¨"()"
sym ← (+`·»⊸-˝(¬»∧«)∘=⟜'`'∧⎉1"()"=⌜⊢)⊸/ 2⊑data
g ← 1⊑sym
sym (1+'|'⊸=)⊸(/+(-´"\|")×{«⊒/𝕨})↩
sym "`,` or `⋄`"⍟("`,``⋄`"⊸≡)↩
⟨g, ∾"| "‿sym‿" | ["‿names‿"]("‿𝕩‿") |"⟩
}¨ files
head ← ⟨
"*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/index.html).*"
⟨⟩
"# REPL Help"
⟨⟩
"| Symbol | Link |"
"|--------|------|"
⟩
"README.md" •FLines head ∾ rows
|