From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: Getting checkboxes in HTML output? Date: Thu, 28 Nov 2013 08:33:30 -0500 Message-ID: <20131128133329.GA28945@eyeBook> References: <20131127154534.GA12765@pdavismbp15.iscinternal.com> <8738mhal2d.fsf@alphaville.bos.redhat.com> <20131127182059.GB12765@pdavismbp15.iscinternal.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm1iv-0003g6-R0 for emacs-orgmode@gnu.org; Thu, 28 Nov 2013 08:33:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vm1io-0005It-VY for emacs-orgmode@gnu.org; Thu, 28 Nov 2013 08:33:41 -0500 Received: from mail.rickster.com ([204.62.15.78]:45231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vm1io-0005Hq-Sc for emacs-orgmode@gnu.org; Thu, 28 Nov 2013 08:33:34 -0500 Content-Disposition: inline In-Reply-To: <20131127182059.GB12765@pdavismbp15.iscinternal.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Peter Davis Cc: Nick Dokos , emacs-orgmode@gnu.org On Wed, Nov 27, 2013 at 01:20:59PM -0500, Peter Davis wrote: > On Wed, Nov 27, 2013 at 11:03:38AM -0500, Nick Dokos wrote: > > Peter Davis 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 "[X]") > > (off "[ ]") > > (trans "[-]") > > (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 "") > (off "") > (trans "[-]") > (t ""))) > --8<---------------cut here---------------end--------------->8--- For xhtml compatibility, it would need to be 'checked="checked"'. I've done a quick look at the html dtd, and i does look like input elements are allowed outside of forms, but i would need to double check... Also, the fallback to "[-]" for the partially checked state is a bit inconsistent, perhaps changing background color or other attributre of the checkbox would be better. I would be willing to make this change (as an option?) to the html exporter if others agree. rick