[Pmwiki-users] Cookbook coments: flexlayout printable-page smartquotes

Kirill Lapshin kir at lapshin.net
Sun Jun 29 22:18:16 CDT 2003


This is a multi-part message in MIME format.
--------------060300000704070409060006
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

John Rankin wrote:

>2 possible solutions: write 3.5[="=] or (better) 3.5″ (assuming that 3.5" means 3.5 inches)
>
>more generally: 6′ and 7″
>--
>
>Much bigger problem is that lines indented with one space often used to 
>include source code snippets and other similiar information, and from my 
>point of view it does not make any sense to process quotes in there. 
>
>--
>Depending on what else is in the line, you can again write 
>  [=source code snippet=]
>

Well, I guess we have quite different points of view. You are suggesting 
to hold user responsible for markup, while my idea is that user should 
not worry about markup and everything should be done automatically. IMO 
your approach is the way to go for some serious markup languages, like 
book typesetting or html, but wiki was designed for putting some simple 
text on the web. From the very beginning wiki syntax had very limited 
markup capabilities, and the idea was to concetrate on content rather 
then presentation. So ideally smartquotes should take regular text and 
produce more or less nicely typesetted output. It might be not 100% 
accurate, but that's ok for the wiki. So my idea is without changing 
wiki syntax make resulting page nicer.

I did something similiar once, and the approach I took was: we can 
devide all quotes on "opening" (i.e. space quote non-space) and 
"closing". Find first "opening" quote, and make it really opening, if 
next is opening make it <<, then close matching "closing" quotes. All 
"opening" and "closing" quotes that does are not in place replace with 
&quot;. In this case

"something "something else""

would be quoted properly,

"something" 4"

would be quoted properly as well. However

"some 4" somethin"

would be quoted incorrectly (as ``some 4' ' something" instead of ``some 
4" something' ')  . But how often would you encounter that? In this case 
user will have to use [="=] is s/he care.

What is more important, is monospace text. AFAIK monospace font on the 
web (or in a book) is used to quote source code snippets, computer 
outputs, or commands user have to type in shell, or alike. In any of 
these cases there should not be done any typesetting. After all wiki 
engine treats monospace text differently -- every end-of-line is treated 
as <br> and so on. So even now typesetting is not applied to monospace 
text. Why should smartquotes be? Or let me put it this way: do you know 
any single case when user might want to use monospace font and smartquotes?

>While it could easily render [0-9]\s*- as an en dash, it may be better to let people write (say) `- (backtick minus) and have this render as &ndash; (the alternative is -- for en dash and --- for em dash, but most people write -- when they mean em dash, so I don't think that's a good idea)
>
That's the same problem as above. If you force users to write `-, how 
many people will do it? On the other hand if you will do 
/(\d)-(\d)/\1&ndash;\2/ how many dashes would be incorrectly converted 
to en dashes? I would say none.

>Thus one would write: the meeting is from 1`-3 (en dash) but half-baked for a normal hyphen.
>
>My understanding is that strictly, an en dash means 'to' so 1 en dash 3 means 1 to 3, whereas 1 - 3 means 1 minus 3. 
>
That's interesting. Never heard of such interpretation of en dash :). 
What is in your opinion a correct symbol for minus? AFAIK in html there 
are three dashes -- hypen, en and em dash. If purpose of hyphen and em 
dash is quite clear, what is a purpose of en dash? My understanding was 
that it's a minus sign, and it is also appropriate to use it in 
telephone numbers, and dates (in some locales dash is a date delimiter).

In any case, how many people writing wiki pages aware of all these 
tricky details? Suppose `- is the only way to create an en-dash, how 
many people will ever use it? I would argue that my approach will 
increase quality of the pages way more then yours. It still would not 
hurt having `-, so that those who want explicitely tell that something 
is en dash could do that, but \d-\d should take care of the bulk of en 
dashes.

>It already replaces << ... >> with left and right angle quote marks (&[lr]aquo;) -- the guillemet symbols. Are you suggesting it should also replace < ... > with &[lr]saquo; -- easily done.
>

Not exactly, my suggestion was to convert "yadada "foobar" foo" to 
``yadada <<foobar>> foo' ' automagically. It is quite tricky though, and 
does not happen that often. So I am fine with making users to explicetly 
write <<...>>.

>And where does it stop? ... could becomes &hellip; so the dots never break across a line, and so on.
>
That also would be nice.

>Are there other "obvious" smart things it should do?
>
>  
>
That's all what I can think of from the top of my head.

--Kirill


--------------060300000704070409060006
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body>
John Rankin wrote:<br>
<blockquote type="cite" cite="mid992343592john.rankin at affinity.co.nz">
  <pre wrap="">2 possible solutions: write 3.5[="=] or (better) 3.5&amp;Prime; (assuming that 3.5" means 3.5 inches)

more generally: 6&amp;prime; and 7&amp;Prime;
--

Much bigger problem is that lines indented with one space often used to 
include source code snippets and other similiar information, and from my 
point of view it does not make any sense to process quotes in there. 

--
Depending on what else is in the line, you can again write 
  [=source code snippet=]</pre>
</blockquote>
<br>
Well, I guess we have quite different points of view. You are
suggesting to hold user responsible for markup, while my idea is that
user should not worry about markup and everything should be done
automatically. IMO your approach is the way to go for some serious
markup languages, like book typesetting or html, but wiki was designed
for putting some simple text on the web. From the very beginning wiki
syntax had very limited markup capabilities, and the idea was to
concetrate on content rather then presentation. So ideally smartquotes
should take regular text and produce more or less nicely typesetted
output. It might be not 100% accurate, but that's ok for the wiki. So
my idea is without changing wiki syntax make resulting page nicer.<br>
<br>
I did something similiar once, and the approach I took was: we can
devide all quotes on "opening" (i.e. space quote non-space) and
"closing". Find first "opening" quote, and make it really opening, if
next is opening make it &lt;&lt;, then close matching "closing" quotes.
All "opening" and "closing" quotes that does are not in place replace
with &amp;quot;. In this case <br>
<br>
"something "something else"" <br>
<br>
would be quoted properly, <br>
<br>
"something" 4" <br>
<br>
would be quoted properly as well. However<br>
<br>
"some 4" somethin"<br>
<br>
would be quoted incorrectly (as ``some 4' ' something" instead of
``some 4" something' ')&nbsp; . But how often would you encounter that? In
this case user will have to use [="=] is s/he care.<br>
<br>
What is more important, is monospace text. AFAIK monospace font on the
web (or in a book) is used to quote source code snippets, computer
outputs, or commands user have to type in shell, or alike. In any of
these cases there should not be done any typesetting. After all wiki
engine treats monospace text differently -- every end-of-line is
treated as &lt;br&gt; and so on. So even now typesetting is not applied
to monospace text. Why should smartquotes be? Or let me put it this
way: do you know any single case when user might want to use monospace
font and smartquotes?<br>
<br>
<blockquote type="cite" cite="mid992343592john.rankin at affinity.co.nz">
  <pre wrap="">
While it could easily render [0-9]\s*- as an en dash, it may be better to let people write (say) `- (backtick minus) and have this render as &amp;ndash; (the alternative is -- for en dash and --- for em dash, but most people write -- when they mean em dash, so I don't think that's a good idea)</pre>
</blockquote>
That's the same problem as above. If you force users to write `-, how
many people will do it? On the other hand if you will do
/(\d)-(\d)/\1&amp;ndash;\2/ how many dashes would be incorrectly
converted to en dashes? I would say none. <br>
<br>
<blockquote type="cite" cite="mid992343592john.rankin at affinity.co.nz">
  <pre wrap="">
Thus one would write: the meeting is from 1`-3 (en dash) but half-baked for a normal hyphen.

My understanding is that strictly, an en dash means 'to' so 1 en dash 3 means 1 to 3, whereas 1 - 3 means 1 minus 3. </pre>
</blockquote>
That's interesting. Never heard of such interpretation of en dash :).
What is in your opinion a correct symbol for minus? AFAIK in html there
are three dashes -- hypen, en and em dash. If purpose of hyphen and em
dash is quite clear, what is a purpose of en dash? My understanding was
that it's a minus sign, and it is also appropriate to use it in
telephone numbers, and dates (in some locales dash is a date delimiter).<br>
<br>
In any case, how many people writing wiki pages aware of all these
tricky details? Suppose `- is the only way to create an en-dash, how
many people will ever use it? I would argue that my approach will
increase quality of the pages way more then yours. It still would not
hurt having `-, so that those who want explicitely tell that something
is en dash could do that, but \d-\d should take care of the bulk of en
dashes.<br>
<br>
<blockquote type="cite" cite="mid992343592john.rankin at affinity.co.nz">
  <pre wrap="">It already replaces &lt;&lt; ... &gt;&gt; with left and right angle quote marks (&amp;[lr]aquo;) -- the guillemet symbols. Are you suggesting it should also replace &lt; ... &gt; with &amp;[lr]saquo; -- easily done.</pre>
</blockquote>
<br>
Not exactly, my suggestion was to convert "yadada "foobar" foo" to
``yadada &lt;&lt;foobar&gt;&gt; foo' ' automagically. It is quite
tricky though, and does not happen that often. So I am fine with making
users to explicetly write &lt;&lt;...&gt;&gt;.<br>
<blockquote type="cite" cite="mid992343592john.rankin at affinity.co.nz">
  <pre wrap="">
And where does it stop? ... could becomes &amp;hellip; so the dots never break across a line, and so on.</pre>
</blockquote>
That also would be nice. <br>
<br>
<blockquote type="cite" cite="mid992343592john.rankin at affinity.co.nz">
  <pre wrap="">
Are there other "obvious" smart things it should do?

  </pre>
</blockquote>
That's all what I can think of from the top of my head.<br>
<br>
--Kirill<br>
<span style="font-family: monospace;"><br>
</span>
</body>
</html>

--------------060300000704070409060006--





More information about the pmwiki-users mailing list