[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 1b0d54f 044/426: Simplify readme generation.
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 1b0d54f 044/426: Simplify readme generation. |
Date: |
Tue, 04 Aug 2015 19:36:36 +0000 |
branch: externals/dash
commit 1b0d54f1bcae12f233d54d878329dd330fb1671c
Author: Magnar Sveen <address@hidden>
Commit: Magnar Sveen <address@hidden>
Simplify readme generation.
---
README.md | 1 +
examples-to-docs.el | 29 ++++++-----------
readme-postfix.md | 39 -----------------------
readme-prefix.md | 31 ------------------
readme-template.md | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 97 insertions(+), 88 deletions(-)
diff --git a/README.md b/README.md
index 7baf0aa..2e02855 100644
--- a/README.md
+++ b/README.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
diff --git a/examples-to-docs.el b/examples-to-docs.el
index a5685e3..760c57c 100644
--- a/examples-to-docs.el
+++ b/examples-to-docs.el
@@ -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)
diff --git a/readme-postfix.md b/readme-postfix.md
deleted file mode 100644
index c3a9786..0000000
--- a/readme-postfix.md
+++ /dev/null
@@ -1,39 +0,0 @@
-## Development
-
-Run the tests with
-
- ./run-tests.sh
-
-Create the docs with
-
- ./create-docs.sh
-
-I highly recommend that you install these as a pre-commit hook, so that
-the tests are always running and the docs are always in sync:
-
- cp pre-commit.sh .git/hooks/pre-commit
-
-Oh, and don't edit `README.md` directly, it is generated.
-Change `readme-prefix.md` and `readme-postfix.md` instead,
-or if need be, the `examples-to-docs.el` logic.
-
-## License
-
-Copyright (C) 2012 Magnar Sveen, Joel McCracken
-
-Authors: Magnar Sveen <address@hidden>
- Joel McCracken
-Keywords: lists
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/readme-prefix.md b/readme-prefix.md
deleted file mode 100644
index 1211751..0000000
--- a/readme-prefix.md
+++ /dev/null
@@ -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.
diff --git a/readme-template.md b/readme-template.md
new file mode 100644
index 0000000..836a22b
--- /dev/null
+++ b/readme-template.md
@@ -0,0 +1,85 @@
+# 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
+
+ ./run-tests.sh
+
+Create the docs with
+
+ ./create-docs.sh
+
+I highly recommend that you install these as a pre-commit hook, so that
+the tests are always running and the docs are always in sync:
+
+ cp pre-commit.sh .git/hooks/pre-commit
+
+Oh, and don't edit `README.md` directly, it is generated.
+Change `readme-prefix.md` and `readme-postfix.md` instead,
+or if need be, the `examples-to-docs.el` logic.
+
+## License
+
+Copyright (C) 2012 Magnar Sveen, Joel McCracken
+
+Authors: Magnar Sveen <address@hidden>
+ Joel McCracken
+Keywords: lists
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
- [elpa] externals/dash 214a7db 030/426: Quote and lowercase parameter names in docstring., (continued)
- [elpa] externals/dash 214a7db 030/426: Quote and lowercase parameter names in docstring., Phillip Lord, 2015/08/04
- [elpa] externals/dash de5ff6a 037/426: Simplify quotes in readme., Phillip Lord, 2015/08/04
- [elpa] externals/dash 722fea6 033/426: Include docs in README, Phillip Lord, 2015/08/04
- [elpa] externals/dash ec27b47 025/426: Turn tests into examples that can both be tested and turned into docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash 4cc4147 035/426: Fix typo, Phillip Lord, 2015/08/04
- [elpa] externals/dash eea3c53 045/426: Move function list above anaphoric function description., Phillip Lord, 2015/08/04
- [elpa] externals/dash e7d5c01 043/426: Add note about README being autogenerated to Development notes., Phillip Lord, 2015/08/04
- [elpa] externals/dash 6c39876 003/426: Set up test framework with one basic test, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2a9e600 046/426: Make functions paragraph into a list of links, Phillip Lord, 2015/08/04
- [elpa] externals/dash 5f6ea16 036/426: Fix typo, Phillip Lord, 2015/08/04
- [elpa] externals/dash 1b0d54f 044/426: Simplify readme generation.,
Phillip Lord <=
- [elpa] externals/dash 26113a1 041/426: Add pre-commit.sh that runs tests and updates readme., Phillip Lord, 2015/08/04
- [elpa] externals/dash 78fc2a3 038/426: Quote and downcase params with digits in them too., Phillip Lord, 2015/08/04
- [elpa] externals/dash 32053cd 042/426: Update readme with development notes., Phillip Lord, 2015/08/04
- [elpa] externals/dash 0912aa2 048/426: Rename !uniq to !distinct, Phillip Lord, 2015/08/04
- [elpa] externals/dash 24262a1 054/426: Add file-local font-lock for defexamples and =>, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9312469 053/426: !keep, Phillip Lord, 2015/08/04
- [elpa] externals/dash 657ee8b 040/426: Slight improvements to docs., Phillip Lord, 2015/08/04
- [elpa] externals/dash 286d1d8 050/426: Show quotes around strings in examples., Phillip Lord, 2015/08/04
- [elpa] externals/dash db8a745 056/426: Add !each, Phillip Lord, 2015/08/04
- [elpa] externals/dash f59b480 055/426: Add !some and !every?, Phillip Lord, 2015/08/04