asciidoc layer: convert README to org file

This commit is contained in:
syl20bnr 2015-07-30 22:17:42 -04:00
parent eae6e48094
commit 18be7425f4
3 changed files with 66 additions and 68 deletions

View File

@ -1,56 +0,0 @@
# Asciidoc contribution layer for Spacemacs
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
**Table of Contents**
- [Asciidoc contribution layer for Spacemacs](#asciidoc-contribution-layer-for-spacemacs)
- [Description](#description)
- [Install](#install)
- [Key bindings](#key-bindings)
- [Element insertion](#element-insertion)
- [Promotion, Demotion](#promotion-demotion)
<!-- markdown-toc end -->
## Description
This layer adds [AsciiDoc][] markup language support to Spacemacs.
Feature
- asciidoc format support via [adoc-mode][]
- `.adoc` files are associated with `adoc-mode` by default
## Install
To use this contribution add it to your `~/.spacemacs`
```elisp
(setq-default dotspacemacs-configuration-layers '(asciidoc))
```
## Key bindings
### Element insertion
Key Binding | Description
----------------------|------------------------------------------------------------
<kbd>SPC m h 1<kbd> | Insert title level 1
<kbd>SPC m h I<kbd> | Insert title level 1 (the most important one)
<kbd>SPC m h 2<kbd> | Insert title level 2
<kbd>SPC m h i<kbd> | Insert title level 2 (the most usual one)
<kbd>SPC m h 3<kbd> | Insert title level 3
<kbd>SPC m h 4<kbd> | Insert title level 4
<kbd>SPC m h 5<kbd> | Insert title level 5
<kbd>SPC m h 5<kbd> | Insert title level 5
<kbd>SPC m x b<kbd> | Boldface selected
<kbd>SPC m x i<kbd> | Italicize selected
### Promotion, Demotion
Key Binding | Description
----------------------|------------------------------------------------------------
<kbd>M-h<kbd> | Promote title level
<kbd>M-l<kbd> | Denote title level
[AsciiDoc]: https://asciidoctor.org
[adoc-mode]: https://github.com/sensorflo/adoc-mode

View File

@ -0,0 +1,48 @@
#+TITLE: Asciidoc contribution layer for Spacemacs
* Table of Contents :TOC@4:
- [[#description][Description]]
- [[#feature][Feature]]
- [[#install][Install]]
- [[#key-bindings][Key bindings]]
- [[#element-insertion][Element insertion]]
- [[#promotion-demotion][Promotion, Demotion]]
* Description
This layer adds [[https://asciidoctor.org][AsciiDoc]] markup language support to Spacemacs.
** Feature
- asciidoc format support via [[https://github.com/sensorflo/adoc-mode][adoc-mode]]
- `.adoc` files are associated with `adoc-mode` by default
* Install
To use this contribution add it to your `~/.spacemacs`
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(asciidoc))
#+END_SRC
* Key bindings
** Element insertion
| Key Binding | Description |
|-------------+-----------------------------------------------|
| ~SPC m h 1~ | Insert title level 1 |
| ~SPC m h I~ | Insert title level 1 (the most important one) |
| ~SPC m h 2~ | Insert title level 2 |
| ~SPC m h i~ | Insert title level 2 (the most usual one) |
| ~SPC m h 3~ | Insert title level 3 |
| ~SPC m h 4~ | Insert title level 4 |
| ~SPC m h 5~ | Insert title level 5 |
| ~SPC m h 5~ | Insert title level 5 |
| ~SPC m x b~ | Boldface selected |
| ~SPC m x i~ | Italicize selected |
** Promotion, Demotion
| Key Binding | Description |
|-------------+---------------------|
| ~M-h~ | Promote title level |
| ~M-l~ | Denote title level |

View File

@ -11,31 +11,37 @@
;;
;;; License: GPLv3
(setq asciidoc-packages
'(cl adoc-mode))
(setq asciidoc-packages '(adoc-mode))
(defun asciidoc/init-adoc-mode ()
(use-package adoc-mode
:mode (("\\.adoc?$" . adoc-mode)) ; We will NOT default `.txt' files to AsciiDoc mode, and `.asciidoc' extension is just plain stupid.
;; We will NOT default `.txt' files to AsciiDoc mode,
;; and `.asciidoc' extension is just plain stupid.
:mode (("\\.adoc?$" . adoc-mode))
:defer t
:config
(progn
;; We have quite a lot of possible keybindings. See `adoc-mode.el', its bottom part where the huge easy-menu is defined and after that, where the various `tempo-template-*' functions are defined.
;; We have quite a lot of possible keybindings.
;; See `adoc-mode.el', its bottom part where the huge easy-menu
;; is defined and after that, where the various `tempo-template-*'
;; functions are defined.
;; See /doc/CONVENTIONS.md#plain-text-markup-languages
(evil-leader/set-key-for-mode 'adoc-mode
"mh1" 'tempo-template-adoc-title-1
"mhI" 'tempo-template-adoc-title-1 ; Alternative method of inserting top-level heading - capital "I"
;; Alternative method of inserting top-level heading
"mhI" 'tempo-template-adoc-title-1
"mh2" 'tempo-template-adoc-title-2
"mhi" 'tempo-template-adoc-title-2 ; Alternative method of inserting the most usual heading - lowercase "i"
;; Alternative method of inserting the most usual heading
"mhi" 'tempo-template-adoc-title-2
"mh3" 'tempo-template-adoc-title-3
"mh4" 'tempo-template-adoc-title-4
"mh5" 'tempo-template-adoc-title-5
"mxb" 'tempo-template-adoc-strong
"mxi" 'tempo-template-adoc-emphasis)
(define-key adoc-mode-map (kbd "M-h") 'adoc-denote) ; yes, exactly like that. To "promote" title is to INCREASE its size. `adoc-denote' does the opposite: increases its LEVEL, which DECREASES its size.
(define-key adoc-mode-map (kbd "M-l") 'adoc-promote)))) ; see the comment about adoc-denote above
(defun asciidoc/init-cl ()
(use-package cl))
;; yes, exactly like that. To "promote" title is to INCREASE its size.
;; `adoc-denote' does the opposite: increases its LEVEL,
;; which DECREASES its size.
(define-key adoc-mode-map (kbd "M-h") 'adoc-denote)
;; see the comment about adoc-denote above
(define-key adoc-mode-map (kbd "M-l") 'adoc-promote))))