Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NB. blocks: given a filename, answers a list of code block start
- NB. and stop lines. MUTATIONS: body, lines
- NB. pairs = I.>cblk each LF chopstring 1!:1<'smallfile.md'
- NB.
- blocks =: monad define NB. 3 : 0
- body =: 1!:1<y NB. body is raw file, global scope
- lines =: LF chopstring body NB. lines now scanned, global scope
- pairs =. I.>cblk each lines NB. consecutive start/stops, could be uneven
- bump =. 2|#pairs NB. bump is 1 for odd pairs allowing us to
- (bump+#pairs){.!.(#lines) pairs NB. fill with the max line ensuring even pairs
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement