* Export Org checkboxes in ox-html using UTF-8 symbols
@ 2014-03-27 1:56 Grant Rettke
2014-03-27 8:43 ` Nicolas Goaziou
0 siblings, 1 reply; 10+ messages in thread
From: Grant Rettke @ 2014-03-27 1:56 UTC (permalink / raw)
To: emacs-orgmode@gnu.org
Hi,
Sacha Chua made a nice hack to export checkboxes as unicode symbols to
HTML here:
http://sachachua.com/blog/2014/03/emacs-tweaks-export-org-checkboxes-using-utf-8-symbols/?shareadraft=baba27119_533313c944f64
(defun sacha/org-html-checkbox (checkbox)
"Format CHECKBOX into HTML."
(case checkbox (on "<span class=\"check\">☑</span>") ;
checkbox (checked)
(off "<span class=\"checkbox\">☐</span>")
(trans "<code>[-]</code>")
(t "")))
(defadvice org-html-checkbox (around sacha activate)
(setq ad-return-value (sacha/org-html-checkbox (ad-get-arg 0))))
Thanks Sacha.
Regards,
Grant Rettke | AAAS, ACM, AMA, COG, IEEE, Sigma Xi
grettke@acm.org | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Export Org checkboxes in ox-html using UTF-8 symbols
2014-03-27 1:56 Export Org checkboxes in ox-html using UTF-8 symbols Grant Rettke
@ 2014-03-27 8:43 ` Nicolas Goaziou
2014-03-28 13:55 ` Rick Frankel
0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2014-03-27 8:43 UTC (permalink / raw)
To: Grant Rettke; +Cc: emacs-orgmode@gnu.org
Hello,
Grant Rettke <gcr@wisdomandwonder.com> writes:
> Sacha Chua made a nice hack to export checkboxes as unicode symbols to
> HTML here:
>
> http://sachachua.com/blog/2014/03/emacs-tweaks-export-org-checkboxes-using-utf-8-symbols/?shareadraft=baba27119_533313c944f64
>
> (defun sacha/org-html-checkbox (checkbox)
> "Format CHECKBOX into HTML."
> (case checkbox (on "<span class=\"check\">☑</span>") ;
> checkbox (checked)
> (off "<span class=\"checkbox\">☐</span>")
> (trans "<code>[-]</code>")
> (t "")))
> (defadvice org-html-checkbox (around sacha activate)
> (setq ad-return-value (sacha/org-html-checkbox (ad-get-arg 0))))
>
> Thanks Sacha.
There is also:
(setq org-html-checkbox-type 'unicode)
You need a recent Org, though (maybe development version, I didn't check).
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Export Org checkboxes in ox-html using UTF-8 symbols
2014-03-27 8:43 ` Nicolas Goaziou
@ 2014-03-28 13:55 ` Rick Frankel
2014-03-28 14:01 ` Sebastien Vauban
0 siblings, 1 reply; 10+ messages in thread
From: Rick Frankel @ 2014-03-28 13:55 UTC (permalink / raw)
To: emacs-orgmode
On 2014-03-27 04:43, Nicolas Goaziou wrote:
> Hello,
>
> Grant Rettke <gcr@wisdomandwonder.com> writes:
>
> Sacha Chua made a nice hack to export checkboxes as unicode symbols to
> HTML here:
>
> http://sachachua.com/blog/2014/03/emacs-tweaks-export-org-checkboxes-using-utf-8-symbols/?shareadraft=baba27119_533313c944f64
>
> (defun sacha/org-html-checkbox (checkbox)
> "Format CHECKBOX into HTML."
> (case checkbox (on "<span class=\"check\">☑</span>") ;
> checkbox (checked)
> (off "<span class=\"checkbox\">☐</span>")
> (trans "<code>[-]</code>")
> (t "")))
> (defadvice org-html-checkbox (around sacha activate)
> (setq ad-return-value (sacha/org-html-checkbox (ad-get-arg 0))))
>
> Thanks Sacha.
>
> There is also:
>
> (setq org-html-checkbox-type 'unicode)
>
>
> You need a recent Org, though (maybe development version, I didn't
> check).
I didn't apply it in maint, so it's only in master.
BTW, i used "[ ]" for the unchecked box (we use the same for
checked and trans)... I think i'll change the unchecked box to ☐
to match the checked box (same as sachua).
rick
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Export Org checkboxes in ox-html using UTF-8 symbols
2014-03-28 13:55 ` Rick Frankel
@ 2014-03-28 14:01 ` Sebastien Vauban
2014-03-28 14:59 ` Rick Frankel
0 siblings, 1 reply; 10+ messages in thread
From: Sebastien Vauban @ 2014-03-28 14:01 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Rick Frankel wrote:
> BTW, i used "[ ]" for the unchecked box (we use the same for
> checked and trans)... I think i'll change the unchecked box to
> ☐ to match the checked box (same as sachua).
Isn't it error-prone and very misleading to have 3 different states in
the Org files, and just 2 different in the HTML exports?
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Export Org checkboxes in ox-html using UTF-8 symbols
2014-03-28 14:01 ` Sebastien Vauban
@ 2014-03-28 14:59 ` Rick Frankel
2014-03-28 15:27 ` Sebastien Vauban
2014-03-29 14:12 ` Marcin Borkowski
0 siblings, 2 replies; 10+ messages in thread
From: Rick Frankel @ 2014-03-28 14:59 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
On 2014-03-28 10:01, Sebastien Vauban wrote:
> Rick Frankel wrote:
> BTW, i used "[ ]" for the unchecked box (we use the same for
> checked and trans)... I think i'll change the unchecked box to
> ☐ to match the checked box (same as sachua).
>
> Isn't it error-prone and very misleading to have 3 different states in
> the Org files, and just 2 different in the HTML exports?
There *are* three different states in the exported file -- the
"transient" mode is for partially completed rollups:
#+BEGIN_SRC org
,* rollup
- [-] All done
- [X] one
- [ ] two
#+END_SRC
Generates (abbreviated and indented):
#+BEGIN_SRC html
<ul class="org-ul">
<li><code>[-]</code> All done
<ul class="org-ul">
<li><code>[X]</code> one
</li>
<li><code>[ ]</code> two
</li>
</ul>
</li>
</ul>
#+END_SRC
rick
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Export Org checkboxes in ox-html using UTF-8 symbols
2014-03-28 14:59 ` Rick Frankel
@ 2014-03-28 15:27 ` Sebastien Vauban
2014-03-29 14:12 ` Marcin Borkowski
1 sibling, 0 replies; 10+ messages in thread
From: Sebastien Vauban @ 2014-03-28 15:27 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Rick Frankel wrote:
>> Isn't it error-prone and very misleading to have 3 different states in
>> the Org files, and just 2 different in the HTML exports?
>
> There *are* three different states in the exported file -- the
> "transient" mode is for partially completed rollups:
OK, excellent! Sorry for my misunderstanding.
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Export Org checkboxes in ox-html using UTF-8 symbols
2014-03-28 14:59 ` Rick Frankel
2014-03-28 15:27 ` Sebastien Vauban
@ 2014-03-29 14:12 ` Marcin Borkowski
2014-04-02 16:59 ` Rick Frankel
2014-04-17 1:15 ` Rick Frankel
1 sibling, 2 replies; 10+ messages in thread
From: Marcin Borkowski @ 2014-03-29 14:12 UTC (permalink / raw)
To: emacs-orgmode
Dnia 2014-03-28, o godz. 10:59:43
Rick Frankel <rick@rickster.com> napisał(a):
> On 2014-03-28 10:01, Sebastien Vauban wrote:
> > Rick Frankel wrote:
> > BTW, i used "[ ]" for the unchecked box (we use the same for
> > checked and trans)... I think i'll change the unchecked box to
> > ☐ to match the checked box (same as sachua).
> >
> > Isn't it error-prone and very misleading to have 3 different states
> > in the Org files, and just 2 different in the HTML exports?
>
> There *are* three different states in the exported file -- the
> "transient" mode is for partially completed rollups:
>
> #+BEGIN_SRC org
> ,* rollup
> - [-] All done
> - [X] one
> - [ ] two
> #+END_SRC
>
> Generates (abbreviated and indented):
>
> #+BEGIN_SRC html
> <ul class="org-ul">
> <li><code>[-]</code> All done
> <ul class="org-ul">
> <li><code>[X]</code> one
> </li>
> <li><code>[ ]</code> two
> </li>
> </ul>
> </li>
> </ul>
> #+END_SRC
Wouldn't it be better to have (maybe in addition) three distinct
classes for the <li> elements with checkboxes in various states? This
would make styling them with CSS possible.
> rick
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Export Org checkboxes in ox-html using UTF-8 symbols
2014-03-29 14:12 ` Marcin Borkowski
@ 2014-04-02 16:59 ` Rick Frankel
2014-04-17 1:15 ` Rick Frankel
1 sibling, 0 replies; 10+ messages in thread
From: Rick Frankel @ 2014-04-02 16:59 UTC (permalink / raw)
To: Marcin Borkowski; +Cc: emacs-orgmode
On 2014-03-29 10:12, Marcin Borkowski wrote:
> Dnia 2014-03-28, o godz. 10:59:43
> Rick Frankel <rick@rickster.com> napisał(a):
>
> On 2014-03-28 10:01, Sebastien Vauban wrote:
> > Rick Frankel wrote:
> > BTW, i used "[ ]" for the unchecked box (we use the same for
> > checked and trans)... I think i'll change the unchecked box to
> > ☐ to match the checked box (same as sachua).
> >
> Wouldn't it be better to have (maybe in addition) three distinct
> classes for the <li> elements with checkboxes in various states? This
> would make styling them with CSS possible.
Nice idea. I'll look at adding classes to each (checked, or transient)
=li=. I think that the use of classes is minimal due to the orginal
stand-alone (inline css) nature of the html exporter. I certainly
agree that more modern html output is desireable, but it's a big
project...
rick
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Export Org checkboxes in ox-html using UTF-8 symbols
2014-03-29 14:12 ` Marcin Borkowski
2014-04-02 16:59 ` Rick Frankel
@ 2014-04-17 1:15 ` Rick Frankel
2014-04-17 9:45 ` Nicolas Goaziou
1 sibling, 1 reply; 10+ messages in thread
From: Rick Frankel @ 2014-04-17 1:15 UTC (permalink / raw)
To: Marcin Borkowski; +Cc: emacs-orgmode
On Sat, Mar 29, 2014 at 03:12:14PM +0100, Marcin Borkowski wrote:
> Dnia 2014-03-28, o godz. 10:59:43
> Rick Frankel <rick@rickster.com> napisał(a):
>
> > On 2014-03-28 10:01, Sebastien Vauban wrote:
> > > Rick Frankel wrote:
> > > BTW, i used "[ ]" for the unchecked box (we use the same for
> > > checked and trans)... I think i'll change the unchecked box to
> > > ☐ to match the checked box (same as sachua).
> > >
> > > Isn't it error-prone and very misleading to have 3 different states
> > > in the Org files, and just 2 different in the HTML exports?
> >
> Wouldn't it be better to have (maybe in addition) three distinct
> classes for the <li> elements with checkboxes in various states? This
> would make styling them with CSS possible.
The =<li>= elements for checklists now have the class `on', `off' or
`trans' depending on the state of the checkbox.
Thanx for the suggestion.
rick
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Export Org checkboxes in ox-html using UTF-8 symbols
2014-04-17 1:15 ` Rick Frankel
@ 2014-04-17 9:45 ` Nicolas Goaziou
0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2014-04-17 9:45 UTC (permalink / raw)
To: Marcin Borkowski; +Cc: emacs-orgmode
Hello,
Rick Frankel <rick@rickster.com> writes:
> The =<li>= elements for checklists now have the class `on', `off' or
> `trans' depending on the state of the checkbox.
It seems that this patch broke the test suite. Would you mind looking
into it?
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-04-17 9:44 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-27 1:56 Export Org checkboxes in ox-html using UTF-8 symbols Grant Rettke
2014-03-27 8:43 ` Nicolas Goaziou
2014-03-28 13:55 ` Rick Frankel
2014-03-28 14:01 ` Sebastien Vauban
2014-03-28 14:59 ` Rick Frankel
2014-03-28 15:27 ` Sebastien Vauban
2014-03-29 14:12 ` Marcin Borkowski
2014-04-02 16:59 ` Rick Frankel
2014-04-17 1:15 ` Rick Frankel
2014-04-17 9:45 ` Nicolas Goaziou
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).