Re: ddoc patterns

2011-04-08 Thread Aleksandar Ružičić
On Fri, Apr 8, 2011 at 8:52 PM, spir  wrote:
> Yes:
>        Macros:
>            CODE = $0

That's really nice! I might take a look at ddoc and try to write some
useful macros if it's expressive enough...


Re: ddoc patterns

2011-04-08 Thread Aleksandar Ružičić
On Fri, Apr 8, 2011 at 8:52 PM, spir  wrote:
> Right, but IIUC unlike  there is no guarantee for  contents not
> to be interpreted further. It's a "semantic hint" to the rendering engine
> (which is often used to perform syntax highlighting).

AFAIK no major browser (A-grade browser) does nothing more with 
than making it have monospaced font (i.e. look at default styles for
all elements in webkit:
http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css,
you'll see  only has it's font-family defined, while  has
few others more, most notably white-space: pre; and display: block).
And no browser supports rendering syntax highlighting (as I know of)
for any computer language (there are user scripts and maybe extensions
which does that but in no way is that default behavior).

It's true,  does have semantic hint, and that's "hey anything
between  and  is a computer code!", which is I believe
exact what you want - to display some code inline..


Re: ddoc patterns

2011-04-08 Thread spir

On 04/08/2011 03:00 PM, Aleksandar Ružičić wrote:

On Thu, Apr 7, 2011 at 7:27 PM, spir  wrote:

how are we supposed to insert "code phrases" in the
flow of normal text?


  tags should be used for that
(http://www.w3.org/TR/html401/struct/text.html#h-9.2.1).


Right, but IIUC unlike  there is no guarantee for  contents not to 
be interpreted further. It's a "semantic hint" to the rendering engine (which 
is often used to perform syntax highlighting).



 But I know
nothing about ddoc so I don't know how to write macro that will use
  instead of. Although I believe it's a piece of cake :)


Yes:
Macros:
CODE = $0

Denis
--
_
vita es estrany
spir.wikidot.com



Re: ddoc patterns

2011-04-08 Thread Aleksandar Ružičić
On Thu, Apr 7, 2011 at 7:27 PM, spir  wrote:
> how are we supposed to insert "code phrases" in the
> flow of normal text?

 tags should be used for that
(http://www.w3.org/TR/html401/struct/text.html#h-9.2.1). But I know
nothing about ddoc so I don't know how to write macro that will use
 instead of . Although I believe it's a piece of cake :)


Re: ddoc patterns

2011-04-07 Thread Jacob Carlborg

On 2011-04-07 19:27, spir wrote:

On 04/07/2011 03:32 PM, Jacob Carlborg wrote:

On 2011-04-07 12:25, spir wrote:

On 04/07/2011 10:20 AM, spir wrote:

Hello,

In D stdlib's ddoc the idiom "$(D some d code) is constantly used. But
it does
not work by me. Not only it's not interpreted, but the contents are
stripped
out all together. (A *very* big bug of ddoc.)
First, I'd like to know why.
Second, there is another pattern $(D_CODE some d code), but it place
the code
on a separate block. Is this intended?
Third, http://www.digitalmars.com/d/2.0/ddoc.html seems to imply one
can define
new patterns. How to do that? I tried following the example, but my
code ends
up interpreted and stripped out.


OK found it: pattern defs must be places under a "Macro:" section title.

I take the opprtunity to ask another question: does anyone know how to
tag a *span* of text as literal/uninterpreted (either in html or css).
The issue is  makes a *block*, even if not inside a  or ; I
desperately need the same feature for inline pieces of code.

Denis


Have a look at the CSS display property:
http://w3schools.com/css/pr_class_display.asp


Great, does the trick!
But is there else really no other way to suspend interpretation as
? I find this strange... how are we supposed to insert "code
phrases" in the flow of normal text?

Denis


Do you always need  for that. I guess it depends on what the code 
contains.


--
/Jacob Carlborg


Re: ddoc patterns

2011-04-07 Thread spir

On 04/07/2011 03:32 PM, Jacob Carlborg wrote:

On 2011-04-07 12:25, spir wrote:

On 04/07/2011 10:20 AM, spir wrote:

Hello,

In D stdlib's ddoc the idiom "$(D some d code) is constantly used. But
it does
not work by me. Not only it's not interpreted, but the contents are
stripped
out all together. (A *very* big bug of ddoc.)
First, I'd like to know why.
Second, there is another pattern $(D_CODE some d code), but it place
the code
on a separate block. Is this intended?
Third, http://www.digitalmars.com/d/2.0/ddoc.html seems to imply one
can define
new patterns. How to do that? I tried following the example, but my
code ends
up interpreted and stripped out.


OK found it: pattern defs must be places under a "Macro:" section title.

I take the opprtunity to ask another question: does anyone know how to
tag a *span* of text as literal/uninterpreted (either in html or css).
The issue is  makes a *block*, even if not inside a  or ; I
desperately need the same feature for inline pieces of code.

Denis


Have a look at the CSS display property:
http://w3schools.com/css/pr_class_display.asp


Great, does the trick!
But is there else really no other way to suspend interpretation as ? I 
find this strange... how are we supposed to insert "code phrases" in the flow 
of normal text?


Denis
--
_
vita es estrany
spir.wikidot.com



Re: ddoc patterns

2011-04-07 Thread Jacob Carlborg

On 2011-04-07 12:25, spir wrote:

On 04/07/2011 10:20 AM, spir wrote:

Hello,

In D stdlib's ddoc the idiom "$(D some d code) is constantly used. But
it does
not work by me. Not only it's not interpreted, but the contents are
stripped
out all together. (A *very* big bug of ddoc.)
First, I'd like to know why.
Second, there is another pattern $(D_CODE some d code), but it place
the code
on a separate block. Is this intended?
Third, http://www.digitalmars.com/d/2.0/ddoc.html seems to imply one
can define
new patterns. How to do that? I tried following the example, but my
code ends
up interpreted and stripped out.


OK found it: pattern defs must be places under a "Macro:" section title.

I take the opprtunity to ask another question: does anyone know how to
tag a *span* of text as literal/uninterpreted (either in html or css).
The issue is  makes a *block*, even if not inside a  or ; I
desperately need the same feature for inline pieces of code.

Denis


Have a look at the CSS display property: 
http://w3schools.com/css/pr_class_display.asp


--
/Jacob Carlborg


Re: ddoc patterns

2011-04-07 Thread spir

On 04/07/2011 12:53 PM, bearophile wrote:

spir:


I take the opprtunity to ask another question: does anyone know how to tag a
*span* of text as literal/uninterpreted (either in html or css). The issue is
  makes a *block*, even if not inside a  or; I desperately need
the same feature for inline pieces of code.


Try:

--
code here
--

Bye,
bearophile


This makes a block --just what I don't want.

Denis
--
_
vita es estrany
spir.wikidot.com



Re: ddoc patterns

2011-04-07 Thread bearophile
spir:

> I take the opprtunity to ask another question: does anyone know how to tag a 
> *span* of text as literal/uninterpreted (either in html or css). The issue is 
>  makes a *block*, even if not inside a  or ; I desperately need 
> the same feature for inline pieces of code.

Try:

--
code here
--

Bye,
bearophile


Re: ddoc patterns

2011-04-07 Thread spir

On 04/07/2011 10:20 AM, spir wrote:

Hello,

In D stdlib's ddoc the idiom "$(D some d code) is constantly used. But it does
not work by me. Not only it's not interpreted, but the contents are stripped
out all together. (A *very* big bug of ddoc.)
First, I'd like to know why.
Second, there is another pattern $(D_CODE some d code), but it place the code
on a separate block. Is this intended?
Third, http://www.digitalmars.com/d/2.0/ddoc.html seems to imply one can define
new patterns. How to do that? I tried following the example, but my code ends
up interpreted and stripped out.


OK found it: pattern defs must be places under a "Macro:" section title.

I take the opprtunity to ask another question: does anyone know how to tag a 
*span* of text as literal/uninterpreted (either in html or css). The issue is 
 makes a *block*, even if not inside a  or ; I desperately need 
the same feature for inline pieces of code.


Denis
--
_
vita es estrany
spir.wikidot.com