Simplify readme generation.

master
Magnar Sveen 14 years ago
parent e7d5c010b4
commit 1b0d54f1bc
  1. 1
      README.md
  2. 29
      examples-to-docs.el
  3. 31
      readme-prefix.md
  4. 46
      readme-template.md

@ -197,6 +197,7 @@ or with `!compare-fn` if that's non-nil.
(!contains? '(1 2 3) 4) ;; => nil
```
## Development
Run the tests with

@ -55,29 +55,22 @@
(delete-char 7)
(insert "'"))))
(defun goto-and-remove (s)
(goto-char (point-min))
(search-forward s)
(delete-char (- (length s))))
(defun create-docs-file ()
(let ((functions (nreverse functions)))
(with-temp-file "./README.md"
(insert-file-contents-literally "./readme-prefix.md")
(goto-char (point-max))
(newline)
(insert "## Available functions")
(newline 2)
(insert "```cl")
(newline)
(insert-file-contents-literally "./readme-template.md")
(goto-and-remove "[[ function-list ]]")
(insert (mapconcat 'function-summary functions "\n"))
(newline)
(insert "```")
(newline 2)
(insert "There are also anaphoric versions of these
functions where that makes sense, prefixed with two bangs
instead of one.")
(newline 2)
(insert "## Documentation and examples")
(newline 2)
(goto-and-remove "[[ function-docs ]]")
(insert (mapconcat 'function-to-md functions "\n"))
(newline)
(insert-file-contents-literally "./readme-postfix.md")
(simplify-quotes))))
(defun three-first (list)

@ -1,31 +0,0 @@
# bang.el [![Build Status](https://secure.travis-ci.org/magnars/bang.el.png)](http://travis-ci.org/magnars/bang.el)
The startings of a modern list api for Emacs. Does not require 'cl.
We're looking to Clojure for naming and signatures.
## Warning
This is so much a work in progress that you should definitely not be using it yet.
## Anaphoric functions
While `!filter` takes a function to filter the list by, you can also use the
anaphoric form with double bangs - which will then be executed with `it` exposed
as the list item. Here's an example:
```cl
(!filter (lambda (num) (= 0 (% num 2))) '(1 2 3 4)) ;; normal version
(!!filter (= 0 (% it 2)) '(1 2 3 4)) ;; anaphoric version
```
of course the original can also be written like
```cl
(defun even? (num) (= 0 (% num 2)))
(!filter even? '(1 2 3 4))
```
which demonstrates the usefulness of both versions.

@ -1,3 +1,49 @@
# bang.el [![Build Status](https://secure.travis-ci.org/magnars/bang.el.png)](http://travis-ci.org/magnars/bang.el)
The startings of a modern list api for Emacs. Does not require 'cl.
We're looking to Clojure for naming and signatures.
## Warning
This is so much a work in progress that you should definitely not be using it yet.
## Anaphoric functions
While `!filter` takes a function to filter the list by, you can also use the
anaphoric form with double bangs - which will then be executed with `it` exposed
as the list item. Here's an example:
```cl
(!filter (lambda (num) (= 0 (% num 2))) '(1 2 3 4)) ;; normal version
(!!filter (= 0 (% it 2)) '(1 2 3 4)) ;; anaphoric version
```
of course the original can also be written like
```cl
(defun even? (num) (= 0 (% num 2)))
(!filter even? '(1 2 3 4))
```
which demonstrates the usefulness of both versions.
## Available functions
```cl
[[ function-list ]]
```
There are also anaphoric versions of these
functions where that makes sense, prefixed with two bangs
instead of one.
## Documentation and examples
[[ function-docs ]]
## Development
Run the tests with
Loading…
Cancel
Save