From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: html checkbox output Date: Sat, 04 Jan 2014 10:36:13 +0100 Message-ID: <87r48ot7g2.fsf@bzg.ath.cx> References: <20131206215321.GA48654@eyeBook> <87siu5txkx.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzNec-0003d1-Lc for emacs-orgmode@gnu.org; Sat, 04 Jan 2014 04:36:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzNeU-00013B-7q for emacs-orgmode@gnu.org; Sat, 04 Jan 2014 04:36:26 -0500 Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]:34256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzNeU-000132-1c for emacs-orgmode@gnu.org; Sat, 04 Jan 2014 04:36:18 -0500 Received: by mail-we0-f170.google.com with SMTP id w61so14371133wes.29 for ; Sat, 04 Jan 2014 01:36:17 -0800 (PST) In-Reply-To: <87siu5txkx.fsf@gmail.com> (Nicolas Goaziou's message of "Fri, 06 Dec 2013 23:37:50 +0100") 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Hi Nicolas and Rick, Nicolas Goaziou 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 "\\`.*\\(\\[\\(X\\| \\|-\\)\\]\\).*$" > (lambda (rep) > (let ((check (match-string 2 rep))) > (cond ((equal check "X") "☑") > ((equal check "-") "☐") > (t "☐")))) > 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