emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: html checkbox output
Date: Sat, 04 Jan 2014 10:36:13 +0100	[thread overview]
Message-ID: <87r48ot7g2.fsf@bzg.ath.cx> (raw)
In-Reply-To: <87siu5txkx.fsf@gmail.com> (Nicolas Goaziou's message of "Fri, 06 Dec 2013 23:37:50 +0100")

Hi Nicolas and Rick,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> A new buffer keyword (which needs to be documented in org.texi),
> a defcustom with a completely free sexp... Isn't it a bit too much for
> mere checkboxes?

Personally I think the defcustom is enough, as this choice is likely
to be made for all Org documents.

> Filters provide almost the same functionality:
>
>   (defun my-checkbox-filter (item backend info)
>     (when (org-export-derived-backend-p backend 'html)
>       (replace-regexp-in-string "\\`.*\\(<code>\\[\\(X\\|&#xa0;\\|-\\)\\]</code>\\).*$"
>                                 (lambda (rep)
>                                   (let ((check (match-string 2 rep)))
>                                     (cond ((equal check "X") "&#x2611;")
>                                           ((equal check "-") "&#x2610;")
>                                           (t "&#x2610;"))))
>                                 item
>                                 nil nil 1)))
>   (add-to-list 'org-export-filter-item-functions 'my-checkbox-filter)

Yes, but a defcustom would be easier.

> Anyway, here are a few comments.
>
>> +(defcustom org-html-checkbox-type "ascii"
>> +  "The type of checkboxes to use for html export. See
>
> First line of a docstring has to be a single complete sentence.
>
>> +(defun org-html-checkbox (checkbox info)
>> +  "Format CHECKBOX into HTML. This can be overriden on a
>
> Ditto.
>
>> +    (cdr
>> +     (assoc checkbox
>
>   (assq checkbox
>
>> +	    (if (listp checkboxes) checkboxes
>> +	      (if (string-equal (substring checkboxes 0 1) "(")
>
>   (if (eq (aref checkboxes 0) ?\()
>
>> +		  (read checkboxes)
>
> This looks cheesy. `read'? Do you really want to parse arbitrary
> Sexps?

Can we re-work Rick's patch/code and add this feature?  Rick,
are you still on it?

Thanks,

-- 
 Bastien

  reply	other threads:[~2014-01-04  9:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06 21:53 html checkbox output Rick Frankel
2013-12-06 22:37 ` Nicolas Goaziou
2014-01-04  9:36   ` Bastien [this message]
2014-01-06 11:10     ` Nicolas Goaziou
2014-01-06 12:54       ` Bastien
2014-01-07 12:47     ` Rick Frankel
2014-01-07 12:59       ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r48ot7g2.fsf@bzg.ath.cx \
    --to=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).