Pretty Printed Output?

View: New views
8 Messages — Rating Filter:   Alert me  

Pretty Printed Output?

by AnthonyW :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Is there a mode whereby I can turn on pretty printed output for my
xhtml?  (I'm thinking of a LiftRule, I think?).  Preferably, I'd also
like to control some details like indentation size.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to liftweb@...
To unsubscribe from this group, send email to liftweb+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Pretty Printed Output?

by Timothy Perrett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Im not sure i understand the question - in what was it the current
output not pretty printed?

cheers, Tim

On Nov 7, 9:01 am, aw <anth...@...> wrote:
> Is there a mode whereby I can turn on pretty printed output for my
> xhtml?  (I'm thinking of a LiftRule, I think?).  Preferably, I'd also
> like to control some details like indentation size.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to liftweb@...
To unsubscribe from this group, send email to liftweb+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Pretty Printed Output?

by bearfeeder :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Sat, Nov 7, 2009 at 1:01 AM, aw <anthony@...> wrote:

Is there a mode whereby I can turn on pretty printed output for my
xhtml?  (I'm thinking of a LiftRule, I think?).  Preferably, I'd also
like to control some details like indentation size.

No mode for that... sorry.
 




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to liftweb@...
To unsubscribe from this group, send email to liftweb+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Pretty Printed Output?

by Peter Robinett-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


How hard would this be to implement? I'm a big fan of pretty HTML
output, so I'd be interested in implementing this if it's not too
hard.

Peter Robinett

On Nov 7, 7:06 am, David Pollak <feeder.of.the.be...@...> wrote:

> On Sat, Nov 7, 2009 at 1:01 AM, aw <anth...@...> wrote:
>
> > Is there a mode whereby I can turn on pretty printed output for my
> > xhtml?  (I'm thinking of a LiftRule, I think?).  Preferably, I'd also
> > like to control some details like indentation size.
>
> No mode for that... sorry.
>
>
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to liftweb@...
To unsubscribe from this group, send email to liftweb+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---


Parent Message unknown Re: Pretty Printed Output?

by Naftoli Gugenheim :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I would imagine it would consist of recursively iterating over xml elements, with the recursive function taking an indent level argument and passing it to iself incremented; and in each iteration returning the input with spaces added before each element in propertion to the indent level, and newlines after each element. The function can either return a modified NodeSeq or a String. It should accept a NodeSeq and pattern match on it, performing the above behavior for Elems, skipping input whitespace, and expanding Groups.

-------------------------------------
Peter Robinett<peter@...> wrote:


How hard would this be to implement? I'm a big fan of pretty HTML
output, so I'd be interested in implementing this if it's not too
hard.

Peter Robinett

On Nov 7, 7:06 am, David Pollak <feeder.of.the.be...@...> wrote:

> On Sat, Nov 7, 2009 at 1:01 AM, aw <anth...@...> wrote:
>
> > Is there a mode whereby I can turn on pretty printed output for my
> > xhtml?  (I'm thinking of a LiftRule, I think?).  Preferably, I'd also
> > like to control some details like indentation size.
>
> No mode for that... sorry.
>
>
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to liftweb@...
To unsubscribe from this group, send email to liftweb+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Pretty Printed Output?

by bearfeeder :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Mon, Nov 9, 2009 at 3:28 PM, Peter Robinett <peter@...> wrote:

How hard would this be to implement?

Does a Scala XML pretty-printer exist?

If one does, I could see adding a NodeSeq => NodeSeq function near the end of the rendering pipeline.
 
I'm a big fan of pretty HTML
output, so I'd be interested in implementing this if it's not too
hard.

Peter Robinett

On Nov 7, 7:06 am, David Pollak <feeder.of.the.be...@...> wrote:
> On Sat, Nov 7, 2009 at 1:01 AM, aw <anth...@...> wrote:
>
> > Is there a mode whereby I can turn on pretty printed output for my
> > xhtml?  (I'm thinking of a LiftRule, I think?).  Preferably, I'd also
> > like to control some details like indentation size.
>
> No mode for that... sorry.
>
>
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to liftweb@...
To unsubscribe from this group, send email to liftweb+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Pretty Printed Output?

by Marius Danciu-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


http://www.scala-lang.org/docu/files/api/scala/xml/PrettyPrinter.html

But this can be done today using:   val responseTransformers = RulesSeq
[LiftResponse => LiftResponse]

LiftRules.responseTransformers.append {
 case response => // do some LiftResponse pattern matching here for
and XhtmlResponse, take the NodeSeq and run it against the pretty
printer above.
                            // and return the new XhtmlResponse
}

Br's,
Marius

On Nov 10, 8:37 am, David Pollak <feeder.of.the.be...@...>
wrote:

> On Mon, Nov 9, 2009 at 3:28 PM, Peter Robinett <pe...@...>wrote:
>
>
>
> > How hard would this be to implement?
>
> Does a Scala XML pretty-printer exist?
>
> If one does, I could see adding a NodeSeq => NodeSeq function near the end
> of the rendering pipeline.
>
>
>
> > I'm a big fan of pretty HTML
> > output, so I'd be interested in implementing this if it's not too
> > hard.
>
> > Peter Robinett
>
> > On Nov 7, 7:06 am, David Pollak <feeder.of.the.be...@...> wrote:
> > > On Sat, Nov 7, 2009 at 1:01 AM, aw <anth...@...> wrote:
>
> > > > Is there a mode whereby I can turn on pretty printed output for my
> > > > xhtml?  (I'm thinking of a LiftRule, I think?).  Preferably, I'd also
> > > > like to control some details like indentation size.
>
> > > No mode for that... sorry.
>
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Surf the harmonics
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to liftweb@...
To unsubscribe from this group, send email to liftweb+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Pretty Printed Output?

by bearfeeder :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Mon, Nov 9, 2009 at 11:38 PM, Marius <marius.danciu@...> wrote:

http://www.scala-lang.org/docu/files/api/scala/xml/PrettyPrinter.html

But this can be done today using:   val responseTransformers = RulesSeq
[LiftResponse => LiftResponse]

LiftRules.responseTransformers.append {
 case response => // do some LiftResponse pattern matching here for
and XhtmlResponse, take the NodeSeq and run it against the pretty
printer above.
                           // and return the new XhtmlResponse
}


Thanks!

It also shows that no one person knows everything about Lift (which is a very, very good this).

I gave a Lift preso at the Bay Area Scala Enthusiasts yesterday and people kept asking me questions about Lift that I had no clue about (some of it about the JSON stuff, widgets, build-related, etc.)  I felt so good being able to say that Lift is built by a team and maintained and supported by a team.  So, thanks team!
 
Br's,
Marius

On Nov 10, 8:37 am, David Pollak <feeder.of.the.be...@...>
wrote:
> On Mon, Nov 9, 2009 at 3:28 PM, Peter Robinett <pe...@...>wrote:
>
>
>
> > How hard would this be to implement?
>
> Does a Scala XML pretty-printer exist?
>
> If one does, I could see adding a NodeSeq => NodeSeq function near the end
> of the rendering pipeline.
>
>
>
> > I'm a big fan of pretty HTML
> > output, so I'd be interested in implementing this if it's not too
> > hard.
>
> > Peter Robinett
>
> > On Nov 7, 7:06 am, David Pollak <feeder.of.the.be...@...> wrote:
> > > On Sat, Nov 7, 2009 at 1:01 AM, aw <anth...@...> wrote:
>
> > > > Is there a mode whereby I can turn on pretty printed output for my
> > > > xhtml?  (I'm thinking of a LiftRule, I think?).  Preferably, I'd also
> > > > like to control some details like indentation size.
>
> > > No mode for that... sorry.
>
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > Follow me:http://twitter.com/dpp
> > > Surf the harmonics
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to liftweb@...
To unsubscribe from this group, send email to liftweb+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---