branch: externals/bnf-mode commit 1dda3ef5f837959d007512d1278a02cf5babfe8e Author: Serghei Iakovlev <serg...@phalconphp.com> Commit: Serghei Iakovlev <serg...@phalconphp.com>
Provide ability to make plain text README --- .gitignore | 2 ++ Makefile | 18 ++++++++++++++++-- README.org | 15 +++++++-------- bnf-mode.el | 2 +- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index ff957d8..87befbc 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ *~ *.elc .cask/ +README +README.org2 diff --git a/Makefile b/Makefile index b3b7887..cd6314d 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,14 @@ SHELL := $(shell which bash) ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) + EMACS := emacs CASK = cask +PANDOC ?= pandoc \ + --fail-if-warnings \ + --reference-links \ + --atx-headers + EMACSFLAGS ?= TESTFLAGS ?= PKGDIR := $(shell EMACS=$(EMACS) $(CASK) package-directory) @@ -31,6 +37,8 @@ PKGDIR := $(shell EMACS=$(EMACS) $(CASK) package-directory) SRCS = bnf-mode.el OBJS = $(SRCS:.el=.elc) +VERSION ?= $(shell $(CASK) version) + .SILENT: ; # no need for @ .ONESHELL: ; # recipes execute in same shell .NOTPARALLEL: ; # wait for this target to finish @@ -60,12 +68,17 @@ $(PKGDIR): Cask $(CASK) install touch $(PKGDIR) +README: README.org2 + $(PANDOC) -f org+empty_paragraphs -t plain -o $@ $^ + +README.org2: README.org + $(shell cat $^ | sed -e "s/\[\[.*\.svg\]\]//g" > $@) + # Public targets .PHONY: .title .title: - $(info BNF Mode $(shell cat $(ROOT_DIR)/$(SRCS) | grep ";; Version:" | awk -F': ' '{print $$2}')) - $(info ) + $(info BNF Mode $(VERSION)) .PHONY: init init: $(PKGDIR) @@ -84,6 +97,7 @@ test: .PHONY: clean clean: $(CASK) clean-elc + $(RM) -f README README.org2 .PHONY: help help: .title diff --git a/README.org b/README.org index 607cbb2..08e26c2 100644 --- a/README.org +++ b/README.org @@ -1,5 +1,4 @@ -#+TITLE: BNF Mode for GNU Emacs -#+AUTHOR: Serghei Iakovlev +* BNF Mode for GNU Emacs [[https://www.gnu.org/licenses/gpl-3.0.txt][https://img.shields.io/badge/license-GPL_3-green.svg]] [[https://travis-ci.com/sergeyklay/bnf-mode][https://travis-ci.com/sergeyklay/bnf-mode.svg]] @@ -58,7 +57,7 @@ Stable: (package-initialize) #+end_src -For those who want rolling releases as they happen use MELPA : +For those who want rolling releases as they happen use MELPA: #+begin_src emacs-lisp (require 'package) @@ -72,7 +71,7 @@ the package listing and install ~bnf-mode~ from there. MELPA tracks this Git re and updates relatively soon after each commit or formal release. For more detail on setting up see [[https://melpa.org/#/getting-started][MELPA Getting Started]]. -You can install ~bnf-mode~ manually by adding following to your init file : +You can install ~bnf-mode~ manually by adding following to your init file: #+begin_src emacs-lisp (unless (package-installed-p 'bnf-mode) @@ -82,7 +81,7 @@ You can install ~bnf-mode~ manually by adding following to your init file : **** Using Cask -Add following to your [[https://cask.github.io/][Cask]] file : +Add following to your [[https://cask.github.io/][Cask]] file: #+begin_src emacs-lisp (source melpa) @@ -92,7 +91,7 @@ Add following to your [[https://cask.github.io/][Cask]] file : **** Using use-package -Add following to your init file : +Add following to your init file: #+begin_src emacs-lisp (use-package bnf-mode @@ -103,7 +102,7 @@ Add following to your init file : *** El-get -If you use el-get, just create a recipe file ~bnf.rcp~ : +If you use el-get, just create a recipe file ~bnf.rcp~: #+begin_src emacs-lisp (:name bnf-mode @@ -114,7 +113,7 @@ If you use el-get, just create a recipe file ~bnf.rcp~ : #+end_src and add it to a directory present in ~el-get-recipe-path~. -Then, use ~M-x el-get-install <RET> bnf-mode~ or add : +Then, use ~M-x el-get-install <RET> bnf-mode~ or add: #+begin_src emacs-lisp (el-get-bundle bnf-mode) diff --git a/bnf-mode.el b/bnf-mode.el index a2188fd..d589f66 100644 --- a/bnf-mode.el +++ b/bnf-mode.el @@ -1,4 +1,4 @@ -;;; bnf-mode.el --- Major mode for editing BNF grammars -*- lexical-binding: t; -*- +;;; bnf-mode.el --- Major mode for editing BNF grammars. -*- lexical-binding: t; -*- ;; Copyright (C) 2019 Serghei Iakovlev