diff --git a/.build.yml b/.build.yml deleted file mode 100644 index 708a173..0000000 --- a/.build.yml +++ /dev/null @@ -1,11 +0,0 @@ -image: alpine/edge -packages: - - emacs - - make -sources: - - https://git.sr.ht/~abrahms/ox-gemini -tasks: - - build: | - cd ox-gemini - make update - make compile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..6207b71 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,75 @@ +--- +kind: pipeline +type: docker +name: emacs 26 + +steps: + - name: tests + image: silex/emacs:26-alpine + commands: + - apk add npm make + - npm install -g @emacs-eask/cli + - make clean + - make package + - make install + - make compile + - make checkdoc + - make lint + - make clean + +--- +kind: pipeline +type: docker +name: emacs 27 + +steps: + - name: tests + image: silex/emacs:27-alpine + commands: + - apk add npm make + - npm install -g @emacs-eask/cli + - make clean + - make package + - make install + - make compile + - make checkdoc + - make lint + - make clean + +--- +kind: pipeline +type: docker +name: emacs 28 + +steps: + - name: tests + image: silex/emacs:28-alpine + commands: + - apk add npm make + - npm install -g @emacs-eask/cli + - make clean + - make package + - make install + - make compile + - make checkdoc + - make lint + - make clean + +--- +kind: pipeline +type: docker +name: emacs master + +steps: + - name: tests + image: silex/emacs:master-alpine + commands: + - apk add npm make + - npm install -g @emacs-eask/cli + - make clean + - make package + - make install + - make compile + - make checkdoc + - make lint + - make clean diff --git a/.gitignore b/.gitignore index 6407980..d67dbfa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,17 @@ +# ignore these directories +/.git +/recipes + +# ignore log files +/.log + +# ignore generated files *.elc -.elpa/ \ No newline at end of file + +# eask packages +.eask/ +dist/ + +# packaging +*-autoloads.el +*-pkg.el diff --git a/Eask b/Eask new file mode 100644 index 0000000..069004a --- /dev/null +++ b/Eask @@ -0,0 +1,14 @@ +(package "ox-gemini" + "0.2.0" + "Output gemini formatted documents from org-mode") + +(website-url "https://labs.phundrak.com/phundrak/ox-gemini") +(keywords "lisp" "org-mode") + +(package-file "ox-gemini.el") + +(script "test" "echo \"Error: no test specified\" && exit 1") + +(source "gnu") + +(depends-on "emacs" "26.1") diff --git a/Makefile b/Makefile index febfa1b..02fb14f 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,64 @@ -EMACS = emacs +EMACS ?= emacs +EASK ?= eask -compile: clean lint - ${EMACS} --version - ${EMACS} -batch -l test/elpa.el -l test/compile.el +.PHONY: clean package install compile test checkdoc lint -clean: - rm -f *.elc +# (Option 1): Basic for beginner, only tests for package's installation +ci: clean package install compile +# (Option 2): Advanced for a high-quality package +#ci: clean package install compile checkdoc lint test +# Build an package artefact, default to `dist` folder +# +# This is used to test if your package can be built correctly before the +# package installation. +package: + @echo "Packaging..." + $(EASK) package + +# Install package +# +# If your package is a single file package, you generally wouldn't need to +install: + @echo "Installing..." + $(EASK) install + +# Byte-compile package +# +# Compile all your package .el files to .elc +compile: + @echo "Compiling..." + $(EASK) compile + +# Run regression tests +# +# The default test is `ert`; but Eask also support other regression test! +# See https://emacs-eask.github.io/Getting-Started/Commands-and-options/#-linter +test: + @echo "Testing..." + $(EASK) install-deps --dev + $(EASK) test ert ./test/*.el + +# Run checkdoc +# +# See https://www.emacswiki.org/emacs/CheckDoc +checkdoc: + @echo "Checking documentation..." + $(EASK) lint checkdoc --strict + +# Lint package metadata +# +# See https://github.com/purcell/package-lint lint: - ${EMACS} --batch -l test/lint.el + @echo "Linting..." + $(EASK) lint package -update: - ${EMACS} -batch -l test/make-update.el - -.PHONY: update compile test clean +# Clean up +# +# This will clean all the entire workspace including the following folders +# and files +# +# - .eask folder (sandbox) +# - all .elc files +clean: + $(EASK) clean all diff --git a/README.org b/README.org index 6dc02aa..b8c7234 100644 --- a/README.org +++ b/README.org @@ -16,5 +16,8 @@ gemini links as described in commit [[https://labs.phundrak.com/phundrak/ox-gemi TODOs formerly in =ox-gemini.el= have also been moved to issues. +** Eask +This project is managed with [[https://github.com/emacs-eask/cli][Eask]]. + * License This software is licensed under GPLv3. diff --git a/ox-gemini.el b/ox-gemini.el index 497f30b..181c937 100644 --- a/ox-gemini.el +++ b/ox-gemini.el @@ -1,12 +1,27 @@ ;;; ox-gemini.el --- Output gemini formatted documents from org-mode -*- lexical-binding: t; -*- ;; Author: Justin Abrahms -;; URL: https://git.sr.ht/~abrahms/ox-gemini -;; Keywords: lisp gemini -;; Version: 0 +;; Maintainer: Lucien Cartier-Tilet +;; URL: https://labs.phundrak.com/phundrak/ox-gemini +;; Version: 0.2.0 +;; Keywords: lisp org-mode ;; Package-Requires: ((emacs "26.1")) ;; SPDX-License-Identifier: GPL-3.0-or-later +;; This file is not part of GNU Emacs. + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . ;;; Commentary: ;; @@ -103,10 +118,11 @@ INFO is a plist." (concat (file-name-sans-extension (org-element-property :path link)) ".gmi") raw-path)) (desc (org-element-contents link)) - (anchor (string-replace "\n" " " - (org-export-data - (or desc (org-element-property :raw-link link)) - info)))) + (anchor (replace-regexp-in-string (regexp-quote "\n") + " " + (org-export-data + (or desc (org-element-property :raw-link link)) + info)))) (format "=> %s %s\n" (url-encode-url path) anchor))) links "") (when (car links) diff --git a/test/compile.el b/test/compile.el deleted file mode 100644 index 6f876b6..0000000 --- a/test/compile.el +++ /dev/null @@ -1,8 +0,0 @@ -;; bail out on compilation warnings and errors -(setq byte-compile-error-on-warn t) -(setq byte-compile--use-old-handlers nil) - -;; compile *.el files -(dolist (file (file-expand-wildcards "*.el")) - (unless (byte-compile-file file) - (kill-emacs 1))) diff --git a/test/elpa.el b/test/elpa.el deleted file mode 100644 index f501af1..0000000 --- a/test/elpa.el +++ /dev/null @@ -1,4 +0,0 @@ -(setq package-user-dir - (expand-file-name (format ".elpa/%s/elpa" emacs-version))) -(package-initialize) -(add-to-list 'load-path default-directory) diff --git a/test/lint.el b/test/lint.el deleted file mode 100644 index 82cb116..0000000 --- a/test/lint.el +++ /dev/null @@ -1,16 +0,0 @@ -(message "Emacs version: %s" emacs-version) - -(dolist (file (file-expand-wildcards "*.el")) - (let ((checkdoc-diagnostic-buffer "*warn*") - ;; bail out on checkdoc warnings - (checkdoc-create-error-function (lambda (text start end &optional unfixable) - (message "%s:%s %s" - file - (line-number-at-pos start) - text) - (kill-emacs 1)))) - (with-current-buffer (find-file-noselect file) - ;; Eval the buffer first because otherwise checkdoc isn't smart - ;; enough to recognize that some symbols are defined. - (eval-buffer) - (checkdoc-current-buffer t)))) diff --git a/test/make-update.el b/test/make-update.el deleted file mode 100644 index 7c8d615..0000000 --- a/test/make-update.el +++ /dev/null @@ -1,28 +0,0 @@ -;; list of the all the dependencies, including the dev dependencies -(defvar dev-packages '(evil evil-test-helpers)) - -;; initialize package.el -(setq package-user-dir - (expand-file-name (format ".elpa/%s/elpa" emacs-version))) -(message "installing in %s ...\n" package-user-dir) -(package-initialize) -(setq package-archives - '(("melpa" . "http://melpa.org/packages/") - ("gnu" . "http://elpa.gnu.org/packages/"))) -(package-refresh-contents) - -;; install dependencies -(dolist (package dev-packages) - (unless (package-installed-p package) - (ignore-errors - (package-install package)))) - -;; upgrade dependencies -(save-window-excursion - (package-list-packages t) - (condition-case nil - (progn - (package-menu-mark-upgrades) - (package-menu-execute t)) - (error - (message "All packages up to date"))))