Skip to content

Commit

Permalink
Merge pull request #25 from ardumont/0.1.1
Browse files Browse the repository at this point in the history
0.1.1
  • Loading branch information
ardumont authored Jul 20, 2016
2 parents c5d4447 + 50bf208 commit 31fe505
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion markdown-toc-pkg.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(define-package "markdown-toc" "0.1.0" "A simple TOC generator for markdown file"
(define-package "markdown-toc" "0.1.1" "A simple TOC generator for markdown file"
'((s "1.9.0")
(dash "2.11.0")
(markdown-mode "2.1")))
12 changes: 9 additions & 3 deletions markdown-toc.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Maintainer: Antoine R. Dumont
;; URL: http://github.com/ardumont/markdown-toc
;; Created: 24th May 2014
;; Version: 0.1.0
;; Version: 0.1.1
;; Keywords: markdown, toc, tools,
;; Package-Requires: ((markdown-mode "2.1") (dash "2.11.0") (s "1.9.0"))

Expand Down Expand Up @@ -62,7 +62,7 @@
(require 'dash)
(require 'markdown-mode)

(defconst markdown-toc--toc-version "0.1.0" "Current version installed.")
(defconst markdown-toc--toc-version "0.1.1" "Current version installed.")

(defgroup markdown-toc nil
"A simple TOC generator for markdown file."
Expand Down Expand Up @@ -101,12 +101,18 @@
(-repeat it sym)
(s-join "" it)))

(defconst markdown-toc--protection-symbol "09876543214b825dc642cb6eb9a060e54bf8d69288fbee49041234567890"
"Implementation detail to protect some punctuation characters
when converting to link.")

(defun markdown-toc--to-link (title)
"Given a TITLE, return the markdown link associated."
(format "[%s](#%s)" title
(->> title
downcase
(replace-regexp-in-string "[^a-z0-9 -]" "")
(replace-regexp-in-string "-" markdown-toc--protection-symbol)
(replace-regexp-in-string "[[:punct:]]" "")
(replace-regexp-in-string markdown-toc--protection-symbol "-")
(s-replace " " "-"))))

(defun markdown-toc--to-markdown-toc (level-title-toc-list)
Expand Down
6 changes: 6 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.1.1

- [X] Update version
- [X] Fix the problem when generating TOC for document with UTF-8 characters - Closes #24
- [X] Release notes

# 0.1.0

- [X] Update dependencies (markdown-mode)
Expand Down
3 changes: 3 additions & 0 deletions test/markdown-toc-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ NB-LINES-FORWARD is the number of lines to get back to."
- [Marmalade (recommended)](#marmalade-recommended)
- [Melpa-stable](#melpa-stable)
- [Melpa (~snapshot)](#melpa-snapshot)
- [[配置 SPF Sender Policy Framework 记录]](#配置-spf-sender-policy-framework-记录)
- [Install](#install)
- [Load org-trello](#load-org-trello)
- [Alternative](#alternative)
Expand All @@ -132,6 +133,7 @@ For this, you need to install a snippet of code in your emacs configuration file
### Marmalade (recommended)
### Melpa-stable
### Melpa (~snapshot)
### [配置 SPF Sender Policy Framework 记录]
## Install
### Load org-trello
### Alternative
Expand All @@ -147,6 +149,7 @@ For this, you need to install a snippet of code in your emacs configuration file
### Marmalade (recommended)
### Melpa-stable
### Melpa (~snapshot)
### [配置 SPF Sender Policy Framework 记录]
## Install
### Load org-trello
### Alternative
Expand Down
5 changes: 5 additions & 0 deletions todo.org
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#+title: dev backlog
#+author: ardumont

* DONE 0.1.1 [100%]
CLOSED: [2016-07-20 Wed 11:40]
- [X] Update version
- [X] Fix the problem when generating TOC for document with UTF-8 characters - Closes #24
- [X] Release notes
* DONE 0.1.0 [100%]
CLOSED: [2016-02-27 Sat 11:16]
- [X] Update dependencies (markdown-mode)
Expand Down

0 comments on commit 31fe505

Please sign in to comment.