mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Generates sexp API index
This commit is contained in:
parent
265e34ee08
commit
84edc9dc89
1 changed files with 28 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
|||
# Cyclone Scheme
|
||||
# https://github.com/justinethier/cyclone
|
||||
#
|
||||
# Copyright (c) 2014-2016, Justin Ethier
|
||||
# Copyright (c) 2014-2022, Justin Ethier
|
||||
# All rights reserved.
|
||||
#
|
||||
# Generate a sorted list of functions/variables from the API documentation.
|
||||
|
@ -18,3 +18,30 @@ grep -r "^- \[" docs/api/srfi/* | ./scripts/convert-doc-index >> $TMP
|
|||
grep -r "^\[" docs/api/srfi/* | ./scripts/convert-doc-index >> $TMP
|
||||
grep -r "^\[" docs/api/cyclone/* | ./scripts/convert-doc-index >> $TMP
|
||||
sort $TMP | ./scripts/alphabetize > $API
|
||||
|
||||
# --------------------------------------------------------------------------------
|
||||
# Index with SEXP format (needed by Winds)
|
||||
# The sed command bellow transforms...
|
||||
|
||||
# ; newline
|
||||
#- - - ; hyphens used as sections divs
|
||||
#[`abs`](api/scheme/base.md#abs) ; Markdown link
|
||||
#[`acos`](api/scheme/inexact.md#acos) ; Markdown link
|
||||
|
||||
# ...into...
|
||||
|
||||
#((abs (scheme base)) ; ((definition1 library-that-contains-it)
|
||||
# (acos (scheme inexact))) ; (definition2 library-that-contains-it))
|
||||
|
||||
API_SEXP=api-index.scm
|
||||
sed -e '/^-\|^$/d' \
|
||||
-e 's/\[`/(/' \
|
||||
-e 's/`\](api\// (/' \
|
||||
-e 's/.md.*$/))/' \
|
||||
-e 's/\// /g' \
|
||||
-e 's/[[:space:]]\+/ /g' $API > $API_SEXP
|
||||
|
||||
# Add extra opening and closing parentheses
|
||||
sed -e '1s/^/(/' \
|
||||
-e '$s/$/)/' \
|
||||
-i $API_SEXP
|
||||
|
|
Loading…
Add table
Reference in a new issue