From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: html checkbox output Date: Tue, 7 Jan 2014 07:47:05 -0500 Message-ID: <20140107124705.GA54430@eyeBook> References: <20131206215321.GA48654@eyeBook> <87siu5txkx.fsf@gmail.com> <87r48ot7g2.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0W42-0003xT-Ld for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 07:47:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0W3v-0005wY-Bp for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 07:47:22 -0500 Content-Disposition: inline In-Reply-To: <87r48ot7g2.fsf@bzg.ath.cx> 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: Bastien Cc: emacs-orgmode@gnu.org, Nicolas Goaziou Bastien- Top quoting to keep the history but save the search to the bottom :)... Yes, i will rework/simplify the patch (remove the free-form option and the in-buffer setting), but I've been short on time the last week or so.. Will fix it and push this week. BTW, I've kept ascii output as the default mostly so I don't break the regression test. Should I leave it alone or make utf-8 the default and update the test? rick On Sat, Jan 04, 2014 at 10:36:13AM +0100, Bastien wrote: > 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, >