aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-08-23 07:31:08 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-08-23 07:31:08 -0400
commitb278e8ae25e18bf1f3491ee94e4809c0f5d03c23 (patch)
tree43791340da13b650c8514dba6c99235188de4e08
parent68a6d369290859aa3188c79ed7d73db58e9ac234 (diff)
Use •file in md.bqn
-rw-r--r--md.bqn12
1 files changed, 6 insertions, 6 deletions
diff --git a/md.bqn b/md.bqn
index 97ff3e1b..1b9c82f6 100644
--- a/md.bqn
+++ b/md.bqn
@@ -158,7 +158,7 @@ _getCodeExec ← {𝕗⋄•MakeREPL@}
_getSvgExec ← {𝕗
e←•MakeREPL@
⟨"","",GetHighlights‿Modify‿E⟩ E "GetHighlights‿Modify‿Eval←•args"
- E•FChars"svg.bqn"
+ E •file.Chars "svg.bqn"
JoinLines⍟(1<≡)∘E
}
@@ -308,8 +308,8 @@ Markdown ← {filename𝕊𝕩:
IsHtmlBlock ← ("<!--"≡4↑⊢)◶('>'∨´∘=⊢)‿2
ProcComment ← {
n←≠s←"<!--GEN" ⋄ l←¯3↓⍟(1=≠𝕩)⊑𝕩 ⋄ a←s≡n↑l
- Source ← {((0<≠)◶<‿(•FLines path∾⊢) Trim n↓l) ∾ 1↓¯1↓𝕩}
- ⟨path⟩ GenHtml⍟a JoinLines Source⍟a 𝕩
+ Source ← {((0<≠)◶<‿(•file.Lines path∾⊢) Trim n↓l) ∾ 1↓¯1↓𝕩}
+ ⟨•file.At path⟩ GenHtml⍟a JoinLines Source⍟a 𝕩
}
ProcHtml ← {
codeMask ← "<code>" (6⥊0)⊸»⊸(>○(⌈`(1+↕∘≠)⊸×))○((≠𝕩)↑⍷⟜𝕩) "</code>"
@@ -508,7 +508,7 @@ Markdown ← {filename𝕊𝕩:
# Uses the test cases at https://spec.commonmark.org/0.29/spec.json
# since Github doesn't seem to have published theirs
TestSections ← {
- tests ← ¯2 ↓˘ 8⊸(÷˜⟜≠∾⊣)⊸⥊ 2↓•FLines"spec.json"
+ tests ← ¯2 ↓˘ 8⊸(÷˜⟜≠∾⊣)⊸⥊ 2↓•file.Lines"spec.json"
tests ↩ ((⊑2+⊐⟜':')¨∘⊏ ((-','=¯1⊑⊢)↓↓)¨⎉1 ⊢) tests
testSection ← (1↓¯1↓⊢)¨ 5⊏˘tests
UnEscape ← {
@@ -634,7 +634,7 @@ ConvertFile ← {
fileout ← ".html" ∾˜ (¯6⊸↓∾"index"˙)⍟("README"⊸MatchEnd) ¯3↓𝕩
# Contents of file to convert
- md ← •FLines 𝕩
+ md ← •file.Lines 𝕩
# Verify and remove the html link line: the output *is* the html file.
IsView ← "*View this file"⊸MatchStart ∧ (siteURL∾fileout∾").*")⊸MatchEnd
⟨"File ",𝕩," has missing or incorrect view link"⟩ ∾⊸! IsView ⊑md
@@ -656,7 +656,7 @@ ConvertFile ← {
crumbs ← up ("a href='"∾∾⟜"index.html'")⊸Html¨○((-isInd)⊸↓) (<"BQN")»parts
nav ← RQ "div class='nav'" Html 3↓∾ " / "⊸∾¨ repo <⊸∾ crumbs
front ← head ∾○(∾⟜lf) nav
- ("docs/"∾fileout) •FChars front ∾ out
+ ("docs/"∾fileout) •file.Chars front ∾ out
}
ConvertFile¨ •args