mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Initial file
This commit is contained in:
parent
cf2e39bdd7
commit
9527c2d6d6
1 changed files with 29 additions and 0 deletions
29
generate-doc-index.scm
Normal file
29
generate-doc-index.scm
Normal file
|
@ -0,0 +1,29 @@
|
|||
(import
|
||||
(scheme base)
|
||||
(scheme write)
|
||||
(scheme cyclone util)
|
||||
(srfi 1))
|
||||
|
||||
;; TODO: move this somewhere useful
|
||||
(define (index-of lst x)
|
||||
(define (find lst idx)
|
||||
(cond
|
||||
((null? lst) #f)
|
||||
((eq? (car lst) x) idx)
|
||||
(else (find (cdr lst) (+ idx 1)))))
|
||||
(find lst 0))
|
||||
|
||||
;; goal is:
|
||||
;; [`load`](api/scheme/load.md#load)
|
||||
;(define line "docs/api/scheme/base.md:- [`denominator`](#denominator)")
|
||||
(define line "docs/api/scheme/process-context.md:- [`get-environment-variables`](#get-environment-variables)")
|
||||
(let* ((lis (string->list line))
|
||||
(s-file 5)
|
||||
(e-file (index-of lis #\:))
|
||||
(file (substring line s-file e-file))
|
||||
(s-fnc (+ 1 (index-of lis #\`)))
|
||||
(e-fnc (+ s-fnc (index-of (string->list (substring line (+ 0 s-fnc) (string-length line))) #\`)))
|
||||
(fnc (substring line s-fnc e-fnc)))
|
||||
(display
|
||||
(string-append
|
||||
"[`" fnc "`](" file "#" fnc ")")))
|
Loading…
Add table
Reference in a new issue