[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash eacb6f2 092/426: Docs: Better generation of github
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash eacb6f2 092/426: Docs: Better generation of github urls. |
Date: |
Tue, 04 Aug 2015 19:36:55 +0000 |
branch: externals/dash
commit eacb6f28840eea45f2222188f7f23df541b37595
Author: Magnar Sveen <address@hidden>
Commit: Magnar Sveen <address@hidden>
Docs: Better generation of github urls.
---
README.md | 64 +++++++++++++++++++++++++-------------------------
examples-to-docs.el | 24 ++++++++-----------
2 files changed, 42 insertions(+), 46 deletions(-)
diff --git a/README.md b/README.md
index 6a248be..59d1dad 100644
--- a/README.md
+++ b/README.md
@@ -12,38 +12,38 @@ Or you can just dump `dash.el` in your load path somewhere.
## Functions
-* [-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)`
-* [-keep](#keep-fn-list) `(fn list)`
-* [-flatten](#flatten-l) `(l)`
-* [-concat](#concat-rest-lists) `(&rest lists)`
-* [-mapcat](#mapcat-fn-list) `(fn list)`
-* [-any?](#any-fn-list) `(fn list)`
-* [-all?](#all-fn-list) `(fn list)`
-* [-none?](#none-fn-list) `(fn list)`
-* [-each](#each-list-fn) `(list fn)`
-* [-take](#take-n-list) `(n list)`
-* [-drop](#drop-n-list) `(n list)`
-* [-take-while](#take-while-fn-list) `(fn list)`
-* [-drop-while](#drop-while-fn-list) `(fn list)`
-* [-split-at](#split-at-n-list) `(n list)`
-* [-split-with](#split-with-fn-list) `(fn list)`
-* [-interpose](#interpose-sep-list) `(sep list)`
-* [-interleave](#interleave-rest-lists) `(&rest lists)`
-* [-replace-where](#replace-where-pred-rep-list) `(pred rep list)`
-* [-first](#first-fn-list) `(fn list)`
-* [-difference](#difference-list-list2) `(list list2)`
-* [-intersection](#intersection-list-list2) `(list list2)`
-* [-distinct](#distinct-list) `(list)`
-* [-contains?](#contains-list-element) `(list element)`
-* [-partial](#partial-fn-rest-args) `(fn &rest args)`
-* [-rpartial](#rpartial-fn-rest-args) `(fn &rest args)`
-* [->](#x-optional-form-rest-more) `(x &optional form &rest more)`
-* [->>](#x-form-rest-more) `(x form &rest more)`
-* [-->](#x-form-rest-more) `(x form &rest more)`
+* [-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)`
+* [-keep](#-keep-fn-list) `(fn list)`
+* [-flatten](#-flatten-l) `(l)`
+* [-concat](#-concat-rest-lists) `(&rest lists)`
+* [-mapcat](#-mapcat-fn-list) `(fn list)`
+* [-any?](#-any-fn-list) `(fn list)`
+* [-all?](#-all-fn-list) `(fn list)`
+* [-none?](#-none-fn-list) `(fn list)`
+* [-each](#-each-list-fn) `(list fn)`
+* [-take](#-take-n-list) `(n list)`
+* [-drop](#-drop-n-list) `(n list)`
+* [-take-while](#-take-while-fn-list) `(fn list)`
+* [-drop-while](#-drop-while-fn-list) `(fn list)`
+* [-split-at](#-split-at-n-list) `(n list)`
+* [-split-with](#-split-with-fn-list) `(fn list)`
+* [-interpose](#-interpose-sep-list) `(sep list)`
+* [-interleave](#-interleave-rest-lists) `(&rest lists)`
+* [-replace-where](#-replace-where-pred-rep-list) `(pred rep list)`
+* [-first](#-first-fn-list) `(fn list)`
+* [-difference](#-difference-list-list) `(list list2)`
+* [-intersection](#-intersection-list-list) `(list list2)`
+* [-distinct](#-distinct-list) `(list)`
+* [-contains?](#-contains-list-element) `(list element)`
+* [-partial](#-partial-fn-rest-args) `(fn &rest args)`
+* [-rpartial](#-rpartial-fn-rest-args) `(fn &rest args)`
+* [->](#--x-optional-form-rest-more) `(x &optional form &rest more)`
+* [->>](#--x-form-rest-more) `(x form &rest more)`
+* [-->](#---x-form-rest-more) `(x form &rest more)`
There are also anaphoric versions of these functions where that makes sense,
prefixed with two dashs instead of one.
diff --git a/examples-to-docs.el b/examples-to-docs.el
index c343a8d..63e7e22 100644
--- a/examples-to-docs.el
+++ b/examples-to-docs.el
@@ -57,22 +57,18 @@
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]+" t))
-
-(defun dashed-words (s)
- "Convert string S to snake-case string."
- (mapconcat 'identity (mapcar
- '(lambda (word) (downcase word))
- (split-name s)) "-"))
+(defun docs--chop-suffix (suffix s)
+ "Remove SUFFIX if it is at end of S."
+ (let ((pos (- (length suffix))))
+ (if (and (>= (length s) (length suffix))
+ (string= suffix (substring s pos)))
+ (substring s 0 pos)
+ s)))
(defun github-id (command-name signature)
- (dashed-words (format "%s %s" command-name signature)))
+ (docs--chop-suffix
+ "-"
+ (replace-regexp-in-string "[^a-zA-Z-]+" "-" (format "%S %S" command-name
signature))))
(defun function-summary (function)
(let ((command-name (car function))
- [elpa] externals/dash 9410f7e 073/426: Add !replace-where, (continued)
- [elpa] externals/dash 9410f7e 073/426: Add !replace-where, Phillip Lord, 2015/08/04
- [elpa] externals/dash 123eaaa 078/426: Docs: Refer to !replace-where from !!replace-where., Phillip Lord, 2015/08/04
- [elpa] externals/dash 70488c2 063/426: Add !rpartial, Phillip Lord, 2015/08/04
- [elpa] externals/dash 82a12a2 076/426: Add !drop-while, Phillip Lord, 2015/08/04
- [elpa] externals/dash fea1aa3 086/426: Add -interleave, Phillip Lord, 2015/08/04
- [elpa] externals/dash 38cc9e7 088/426: Simplify -interleave with -none?, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9ff9fd0 085/426: Move functions that are not strictly list related last., Phillip Lord, 2015/08/04
- [elpa] externals/dash 0c55a4b 090/426: 1.0.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash 4b5e24b 087/426: Docs: move -any? -all? -none? and -each up., Phillip Lord, 2015/08/04
- [elpa] externals/dash f8d74ff 091/426: Docs: update example text to match example code., Phillip Lord, 2015/08/04
- [elpa] externals/dash eacb6f2 092/426: Docs: Better generation of github urls.,
Phillip Lord <=
- [elpa] externals/dash 8c75026 080/426: Add !drop, Phillip Lord, 2015/08/04
- [elpa] externals/dash a2941cd 097/426: Typo, Phillip Lord, 2015/08/04
- [elpa] externals/dash b9b6330 079/426: Add !take, Phillip Lord, 2015/08/04
- [elpa] externals/dash 6931d8a 094/426: Remove Melpa from installation while waiting for it to be included., Phillip Lord, 2015/08/04
- [elpa] externals/dash 0bd26ac 096/426: Add aliases for -p instead of ?, Phillip Lord, 2015/08/04
- [elpa] externals/dash 38eed45 095/426: Add rainbow-dash, Phillip Lord, 2015/08/04
- [elpa] externals/dash dc6f46c 098/426: Simplify docs-generation using dash., Phillip Lord, 2015/08/04
- [elpa] externals/dash b0da7b2 093/426: Declare macros before using them., Phillip Lord, 2015/08/04
- [elpa] externals/dash 4fedd2e 099/426: Add -partition and -partition-all, Phillip Lord, 2015/08/04
- [elpa] externals/dash 79b56cc 101/426: Use --each, !cons and !cdr to simplify implementations., Phillip Lord, 2015/08/04