Re: [O] Getting checkboxes in HTML output?

2013-12-03 Thread Peter Davis
On Mon, Dec 02, 2013 at 08:11:25PM -0500, Nick Dokos wrote:
 Peter Davis p...@pfdstudio.com writes:
 
  I've now changed ox-html.el to include this:
 
 
 As an FYI: you don't need to change ox-html.el. You can just load a file
 containing the redefinition *after* you've loaded ox-html. Something
 like this (untested):
 
 (eval-after-load ox-html
   (defun org-html-checkbox (checkbox)
 ))
 
 That way, you have pristine sources *and* you get the redefined
 function.
 

Thanks, Nick. That's definitely cleaner!

-pd



Re: [O] Getting checkboxes in HTML output?

2013-12-03 Thread Rick Frankel

On 2013-12-02 11:38, Peter Davis wrote:

I've now changed ox-html.el to include this:

(defun org-html-checkbox (checkbox)
Format CHECKBOX into HTML.
(case checkbox (on #9746;)
(off #9744;)
(trans #9745;)
(t )))


This is sort of close to using
[ ] for unchecked
[/] for partially checked
[X] for checked

To my aging eyes, the check in U#9745 looks almost like a forward
slash. Certainly, though, this would be potentially confusing,
especially if no [X] boxes were present, so that only [ ] or [/] were
visible.


Right. I am going to make this a configurable option in ox-html,
although consensus is that trying to emulate the partial checkbox
([-]) w/ other unicode symbols is too confusing, so we will simply use
an empty ballot box.

rick



Re: [O] Getting checkboxes in HTML output?

2013-12-03 Thread Rick Frankel

On 2013-12-02 03:44, Sebastien Vauban wrote:

Hello,

Carsten Dominik wrote:
I agree, but couldn't think of any other way. There are 3 other
unicode options:

1. A box with an X  (☒ U+2612 BALLOT BOX WITH X)
2. A bare (unboxed) X (✗ U+2717 BALLOT X)
3 A bare checkmark (✓ U+2713 CHECK MARK)

I  also found this character:

U+237B ⍻ not check mark

If you think one of those would work we could use it instead.

No, I don't think any of them does it.

From http://en.wikipedia.org/wiki/Checkbox:

╭ Tri-state checkbox
│
│ Some applications use checkboxes that allow an indeterminate state in
│ addition to the two provided by a normal checkbox. This third state 
is
│ shown as a square or dash in the checkbox, and indicates that its 
state

│ is neither checked nor unchecked. This is most often used when the
│ checkbox is tied to a collection of items in mixed states.
╰

Something like [-] could be nice, then, as corresponds to the Org look
and feel.


Unfortunately, a symbol like this is unavailable in unicode and the
html checkbox is only two state. The only HTML solutions i've found
involve javascript and images rather than html checkbox (input)
elements.


rick



Re: [O] Getting checkboxes in HTML output?

2013-12-03 Thread Sebastien Vauban
Rick Frankel,

Rick Frankel wrote:
 This is sort of close to using
 [ ] for unchecked
 [/] for partially checked
 [X] for checked

 To my aging eyes, the check in U#9745 looks almost like a forward
 slash. Certainly, though, this would be potentially confusing,
 especially if no [X] boxes were present, so that only [ ] or [/] were
 visible.

 Right. I am going to make this a configurable option in ox-html,
 although consensus is that trying to emulate the partial checkbox
 ([-]) w/ other unicode symbols is too confusing, so we will simply use
 an empty ballot box.

You mean no difference between unchecked and partially checked?  If yes, this
is wrong IMO.

I did not search for long, but there should be usable unicode characters. To
name a few:

- U+25EB White square with vertical bisecting line
- U+25F1 White square with lower left quadrant

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Getting checkboxes in HTML output?

2013-12-03 Thread Peter Davis


On 12/3/13, 10:24 AM, Sebastien Vauban wrote:

Rick Frankel,

Rick Frankel wrote:

This is sort of close to using
[ ] for unchecked
[/] for partially checked
[X] for checked

To my aging eyes, the check in U#9745 looks almost like a forward
slash. Certainly, though, this would be potentially confusing,
especially if no [X] boxes were present, so that only [ ] or [/] were
visible.

Right. I am going to make this a configurable option in ox-html,
although consensus is that trying to emulate the partial checkbox
([-]) w/ other unicode symbols is too confusing, so we will simply use
an empty ballot box.

You mean no difference between unchecked and partially checked?  If yes, this
is wrong IMO.

I did not search for long, but there should be usable unicode characters. To
name a few:

- U+25EB White square with vertical bisecting line
- U+25F1 White square with lower left quadrant


I think Rick's proposal of treating partially completed checkboxes as 
empty is appropriate. It's kind of the graphical equivalent of the 
floor function.


The problem is that we really need three symbols which clearly and 
unambiguously represent three states of completion: none, partial and 
full. Unicode doesn't seem to give us any triplets like that, and trying 
to kludge otherwise unrelated symbols is not going to be satisfactory.


That said, one possibility that strikes me would be:
U+25A1 White square
U+25E7 Square with left half black
U+25A0 Black square

The drawback, as I see it, is that if only white squares or only black 
squares appear, they would simply look like some kind of stylish bullet 
characters.


-pd


--
Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com




Re: [O] Getting checkboxes in HTML output?

2013-12-02 Thread Sebastien Vauban
Hello,

Carsten Dominik wrote:
 I agree, but couldn't think of any other way. There are 3 other
 unicode options:
 
  1. A box with an X  (☒ U+2612 BALLOT BOX WITH X)
  2. A bare (unboxed) X (✗ U+2717 BALLOT X)
  3 A bare checkmark (✓ U+2713 CHECK MARK)
 
 I  also found this character:
 
   U+237B ⍻ not check mark
 
 If you think one of those would work we could use it instead.

 No, I don't think any of them does it.

From http://en.wikipedia.org/wiki/Checkbox:

  ╭ Tri-state checkbox
  │
  │ Some applications use checkboxes that allow an indeterminate state in
  │ addition to the two provided by a normal checkbox. This third state is
  │ shown as a square or dash in the checkbox, and indicates that its state
  │ is neither checked nor unchecked. This is most often used when the
  │ checkbox is tied to a collection of items in mixed states.
  ╰

Something like [-] could be nice, then, as corresponds to the Org look
and feel.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Getting checkboxes in HTML output?

2013-12-02 Thread Peter Davis

I've now changed ox-html.el to include this:

(defun org-html-checkbox (checkbox)
  Format CHECKBOX into HTML.
  (case checkbox (on #9746;)
(off #9744;)
(trans #9745;)
(t )))


This is sort of close to using
 [ ] for unchecked
 [/] for partially checked
 [X] for checked

To my aging eyes, the check in U#9745 looks almost like a forward slash. 
Certainly, though, this would be potentially confusing, especially if no 
[X] boxes were present, so that only [ ] or [/] were visible.


-pd

--
Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com




Re: [O] Getting checkboxes in HTML output?

2013-12-02 Thread Nick Dokos
Peter Davis p...@pfdstudio.com writes:

 I've now changed ox-html.el to include this:


As an FYI: you don't need to change ox-html.el. You can just load a file
containing the redefinition *after* you've loaded ox-html. Something
like this (untested):

(eval-after-load ox-html
  (defun org-html-checkbox (checkbox)
))

That way, you have pristine sources *and* you get the redefined
function.

 (defun org-html-checkbox (checkbox)
   Format CHECKBOX into HTML.
   (case checkbox (on #9746;)
 (off #9744;)
 (trans #9745;)
 (t )))


 This is sort of close to using
  [ ] for unchecked
  [/] for partially checked
  [X] for checked

 To my aging eyes, the check in U#9745 looks almost like a forward
 slash. Certainly, though, this would be potentially confusing,
 especially if no [X] boxes were present, so that only [ ] or [/] were
 visible.

 -pd

-- 
Nick




Re: [O] Getting checkboxes in HTML output?

2013-11-30 Thread Rick Frankel
On Sat, Nov 30, 2013 at 07:54:42AM +0100, Carsten Dominik wrote:

 I don't thing the partial ones work - we should just make then
 unchecked in export if there is nothing better.  the grey dos not
 convey the right information.

I agree, but couldn't think of any other way. There are 3 other
unicode options:

1. A box with an X  (☒ U+2612 BALLOT BOX WITH X)
2. A bare (unboxed) X (✗ U+2717 BALLOT X)
3 A bare checkmark (✓ U+2713 CHECK MARK)

I  also found this character:

   U+237B ⍻ not check mark

If you think one of those would work we could use it instead.


 My vote:
 - Unicode characters as default
 - Both active and inactive checkboxes as option for people who want
 them, via a customize variable.
 - Partial checkboxes should be shown as unchecked.

I will implement the replacement of the ascii characters with the
unicode and the look at the html checkbox options.

FWIW, there are other issues w/ the active version besides the changes
not being saved -- If you are using hierarchical list or rollups
indicators ([x/y], [x%]), they will not be updated w/o some
javascript.

rick
 
 
 On 29.11.2013, at 17:11, Rick Frankel r...@rickster.com wrote:
 
  On 2013-11-28 16:58, Matt Price wrote:
  On Thu, Nov 28, 2013 at 4:26 PM, Sebastien Vauban
  sva-n...@mygooglest.com wrote:
  Achim Gratz wrote:
  Rick Frankel writes:
  For xhtml compatibility, it would need to be 'checked=checked'. I've
  done a quick look at the html dtd, and i does look like input elements
  are allowed outside of forms, but i would need to double
  check... Also, the fallback to [-] for the partially checked state
  is a bit inconsistent, perhaps changing background color or other
  attributre of the checkbox would be better.
  I'd much prefer if you'd be using character entities for that since you
  can't do any input on the HTML anyway (WHITE MEDIUM SQUARE, SQUARE WITH
  LOWER RIGHT DIAGONAL BLACK and BLACK MEDIUM SQUARE look like good
  candidates).  That probably makes it UTF-8 only since I don't think
  these symbols are defined for plain (X)HTML, so for other encodings
  things should probably stay as they are.
  FWIW, here's what I do for the HTML export:
  In JS:
  #+begin_src js
  $(function () {
  $('li  code:contains([X])')
  .parent()
  .addClass('checked')
  .end()
  .remove();
  $('li  code:contains([-])')
  .parent()
  .addClass('halfchecked')
  .end()
  .remove();
  $('li  code:contains([ ])')
  .parent()
  .addClass('unchecked')
  .end()
  .remove();
  });
  #+end_src
  In CSS:
  #+begin_src css
  li.checked {
  list-style-image: url('../images/checked.png');
  }
  li.halfchecked {
  list-style-image: url('../images/halfchecked.png');
  }
  li.unchecked {
  list-style-image: url('../images/unchecked.png');
  }
  #+end_src
  with 3 nice pictures of green V, red X, and blue || (line pause on
  recorders).
  so, I don't know if I'm the only one here who feels this way, but I
  would like to be able to export to an HTML file with ACTUAL HECKBOXES
  that I cna check off, say on a phone, when I put the milk in the
  shopping art, or pack the swim goggles in the vacation bag, or
  whatever.  Maybe though I should be thinking in terms of some other
  export application, remember the milk or something.  Am I describing a
  different use case than other users here, perhaps?
  
  My 3 cents:
  
  I don't see that active checkboxes would help since i don't see a use
  case where you can save the html back with the modified input. The
  github usecase mentioned in anothre thread requires a bunch of
  javascript to work (and write-out the modified file).
  
  While Sebastien's solution is visually appealing, i don't think
  requiring image assets is viable for the core exporter (note that it
  could be done w/o javascript, another dependency i would like to
  avoid).
  
  I've attached an html file which shows the various possible options. My
  comments:
  
  1. As mentioned above, I don't see active checkboxes as useful
  since the modified state is transient.
  2. I don't really like the disabled checkboxes visually.
  3. Either of the other two approaches (the list item style, which
  parallels Sebastien's approach w/o using images) works for me.
  Visually I like the list item style solution, but doesn't really
  make the intent clear.
  
  So, my vote is to change the exporter to use the BALLOT BOX and BALLOT
  BOX WITH CHECK instead of the ascii character currently used and
  indicate partially checked boxes ([-]) with greyed text.
  
  Opinions?
  
  rick
  
  checkbox.html



Re: [O] Getting checkboxes in HTML output?

2013-11-30 Thread Carsten Dominik
Hi Rick,

On 30.11.2013, at 15:07, Rick Frankel r...@rickster.com wrote:

 On Sat, Nov 30, 2013 at 07:54:42AM +0100, Carsten Dominik wrote:
 
 I don't thing the partial ones work - we should just make then
 unchecked in export if there is nothing better.  the grey dos not
 convey the right information.
 
 I agree, but couldn't think of any other way. There are 3 other
 unicode options:
 
   1. A box with an X  (☒ U+2612 BALLOT BOX WITH X)
   2. A bare (unboxed) X (✗ U+2717 BALLOT X)
   3 A bare checkmark (✓ U+2713 CHECK MARK)
 
 I  also found this character:
 
   U+237B ⍻ not check mark
 
 If you think one of those would work we could use it instead.

No, I don't think any of them does it.

 
 
 My vote:
 - Unicode characters as default
 - Both active and inactive checkboxes as option for people who want
 them, via a customize variable.
 - Partial checkboxes should be shown as unchecked.
 
 I will implement the replacement of the ascii characters with the
 unicode and the look at the html checkbox options.
 
 FWIW, there are other issues w/ the active version besides the changes
 not being saved -- If you are using hierarchical list or rollups
 indicators ([x/y], [x%]), they will not be updated w/o some
 javascript.

Thank you Rick!

- Carsten

 
 rick
 
 
 On 29.11.2013, at 17:11, Rick Frankel r...@rickster.com wrote:
 
 On 2013-11-28 16:58, Matt Price wrote:
 On Thu, Nov 28, 2013 at 4:26 PM, Sebastien Vauban
 sva-n...@mygooglest.com wrote:
 Achim Gratz wrote:
 Rick Frankel writes:
 For xhtml compatibility, it would need to be 'checked=checked'. I've
 done a quick look at the html dtd, and i does look like input elements
 are allowed outside of forms, but i would need to double
 check... Also, the fallback to [-] for the partially checked state
 is a bit inconsistent, perhaps changing background color or other
 attributre of the checkbox would be better.
 I'd much prefer if you'd be using character entities for that since you
 can't do any input on the HTML anyway (WHITE MEDIUM SQUARE, SQUARE WITH
 LOWER RIGHT DIAGONAL BLACK and BLACK MEDIUM SQUARE look like good
 candidates).  That probably makes it UTF-8 only since I don't think
 these symbols are defined for plain (X)HTML, so for other encodings
 things should probably stay as they are.
 FWIW, here's what I do for the HTML export:
 In JS:
 #+begin_src js
 $(function () {
 $('li  code:contains([X])')
 .parent()
 .addClass('checked')
 .end()
 .remove();
 $('li  code:contains([-])')
 .parent()
 .addClass('halfchecked')
 .end()
 .remove();
 $('li  code:contains([ ])')
 .parent()
 .addClass('unchecked')
 .end()
 .remove();
 });
 #+end_src
 In CSS:
 #+begin_src css
 li.checked {
 list-style-image: url('../images/checked.png');
 }
 li.halfchecked {
 list-style-image: url('../images/halfchecked.png');
 }
 li.unchecked {
 list-style-image: url('../images/unchecked.png');
 }
 #+end_src
 with 3 nice pictures of green V, red X, and blue || (line pause on
 recorders).
 so, I don't know if I'm the only one here who feels this way, but I
 would like to be able to export to an HTML file with ACTUAL HECKBOXES
 that I cna check off, say on a phone, when I put the milk in the
 shopping art, or pack the swim goggles in the vacation bag, or
 whatever.  Maybe though I should be thinking in terms of some other
 export application, remember the milk or something.  Am I describing a
 different use case than other users here, perhaps?
 
 My 3 cents:
 
 I don't see that active checkboxes would help since i don't see a use
 case where you can save the html back with the modified input. The
 github usecase mentioned in anothre thread requires a bunch of
 javascript to work (and write-out the modified file).
 
 While Sebastien's solution is visually appealing, i don't think
 requiring image assets is viable for the core exporter (note that it
 could be done w/o javascript, another dependency i would like to
 avoid).
 
 I've attached an html file which shows the various possible options. My
 comments:
 
 1. As mentioned above, I don't see active checkboxes as useful
 since the modified state is transient.
 2. I don't really like the disabled checkboxes visually.
 3. Either of the other two approaches (the list item style, which
 parallels Sebastien's approach w/o using images) works for me.
 Visually I like the list item style solution, but doesn't really
 make the intent clear.
 
 So, my vote is to change the exporter to use the BALLOT BOX and BALLOT
 BOX WITH CHECK instead of the ascii character currently used and
 indicate partially checked boxes ([-]) with greyed text.
 
 Opinions?
 
 rick
 
 checkbox.html




Re: [O] Getting checkboxes in HTML output?

2013-11-29 Thread Rick Frankel

On 2013-11-28 16:58, Matt Price wrote:

On Thu, Nov 28, 2013 at 4:26 PM, Sebastien Vauban
sva-n...@mygooglest.com wrote:
Achim Gratz wrote:
Rick Frankel writes:
For xhtml compatibility, it would need to be 'checked=checked'. I've
done a quick look at the html dtd, and i does look like input elements
are allowed outside of forms, but i would need to double
check... Also, the fallback to [-] for the partially checked state
is a bit inconsistent, perhaps changing background color or other
attributre of the checkbox would be better.

I'd much prefer if you'd be using character entities for that since you
can't do any input on the HTML anyway (WHITE MEDIUM SQUARE, SQUARE WITH
LOWER RIGHT DIAGONAL BLACK and BLACK MEDIUM SQUARE look like good
candidates).  That probably makes it UTF-8 only since I don't think
these symbols are defined for plain (X)HTML, so for other encodings
things should probably stay as they are.

FWIW, here's what I do for the HTML export:

In JS:

#+begin_src js
$(function () {
$('li  code:contains([X])')
.parent()
.addClass('checked')
.end()
.remove();
$('li  code:contains([-])')
.parent()
.addClass('halfchecked')
.end()
.remove();
$('li  code:contains([ ])')
.parent()
.addClass('unchecked')
.end()
.remove();
});
#+end_src

In CSS:

#+begin_src css
li.checked {
list-style-image: url('../images/checked.png');
}

li.halfchecked {
list-style-image: url('../images/halfchecked.png');
}

li.unchecked {
list-style-image: url('../images/unchecked.png');
}
#+end_src

with 3 nice pictures of green V, red X, and blue || (line pause on
recorders).



so, I don't know if I'm the only one here who feels this way, but I
would like to be able to export to an HTML file with ACTUAL HECKBOXES
that I cna check off, say on a phone, when I put the milk in the
shopping art, or pack the swim goggles in the vacation bag, or
whatever.  Maybe though I should be thinking in terms of some other
export application, remember the milk or something.  Am I describing a
different use case than other users here, perhaps?


My 3 cents:

I don't see that active checkboxes would help since i don't see a use
case where you can save the html back with the modified input. The
github usecase mentioned in anothre thread requires a bunch of
javascript to work (and write-out the modified file).

While Sebastien's solution is visually appealing, i don't think
requiring image assets is viable for the core exporter (note that it
could be done w/o javascript, another dependency i would like to
avoid).

I've attached an html file which shows the various possible options. My
comments:

1. As mentioned above, I don't see active checkboxes as useful
since the modified state is transient.
2. I don't really like the disabled checkboxes visually.
3. Either of the other two approaches (the list item style, which
parallels Sebastien's approach w/o using images) works for me.
Visually I like the list item style solution, but doesn't really
make the intent clear.

So, my vote is to change the exporter to use the BALLOT BOX and BALLOT
BOX WITH CHECK instead of the ascii character currently used and
indicate partially checked boxes ([-]) with greyed text.

Opinions?

rick

Title: checkbox test

  
  
Checkbox samples
Active

   unchecked
   checked
  
 partial

Inactive

   unchecked
   checked
  
 partial

List item style

  unchecked
  checked
  partial

Unicode characters

   unchecked (BALLOT BOX)
   checked (BALLOT BOX WITH CHECK)
  
 partial (BALLOT BOX WITH CHECK)
  
   alternative checked (BALLOT BOX WITH X)

  



Re: [O] Getting checkboxes in HTML output?

2013-11-29 Thread Peter Davis


On 11/29/13, 11:11 AM, Rick Frankel wrote:

On 2013-11-28 16:58, Matt Price wrote:

On Thu, Nov 28, 2013 at 4:26 PM, Sebastien Vauban
sva-n...@mygooglest.com wrote:
Achim Gratz wrote:
Rick Frankel writes:
For xhtml compatibility, it would need to be 'checked=checked'. I've
done a quick look at the html dtd, and i does look like input elements
are allowed outside of forms, but i would need to double
check... Also, the fallback to [-] for the partially checked state
is a bit inconsistent, perhaps changing background color or other
attributre of the checkbox would be better.

I'd much prefer if you'd be using character entities for that since you
can't do any input on the HTML anyway (WHITE MEDIUM SQUARE, SQUARE WITH
LOWER RIGHT DIAGONAL BLACK and BLACK MEDIUM SQUARE look like good
candidates).  That probably makes it UTF-8 only since I don't think
these symbols are defined for plain (X)HTML, so for other encodings
things should probably stay as they are.

FWIW, here's what I do for the HTML export:

In JS:

#+begin_src js
$(function () {
$('li  code:contains([X])')
.parent()
.addClass('checked')
.end()
.remove();
$('li  code:contains([-])')
.parent()
.addClass('halfchecked')
.end()
.remove();
$('li  code:contains([ ])')
.parent()
.addClass('unchecked')
.end()
.remove();
});
#+end_src

In CSS:

#+begin_src css
li.checked {
list-style-image: url('../images/checked.png');
}

li.halfchecked {
list-style-image: url('../images/halfchecked.png');
}

li.unchecked {
list-style-image: url('../images/unchecked.png');
}
#+end_src

with 3 nice pictures of green V, red X, and blue || (line pause on
recorders).



so, I don't know if I'm the only one here who feels this way, but I
would like to be able to export to an HTML file with ACTUAL HECKBOXES
that I cna check off, say on a phone, when I put the milk in the
shopping art, or pack the swim goggles in the vacation bag, or
whatever.  Maybe though I should be thinking in terms of some other
export application, remember the milk or something.  Am I describing a
different use case than other users here, perhaps?


My 3 cents:

I don't see that active checkboxes would help since i don't see a use
case where you can save the html back with the modified input. The
github usecase mentioned in anothre thread requires a bunch of
javascript to work (and write-out the modified file).

While Sebastien's solution is visually appealing, i don't think
requiring image assets is viable for the core exporter (note that it
could be done w/o javascript, another dependency i would like to
avoid).

I've attached an html file which shows the various possible options. My
comments:

1. As mentioned above, I don't see active checkboxes as useful
since the modified state is transient.
2. I don't really like the disabled checkboxes visually.
3. Either of the other two approaches (the list item style, which
parallels Sebastien's approach w/o using images) works for me.
Visually I like the list item style solution, but doesn't really
make the intent clear.

So, my vote is to change the exporter to use the BALLOT BOX and BALLOT
BOX WITH CHECK instead of the ascii character currently used and
indicate partially checked boxes ([-]) with greyed text.

Opinions?

rick



Thanks for the handy comparison page, Rick. Visually, I'm happy with 
either actual HTML input ... checkbox elements or the Unicode BALLOT 
BOX and BALLOT BOX WITH CHECK characters. Semantically, I suppose it's 
better to avoid having active input elements, since, as you point out, 
they're completely transient, and so potentially misleading.


Unfortunately, I don't think any of the partial options is very clear. 
They graying out is not particularly clear. But I could live with it if 
no better alternatives are found.


-pd

--

Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com




Re: [O] Getting checkboxes in HTML output?

2013-11-29 Thread Carsten Dominik
Dear Rick,

this is a very useful comparison, thank you!

I don't thing the partial ones work - we should just make then unchecked in 
export if there is nothing better.  the grey dos not convey the right 
information.

I like the last option (unicode characters) best. The inactive checkboxes are 
visually appealing, but not consistent with function, I think.

My vote:
- Unicode characters as default
- Both active and inactive checkboxes as option for people who want them, via a 
customize variable.
- Partial checkboxes should be shown as unchecked.

Cheers

- Carsten


On 29.11.2013, at 17:11, Rick Frankel r...@rickster.com wrote:

 On 2013-11-28 16:58, Matt Price wrote:
 On Thu, Nov 28, 2013 at 4:26 PM, Sebastien Vauban
 sva-n...@mygooglest.com wrote:
 Achim Gratz wrote:
 Rick Frankel writes:
 For xhtml compatibility, it would need to be 'checked=checked'. I've
 done a quick look at the html dtd, and i does look like input elements
 are allowed outside of forms, but i would need to double
 check... Also, the fallback to [-] for the partially checked state
 is a bit inconsistent, perhaps changing background color or other
 attributre of the checkbox would be better.
 I'd much prefer if you'd be using character entities for that since you
 can't do any input on the HTML anyway (WHITE MEDIUM SQUARE, SQUARE WITH
 LOWER RIGHT DIAGONAL BLACK and BLACK MEDIUM SQUARE look like good
 candidates).  That probably makes it UTF-8 only since I don't think
 these symbols are defined for plain (X)HTML, so for other encodings
 things should probably stay as they are.
 FWIW, here's what I do for the HTML export:
 In JS:
 #+begin_src js
 $(function () {
 $('li  code:contains([X])')
 .parent()
 .addClass('checked')
 .end()
 .remove();
 $('li  code:contains([-])')
 .parent()
 .addClass('halfchecked')
 .end()
 .remove();
 $('li  code:contains([ ])')
 .parent()
 .addClass('unchecked')
 .end()
 .remove();
 });
 #+end_src
 In CSS:
 #+begin_src css
 li.checked {
 list-style-image: url('../images/checked.png');
 }
 li.halfchecked {
 list-style-image: url('../images/halfchecked.png');
 }
 li.unchecked {
 list-style-image: url('../images/unchecked.png');
 }
 #+end_src
 with 3 nice pictures of green V, red X, and blue || (line pause on
 recorders).
 so, I don't know if I'm the only one here who feels this way, but I
 would like to be able to export to an HTML file with ACTUAL HECKBOXES
 that I cna check off, say on a phone, when I put the milk in the
 shopping art, or pack the swim goggles in the vacation bag, or
 whatever.  Maybe though I should be thinking in terms of some other
 export application, remember the milk or something.  Am I describing a
 different use case than other users here, perhaps?
 
 My 3 cents:
 
 I don't see that active checkboxes would help since i don't see a use
 case where you can save the html back with the modified input. The
 github usecase mentioned in anothre thread requires a bunch of
 javascript to work (and write-out the modified file).
 
 While Sebastien's solution is visually appealing, i don't think
 requiring image assets is viable for the core exporter (note that it
 could be done w/o javascript, another dependency i would like to
 avoid).
 
 I've attached an html file which shows the various possible options. My
 comments:
 
 1. As mentioned above, I don't see active checkboxes as useful
 since the modified state is transient.
 2. I don't really like the disabled checkboxes visually.
 3. Either of the other two approaches (the list item style, which
 parallels Sebastien's approach w/o using images) works for me.
 Visually I like the list item style solution, but doesn't really
 make the intent clear.
 
 So, my vote is to change the exporter to use the BALLOT BOX and BALLOT
 BOX WITH CHECK instead of the ascii character currently used and
 indicate partially checked boxes ([-]) with greyed text.
 
 Opinions?
 
 rick
 
 checkbox.html




Re: [O] Getting checkboxes in HTML output?

2013-11-28 Thread Rick Frankel
On Wed, Nov 27, 2013 at 01:20:59PM -0500, Peter Davis wrote:
 On Wed, Nov 27, 2013 at 11:03:38AM -0500, Nick Dokos wrote:
  Peter Davis p...@pfdstudio.com writes:
 
   I noticed that HTML output contains [ ] and [X], just like
 the
   mark-up. Wouldn't it make sense to use actual unchecked or
 checked
   checkboxes in HTML?
  
   Is there a simple way to do this that I've overlooked?
  
 
  A cursory glance through ox-html.el uncovered this:
 
  --8---cut here---start-8---
  (defun org-html-checkbox (checkbox)
Format CHECKBOX into HTML.
(case checkbox (on code[X]/code)
  (off code[#xa0;]/code)
  (trans code[-]/code)
  (t )))
  --8---cut here---end---8---
 
  Maybe you can redefine this function to do what you want?

 Yes, this works:

 --8---cut here---start-8---
 (defun org-html-checkbox (checkbox)
   Format CHECKBOX into HTML.
   (case checkbox (on input type=\checkbox\ checked /)
   (off input type=\checkbox\ /)
   (trans code[-]/code)
   (t )))
 --8---cut here---end---8---

For xhtml compatibility, it would need to be 'checked=checked'. I've
done a quick look at the html dtd, and i does look like input elements
are allowed outside of forms, but i would need to double
check... Also, the fallback to [-] for the partially checked state
is a bit inconsistent, perhaps changing background color or other
attributre of the checkbox would be better.

I would be willing to make this change (as an option?) to the html
exporter if others agree.

rick



Re: [O] Getting checkboxes in HTML output?

2013-11-28 Thread Peter Davis


On 11/28/13, 8:33 AM, Rick Frankel wrote:

On Wed, Nov 27, 2013 at 01:20:59PM -0500, Peter Davis wrote:

On Wed, Nov 27, 2013 at 11:03:38AM -0500, Nick Dokos wrote:

Peter Davis p...@pfdstudio.com writes:


I noticed that HTML output contains [ ] and [X], just like

the

mark-up. Wouldn't it make sense to use actual unchecked or

checked

checkboxes in HTML?

Is there a simple way to do this that I've overlooked?


A cursory glance through ox-html.el uncovered this:

--8---cut here---start-8---
(defun org-html-checkbox (checkbox)
   Format CHECKBOX into HTML.
   (case checkbox (on code[X]/code)
 (off code[#xa0;]/code)
 (trans code[-]/code)
 (t )))
--8---cut here---end---8---

Maybe you can redefine this function to do what you want?

Yes, this works:

--8---cut here---start-8---
(defun org-html-checkbox (checkbox)
   Format CHECKBOX into HTML.
   (case checkbox (on input type=\checkbox\ checked /)
   (off input type=\checkbox\ /)
   (trans code[-]/code)
   (t )))
--8---cut here---end---8---

For xhtml compatibility, it would need to be 'checked=checked'. I've
done a quick look at the html dtd, and i does look like input elements
are allowed outside of forms, but i would need to double
check... Also, the fallback to [-] for the partially checked state
is a bit inconsistent, perhaps changing background color or other
attributre of the checkbox would be better.

I would be willing to make this change (as an option?) to the html
exporter if others agree.
Thanks, Rick. Adding a value for the checked attribute is no problem. I 
didn't have a good solution for the partially checked state. One 
possibility would be adding the 'disabled=disabled' attribute, which 
would make it appear gray. However, I've considered adding that 
attribute in all cases, since the HTML output is really for display and 
not input.


I'd love to see this as an option in the main code, so I don't have to 
keep retrofitting it into succeeding versions.


-pd

--

Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com




Re: [O] Getting checkboxes in HTML output?

2013-11-28 Thread Waldemar Quevedo
fyi, this feature is heavily requested in Github for their markup project:
https://github.com/github/markup/issues/208

So +1 on changing this behavior in Org mode markup itself, since there is
already user demand which would validate this usage.



On Thu, Nov 28, 2013 at 12:45 AM, Peter Davis p...@pfdstudio.com wrote:

 I noticed that HTML output contains [ ] and [X], just like the
 mark-up. Wouldn't it make sense to use actual unchecked or checked
 checkboxes in HTML?

 Is there a simple way to do this that I've overlooked?

 Thanks,
 -pd





Re: [O] Getting checkboxes in HTML output?

2013-11-28 Thread Waldemar Quevedo
By the way TL;DR; from that Github thread:

It seems that Markdown by default does not support read only checkboxes,
and Github would not implement this behavior because they want to keep
compatibility with other implementations of Markdown:
https://github.com/github/markup/issues/208#issuecomment-24927799

I think that Org mode markup syntax is still in the stage where we can be
liberal enough to change this kind of behavior which would be gladly
received by many people (I hope!), specially since this would change only
the HTML output.

Some feedback on that thread on a feature like this:
- +1 for readonly (checkboxes). It cannot be that hard... =
https://github.com/github/markup/issues/208#issuecomment-27712872
- +1, i cannot live without checkboxes in readme!  =
https://github.com/github/markup/issues/208#issuecomment-27713464
- I'll die; Please add checkboxes =
https://github.com/github/markup/issues/208#issuecomment-28001693

Cheers!

- Waldemar


On Thu, Nov 28, 2013 at 11:30 PM, Waldemar Quevedo 
waldemar.quev...@gmail.com wrote:

 fyi, this feature is heavily requested in Github for their markup project:
 https://github.com/github/markup/issues/208

 So +1 on changing this behavior in Org mode markup itself, since there is
 already user demand which would validate this usage.



 On Thu, Nov 28, 2013 at 12:45 AM, Peter Davis p...@pfdstudio.com wrote:

 I noticed that HTML output contains [ ] and [X], just like the
 mark-up. Wouldn't it make sense to use actual unchecked or checked
 checkboxes in HTML?

 Is there a simple way to do this that I've overlooked?

 Thanks,
 -pd






Re: [O] Getting checkboxes in HTML output?

2013-11-28 Thread Bastien
Hi Rick,

Rick Frankel r...@rickster.com writes:

 I would be willing to make this change (as an option?) to the html
 exporter if others agree.

FWIW I do agree this is a good change.

-- 
 Bastien



Re: [O] Getting checkboxes in HTML output?

2013-11-28 Thread Matt Price
On Thu, Nov 28, 2013 at 11:08 AM, Bastien b...@gnu.org wrote:
 Hi Rick,

 Rick Frankel r...@rickster.com writes:

 I would be willing to make this change (as an option?) to the html
 exporter if others agree.

 FWIW I do agree this is a good change.

not that this opinion really matters, but I've been wanting this
option for a while, e.g. for exporting hoping lists and the like.



 --
  Bastien




Re: [O] Getting checkboxes in HTML output?

2013-11-28 Thread Achim Gratz
Rick Frankel writes:
 For xhtml compatibility, it would need to be 'checked=checked'. I've
 done a quick look at the html dtd, and i does look like input elements
 are allowed outside of forms, but i would need to double
 check... Also, the fallback to [-] for the partially checked state
 is a bit inconsistent, perhaps changing background color or other
 attributre of the checkbox would be better.

I'd much prefer if you'd be using character entities for that since you
can't do any input on the HTML anyway (WHITE MEDIUM SQUARE, SQUARE WITH
LOWER RIGHT DIAGONAL BLACK and BLACK MEDIUM SQUARE look like good
candidates).  That probably makes it UTF-8 only since I don't think
these symbols are defined for plain (X)HTML, so for other encodings
things should probably stay as they are.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




Re: [O] Getting checkboxes in HTML output?

2013-11-28 Thread Sebastien Vauban
Achim Gratz wrote:
 Rick Frankel writes:
 For xhtml compatibility, it would need to be 'checked=checked'. I've
 done a quick look at the html dtd, and i does look like input elements
 are allowed outside of forms, but i would need to double
 check... Also, the fallback to [-] for the partially checked state
 is a bit inconsistent, perhaps changing background color or other
 attributre of the checkbox would be better.

 I'd much prefer if you'd be using character entities for that since you
 can't do any input on the HTML anyway (WHITE MEDIUM SQUARE, SQUARE WITH
 LOWER RIGHT DIAGONAL BLACK and BLACK MEDIUM SQUARE look like good
 candidates).  That probably makes it UTF-8 only since I don't think
 these symbols are defined for plain (X)HTML, so for other encodings
 things should probably stay as they are.

FWIW, here's what I do for the HTML export:

In JS:

#+begin_src js
  $(function () {
  $('li  code:contains([X])')
  .parent()
  .addClass('checked')
  .end()
  .remove();
  $('li  code:contains([-])')
  .parent()
  .addClass('halfchecked')
  .end()
  .remove();
  $('li  code:contains([ ])')
  .parent()
  .addClass('unchecked')
  .end()
  .remove();
  });
#+end_src

In CSS:

#+begin_src css
  li.checked {
  list-style-image: url('../images/checked.png');
  }

  li.halfchecked {
  list-style-image: url('../images/halfchecked.png');
  }

  li.unchecked {
  list-style-image: url('../images/unchecked.png');
  }
#+end_src

with 3 nice pictures of green V, red X, and blue || (line pause on
recorders).

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Getting checkboxes in HTML output?

2013-11-28 Thread Matt Price
On Thu, Nov 28, 2013 at 4:26 PM, Sebastien Vauban
sva-n...@mygooglest.com wrote:
 Achim Gratz wrote:
 Rick Frankel writes:
 For xhtml compatibility, it would need to be 'checked=checked'. I've
 done a quick look at the html dtd, and i does look like input elements
 are allowed outside of forms, but i would need to double
 check... Also, the fallback to [-] for the partially checked state
 is a bit inconsistent, perhaps changing background color or other
 attributre of the checkbox would be better.

 I'd much prefer if you'd be using character entities for that since you
 can't do any input on the HTML anyway (WHITE MEDIUM SQUARE, SQUARE WITH
 LOWER RIGHT DIAGONAL BLACK and BLACK MEDIUM SQUARE look like good
 candidates).  That probably makes it UTF-8 only since I don't think
 these symbols are defined for plain (X)HTML, so for other encodings
 things should probably stay as they are.

 FWIW, here's what I do for the HTML export:

 In JS:

 #+begin_src js
   $(function () {
   $('li  code:contains([X])')
   .parent()
   .addClass('checked')
   .end()
   .remove();
   $('li  code:contains([-])')
   .parent()
   .addClass('halfchecked')
   .end()
   .remove();
   $('li  code:contains([ ])')
   .parent()
   .addClass('unchecked')
   .end()
   .remove();
   });
 #+end_src

 In CSS:

 #+begin_src css
   li.checked {
   list-style-image: url('../images/checked.png');
   }

   li.halfchecked {
   list-style-image: url('../images/halfchecked.png');
   }

   li.unchecked {
   list-style-image: url('../images/unchecked.png');
   }
 #+end_src

 with 3 nice pictures of green V, red X, and blue || (line pause on
 recorders).



so, I don't know if I'm the only one here who feels this way, but I
would like to be able to export to an HTML file with ACTUAL HECKBOXES
that I cna check off, say on a phone, when I put the milk in the
shopping art, or pack the swim goggles in the vacation bag, or
whatever.  Maybe though I should be thinking in terms of some other
export application, remember the milk or something.  Am I describing a
different use case than other users here, perhaps?



Re: [O] Getting checkboxes in HTML output?

2013-11-28 Thread Eric Abrahamsen
Sebastien Vauban sva-n...@mygooglest.com
writes:

 Achim Gratz wrote:
 Rick Frankel writes:
 For xhtml compatibility, it would need to be 'checked=checked'. I've
 done a quick look at the html dtd, and i does look like input elements
 are allowed outside of forms, but i would need to double
 check... Also, the fallback to [-] for the partially checked state
 is a bit inconsistent, perhaps changing background color or other
 attributre of the checkbox would be better.

 I'd much prefer if you'd be using character entities for that since you
 can't do any input on the HTML anyway (WHITE MEDIUM SQUARE, SQUARE WITH
 LOWER RIGHT DIAGONAL BLACK and BLACK MEDIUM SQUARE look like good
 candidates).  That probably makes it UTF-8 only since I don't think
 these symbols are defined for plain (X)HTML, so for other encodings
 things should probably stay as they are.

 FWIW, here's what I do for the HTML export:

 In JS:

 #+begin_src js
   $(function () {
   $('li  code:contains([X])')
   .parent()
   .addClass('checked')
   .end()
   .remove();
   $('li  code:contains([-])')
   .parent()
   .addClass('halfchecked')
   .end()
   .remove();
   $('li  code:contains([])')
   .parent()
   .addClass('unchecked')
   .end()
   .remove();
   });
 #+end_src

 In CSS:

 #+begin_src css
   li.checked {
   list-style-image: url('../images/checked.png');
   }

   li.halfchecked {
   list-style-image: url('../images/halfchecked.png');
   }

   li.unchecked {
   list-style-image: url('../images/unchecked.png');
   }
 #+end_src

 with 3 nice pictures of green V, red X, and blue || (line pause on
 recorders).

This seems like a much nicer solution -- JS seems semantically more
right, since what you're doing is toggling display state, not actually
preparing content to input to a form...




[O] Getting checkboxes in HTML output?

2013-11-27 Thread Peter Davis
I noticed that HTML output contains [ ] and [X], just like the
mark-up. Wouldn't it make sense to use actual unchecked or checked
checkboxes in HTML?

Is there a simple way to do this that I've overlooked?

Thanks,
-pd




Re: [O] Getting checkboxes in HTML output?

2013-11-27 Thread Nick Dokos
Peter Davis p...@pfdstudio.com writes:

 I noticed that HTML output contains [ ] and [X], just like the
 mark-up. Wouldn't it make sense to use actual unchecked or checked
 checkboxes in HTML?

 Is there a simple way to do this that I've overlooked?


A cursory glance through ox-html.el uncovered this:

--8---cut here---start-8---
(defun org-html-checkbox (checkbox)
  Format CHECKBOX into HTML.
  (case checkbox (on code[X]/code)
(off code[#xa0;]/code)
(trans code[-]/code)
(t )))
--8---cut here---end---8---

Maybe you can redefine this function to do what you want?

Nick




Re: [O] Getting checkboxes in HTML output?

2013-11-27 Thread Peter Davis
On Wed, Nov 27, 2013 at 11:03:38AM -0500, Nick Dokos wrote:
 Peter Davis p...@pfdstudio.com writes:
 
  I noticed that HTML output contains [ ] and [X], just like the
  mark-up. Wouldn't it make sense to use actual unchecked or checked
  checkboxes in HTML?
 
  Is there a simple way to do this that I've overlooked?
 
 
 A cursory glance through ox-html.el uncovered this:
 
 --8---cut here---start-8---
 (defun org-html-checkbox (checkbox)
   Format CHECKBOX into HTML.
   (case checkbox (on code[X]/code)
   (off code[#xa0;]/code)
   (trans code[-]/code)
   (t )))
 --8---cut here---end---8---
 
 Maybe you can redefine this function to do what you want?

Yes, this works:

--8---cut here---start-8---
(defun org-html-checkbox (checkbox)
  Format CHECKBOX into HTML.
  (case checkbox (on input type=\checkbox\ checked /)
  (off input type=\checkbox\ /)
  (trans code[-]/code)
  (t )))
--8---cut here---end---8---


Thank you!

-pd