From 1c4895d0aad6c960533355b76d3c26288625319d Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sat, 13 Apr 2013 14:24:46 +1200 Subject: Moved HTML functions to separate file Moved all convenience functions for generating certain HTML (as esxml) elements to esxml-html.el --- esxml-html.el | 191 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 esxml-html.el (limited to 'esxml-html.el') diff --git a/esxml-html.el b/esxml-html.el new file mode 100644 index 0000000..e21bff9 --- /dev/null +++ b/esxml-html.el @@ -0,0 +1,191 @@ +;;; esxml-html.el --- HTML convenience functions for esxml +;; Copyright (C) 2012 + +;; Author: Evan Izaksonas-Smith +;; Maintainer: Evan Izaksonas-Smith +;; Created: 15th August 2012 +;; Version: 0.2.3 +;; Package-Requires: ((kv "0.0.5")) +;; Keywords: tools, lisp, comm +;; Description: esxml convenience functions for certain HTML elements +;; +;; 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: + +;; This is a set of convenience functions for generating esxml for +;; certain HTML elements. +;; +;; NOTICE: Code base will be trasnitioning to using pcase instead of +;; destructuring bind wherever possible. If this leads to hard to +;; debug code, please let me know, and I will do whatever I can to +;; resolve these issues. +;; +;;; Code: +(eval-when-compile + (require 'cl)) +(require 'xml) +(require 'kv) +(require 'pcase) + +(defun esxml-link (url &rest body) + "Creates a standard hypereference link for HTML. + +URL is the URL of the document, BODY is the body of the link." + `(a ((href . ,url)) ,@body)) + +(defun esxml-label (label-text attribs &rest body) + "Make a HTML