emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Getting checkboxes in HTML output?


From: Peter Davis
Subject: Re: [O] Getting checkboxes in HTML output?
Date: Wed, 27 Nov 2013 13:20:59 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Nov 27, 2013 at 11:03:38AM -0500, Nick Dokos wrote:
> Peter Davis <address@hidden> writes:
> 
> > I noticed that HTML output contains "[ ]" and "[X]", just like the
> > mark-up. Wouldn't it make sense to use actual unchecked or checked
> > checkboxes in HTML?
> >
> > Is there a simple way to do this that I've overlooked?
> >
> 
> A cursory glance through ox-html.el uncovered this:
> 
> --8<---------------cut here---------------start------------->8---
> (defun org-html-checkbox (checkbox)
>   "Format CHECKBOX into HTML."
>   (case checkbox (on "<code>[X]</code>")
>       (off "<code>[&#xa0;]</code>")
>       (trans "<code>[-]</code>")
>       (t "")))
> --8<---------------cut here---------------end--------------->8---
> 
> Maybe you can redefine this function to do what you want?

Yes, this works:

--8<---------------cut here---------------start------------->8---
(defun org-html-checkbox (checkbox)
  "Format CHECKBOX into HTML."
  (case checkbox (on "<input type=\"checkbox\" checked />")
  (off "<input type=\"checkbox\" />")
  (trans "<code>[-]</code>")
  (t "")))
--8<---------------cut here---------------end--------------->8---


Thank you!

-pd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]