[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] html checkbox output
From: |
Rick Frankel |
Subject: |
Re: [O] html checkbox output |
Date: |
Tue, 7 Jan 2014 07:47:05 -0500 |
User-agent: |
Mutt/1.5.22 (2013-10-16) |
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 <address@hidden> 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\\| \\|-\\)\\]</code>\\).*$"
> > (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,
>