[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 2a9e600 046/426: Make functions paragraph into a l
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 2a9e600 046/426: Make functions paragraph into a list of links |
Date: |
Tue, 04 Aug 2015 19:36:37 +0000 |
branch: externals/dash
commit 2a9e600186a7e7cf57bc15e10eef3f082bf7fef1
Author: Magnar Sveen <address@hidden>
Commit: Magnar Sveen <address@hidden>
Make functions paragraph into a list of links
---
README.md | 26 ++++++++++++--------------
create-docs.sh | 2 +-
examples-to-docs.el | 21 ++++++++++++++++++++-
readme-template.md | 2 --
4 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/README.md b/README.md
index 696ed18..b3db2e7 100644
--- a/README.md
+++ b/README.md
@@ -10,20 +10,18 @@ This is so much a work in progress that you should
definitely not be using it ye
## Functions
-```cl
-!map (fn list)
-!reduce-from (fn initial-value list)
-!reduce (fn list)
-!filter (fn list)
-!remove (fn list)
-!concat (&rest lists)
-!mapcat (fn list)
-!partial (fn &rest args)
-!difference (list list2)
-!intersection (list list2)
-!uniq (list)
-!contains? (list element)
-```
+* [!map](#map-fn-list) `(fn list)`
+* [!reduce-from](#reduce-from-fn-initial-value-list) `(fn initial-value list)`
+* [!reduce](#reduce-fn-list) `(fn list)`
+* [!filter](#filter-fn-list) `(fn list)`
+* [!remove](#remove-fn-list) `(fn list)`
+* [!concat](#concat-rest-lists) `(&rest lists)`
+* [!mapcat](#mapcat-fn-list) `(fn list)`
+* [!partial](#partial-fn-rest-args) `(fn &rest args)`
+* [!difference](#difference-list-list2) `(list list2)`
+* [!intersection](#intersection-list-list2) `(list list2)`
+* [!uniq](#uniq-list) `(list)`
+* [!contains?](#contains-list-element) `(list element)`
There are also anaphoric versions of these functions where that makes sense,
prefixed with two bangs instead of one.
diff --git a/create-docs.sh b/create-docs.sh
index 462a312..3bb561e 100755
--- a/create-docs.sh
+++ b/create-docs.sh
@@ -4,4 +4,4 @@ if [ -z "$EMACS" ] ; then
EMACS="emacs"
fi
-$EMACS -batch -l examples-to-docs.el -l bang.el -l examples.el -f
create-docs-file
+$EMACS -batch -l bang.el -l examples-to-docs.el -l examples.el -f
create-docs-file
diff --git a/examples-to-docs.el b/examples-to-docs.el
index 760c57c..12a9c25 100644
--- a/examples-to-docs.el
+++ b/examples-to-docs.el
@@ -1,3 +1,5 @@
+(require 'bang)
+
(defvar functions '())
(defun example-to-string (example)
@@ -39,10 +41,27 @@
docstring
(mapconcat 'identity (three-first examples) "\n"))))
+(defun split-name (s)
+ "Split name into list of words"
+ (split-string
+ (let ((case-fold-search nil))
+ (downcase
+ (replace-regexp-in-string "\\([a-z]\\)\\([A-Z]\\)" "\\1 \\2" s)))
+ "[^A-Za-z0-9]+"))
+
+(defun dashed-words (s)
+ "Convert string S to snake-case string."
+ (mapconcat 'identity (mapcar
+ '(lambda (word) (downcase word))
+ (!!remove (equal it "") (split-name s))) "-"))
+
+(defun github-id (command-name signature)
+ (dashed-words (format "%s %s" command-name signature)))
+
(defun function-summary (function)
(let ((command-name (car function))
(signature (cadr function)))
- (format "%s %s" command-name signature)))
+ (format "* [%s](#%s) `%s`" command-name (github-id command-name signature)
signature)))
(defun simplify-quotes ()
(goto-char (point-min))
diff --git a/readme-template.md b/readme-template.md
index aa7f6bc..d3132e7 100644
--- a/readme-template.md
+++ b/readme-template.md
@@ -10,9 +10,7 @@ This is so much a work in progress that you should definitely
not be using it ye
## Functions
-```cl
[[ function-list ]]
-```
There are also anaphoric versions of these functions where that makes sense,
prefixed with two bangs instead of one.
- [elpa] externals/dash 06efd3c 039/426: Slight improvements to docs., (continued)
- [elpa] externals/dash 06efd3c 039/426: Slight improvements to docs., Phillip Lord, 2015/08/04
- [elpa] externals/dash 85016d3 029/426: Fix quoted forms like `' in docs., Phillip Lord, 2015/08/04
- [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 <=
- [elpa] externals/dash 5f6ea16 036/426: Fix typo, Phillip Lord, 2015/08/04
- [elpa] externals/dash 1b0d54f 044/426: Simplify readme generation., Phillip Lord, 2015/08/04
- [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