Re: [racket-users] Modernizing scribble/html

2016-05-01 Thread Eli Barzilay
On Fri, Apr 15, 2016 at 3:50 PM, Jens Axel Søgaard
 wrote:
> Hi All,
>
> The library scribble/html paired with at-expressions provide a really
> nice way to write html:
>
>   @html[@head[@title{This is a title}]
> @body[@h1{This is a header}
>   @p{This is a paragraph with text}]]

[FWIW, I had long planned to play with a mixture of this and markdown,
and not too long ago I finally hacked something that does this (using
cmark as a library) -- so for some elements the textual contents is
going through MD rendering where the MD text can itself have elements in
it.  I've converted my whole class contents to using it.  They
implementation is a bit hacky, but the resulting combination of at-forms
for the complicated things and MD for the text stuff is extremely
convenient.]


> The library represents html as structures. Each html element type has
> its own Racket structure.

That was intentional -- I disliked sxml/xexprs since I generally found
it way to easy to make mistakes with both of them (in a similar way to
other cases where sexprs are used as a catchall tool for representing
everything).  I thought that using structs would be more robust both for
writing html and for holding representation of xml-like data.  (And BTW,
exposing the structs more is definitely a good idea.)


> The simple solution is to take the elements from
>
> https://www.w3.org/TR/html/index.html#elements-1
>
> and add them to scribble/html.
>
> Is the simple solution also the right solution?

I've replied on GH (https://github.com/racket/scribble/pull/39).  In
particular see #3, #4, and #5 -- I think that it's better to add stuff
in new modules, one for html4, one for html5, and then more for ones
that are more involved like svg and ruby.  And also drop some of the
html4 exotic stuff that is ancient or deprecated or both.  (Which makes
the exclusion of `map` seem natural instead of a problem, and push it
out to the html4 bindings only...)

-- 
((x=>x(x))(x=>x(x)))   Eli Barzilay:
http://barzilay.org/   Maze is Life!

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Modernizing scribble/html

2016-04-15 Thread Sam Tobin-Hochstadt
Yes, I think the simple solution is the right one.

Sam

On Fri, Apr 15, 2016 at 3:50 PM, Jens Axel Søgaard
 wrote:
> Hi All,
>
> The library scribble/html paired with at-expressions provide a really nice
> way to write html:
>
>   @html[@head[@title{This is a title}]
>   @body[@h1{This is a header}
>@p{This is a paragraph with text}]]
>
> The library represents html as structures. Each html element type has its
> own Racket structure. The library is based on the elments available
> in xhtml1
>
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd
>
> Since then new elements have appeared ( svg for one ).
> On an ad hoc basis I have added elements, to urlang/html but am realizing
> a systematic approach is better.
>
> The simple solution is to take the elements from
>
> https://www.w3.org/TR/html/index.html#elements-1
>
> and add them to scribble/html.
>
> Is the simple solution also the right solution?
>
> --
> Jens Axel Søgaard
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Modernizing scribble/html

2016-04-15 Thread Neil Van Dyke

XHTML is dead.  I would work from HTML5, and keep HTML 4.x in mind.

I have considered a struct representation, and would definitely do that 
if I were writing a Web browser, but for now, there's too much reason to 
just use SXML and all the tools around it.


Note that for some purposes, an all-purpose HTML representation needs to 
represent what would be invalid as HTML5.  Not just for representing 
parsed real-world HTML, but perhaps also for liberties that people will 
expect with some of the countless kludgey Web frameworks: 
http://www.neilvandyke.org/racket/html-writing/#%28part._script_.Element%29


Your `at-expr` format will have to support attributes as well as elements.

If you move forward with this new representation, let me know, so I can 
add it to the list in: http://www.neilvandyke.org/racket/sxml-intro/


BTW, do you prefer the look of the `at-expr` text to the sexp-syntax one 
of: http://www.neilvandyke.org/racket/html-template/


Neil V.

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Modernizing scribble/html

2016-04-15 Thread Jens Axel Søgaard
Hi All,

The library scribble/html paired with at-expressions provide a really nice
way to write html:

  @html[@head[@title{This is a title}]
  @body[@h1{This is a header}
   @p{This is a paragraph with text}]]

The library represents html as structures. Each html element type has its
own Racket structure. The library is based on the elments available
in xhtml1

http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd

Since then new elements have appeared ( svg for one ).
On an ad hoc basis I have added elements, to urlang/html but am realizing
a systematic approach is better.

The simple solution is to take the elements from

https://www.w3.org/TR/html/index.html#elements-1

and add them to scribble/html.

Is the simple solution also the right solution?

-- 
Jens Axel Søgaard

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.