[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 85016d3 029/439: Fix quoted forms like `' in docs.
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 85016d3 029/439: Fix quoted forms like `' in docs. |
Date: |
Tue, 04 Aug 2015 20:26:01 +0000 |
branch: externals/dash
commit 85016d32fb709f97c38c7dddc7210791ff7b786d
Author: Magnar Sveen <address@hidden>
Commit: Magnar Sveen <address@hidden>
Fix quoted forms like `' in docs.
---
docs.md | 18 ++++++++++--------
examples-to-docs.el | 5 ++++-
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/docs.md b/docs.md
index 63c85d0..988f419 100644
--- a/docs.md
+++ b/docs.md
@@ -57,6 +57,8 @@ Returns a new list of the items in LIST for which FN returns
nil.
(!remove (lambda (num) (= 0 (% num 2))) (quote (1 2 3 4))) ;; => (quote (1 3))
(!remove (quote even?) (quote (1 2 3 4))) ;; => (quote (1 3))
(!!remove (= 0 (% it 2)) (quote (1 2 3 4))) ;; => (quote (1 3))
+(let ((mod 2)) (!remove (lambda (num) (= 0 (% num mod))) (quote (1 2 3 4))))
;; => (quote (1 3))
+(let ((mod 2)) (!!remove (= 0 (% it mod)) (quote (1 2 3 4)))) ;; => (quote (1
3))
```
## !concat `(&rest lists)`
@@ -97,8 +99,8 @@ additional args.
## !difference `(list list2)`
Return a new list with only the members of LIST that are not in LIST2.
-The test for equality is done with `equal',
-or with `!compare-fn' if that's non-nil.
+The test for equality is done with `equal`,
+or with `!compare-fn` if that's non-nil.
```cl
(!difference (quote nil) (quote nil)) ;; => (quote nil)
@@ -109,8 +111,8 @@ or with `!compare-fn' if that's non-nil.
## !intersection `(list list2)`
Return a new list containing only the elements that are members of both LIST
and LIST2.
-The test for equality is done with `equal',
-or with `!compare-fn' if that's non-nil.
+The test for equality is done with `equal`,
+or with `!compare-fn` if that's non-nil.
```cl
(!intersection (quote nil) (quote nil)) ;; => (quote nil)
@@ -121,8 +123,8 @@ or with `!compare-fn' if that's non-nil.
## !uniq `(list)`
Return a new list with all duplicates removed.
-The test for equality is done with `equal',
-or with `!compare-fn' if that's non-nil.
+The test for equality is done with `equal`,
+or with `!compare-fn` if that's non-nil.
```cl
(!uniq (quote nil)) ;; => (quote nil)
@@ -132,8 +134,8 @@ or with `!compare-fn' if that's non-nil.
## !contains? `(list element)`
Return whether LIST contains ELEMENT.
-The test for equality is done with `equal',
-or with `!compare-fn' if that's non-nil.
+The test for equality is done with `equal`,
+or with `!compare-fn` if that's non-nil.
```cl
(!contains? (quote (1 2 3)) 1) ;; => t
diff --git a/examples-to-docs.el b/examples-to-docs.el
index 4aa2b65..c9fbe96 100644
--- a/examples-to-docs.el
+++ b/examples-to-docs.el
@@ -19,10 +19,13 @@
(car (cddr (symbol-function ',cmd))) ;; docstring
(examples-to-strings ',examples)))) ;; examples
+(defun quote-docstring (docstring)
+ (replace-regexp-in-string "`\\([^ ]+\\)'" "`\\1`" docstring))
+
(defun function-to-md (function)
(let ((command-name (car function))
(signature (cadr function))
- (docstring (cadr (cdr function)))
+ (docstring (quote-docstring (cadr (cdr function))))
(examples (mapconcat 'identity (cadr (cddr function)) "\n")))
(format "## %s `%s`\n\n%s\n\n```cl\n%s\n```\n" command-name signature
docstring examples)))
- [elpa] externals/dash a02b6c1 021/439: Add note about no 'cl required., (continued)
- [elpa] externals/dash a02b6c1 021/439: Add note about no 'cl required., Phillip Lord, 2015/08/04
- [elpa] externals/dash 07de30e 019/439: !mapcat macro, and with that: goodbye 'cl!, Phillip Lord, 2015/08/04
- [elpa] externals/dash 52815c5 020/439: Add documentation, Phillip Lord, 2015/08/04
- [elpa] externals/dash 73204ca 022/439: Change !contains-p to !contains? to match clojure api., Phillip Lord, 2015/08/04
- [elpa] externals/dash 6c39876 003/439: Set up test framework with one basic test, Phillip Lord, 2015/08/04
- [elpa] externals/dash c0f2c8f 026/439: Test that it works with lexical binding., Phillip Lord, 2015/08/04
- [elpa] externals/dash 754dd0d 024/439: Create stand-alone anaphoric macros, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9e74cc0 027/439: Remove dead code., Phillip Lord, 2015/08/04
- [elpa] externals/dash 8eab3d1 028/439: Slight improvements to map., Phillip Lord, 2015/08/04
- [elpa] externals/dash d2dfb11 023/439: Use double-bang for anaphoric functions, Phillip Lord, 2015/08/04
- [elpa] externals/dash 85016d3 029/439: Fix quoted forms like `' in docs.,
Phillip Lord <=
- [elpa] externals/dash 6f0636f 032/439: Show only three first examples per function., Phillip Lord, 2015/08/04
- [elpa] externals/dash 4cc4147 035/439: Fix typo, Phillip Lord, 2015/08/04
- [elpa] externals/dash 41d77ec 034/439: Add function list to readme., Phillip Lord, 2015/08/04
- [elpa] externals/dash 214a7db 030/439: Quote and lowercase parameter names in docstring., Phillip Lord, 2015/08/04
- [elpa] externals/dash ec27b47 025/439: Turn tests into examples that can both be tested and turned into docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash 1997e52 031/439: Treat dashes in docstring better., Phillip Lord, 2015/08/04
- [elpa] externals/dash 78fc2a3 038/439: Quote and downcase params with digits in them too., Phillip Lord, 2015/08/04
- [elpa] externals/dash 06efd3c 039/439: Slight improvements to docs., Phillip Lord, 2015/08/04
- [elpa] externals/dash de5ff6a 037/439: Simplify quotes in readme., Phillip Lord, 2015/08/04
- [elpa] externals/dash 5f6ea16 036/439: Fix typo, Phillip Lord, 2015/08/04