Giter Site home page Giter Site logo

Newlines in logs about puppet-summary HOT 14 CLOSED

skx avatar skx commented on September 26, 2024
Newlines in logs

from puppet-summary.

Comments (14)

matejzero avatar matejzero commented on September 26, 2024 1

Will take a look at CSS and try to create something nice:P

from puppet-summary.

skx avatar skx commented on September 26, 2024

Yes I've noticed the same thing. It's a frustrating issue because the obvious solution is just to wrap the output in a <pre> + </pre> block. But that looks bad for some cases too.

I've never quite sat down and gone through all the output but I think that it is probably worth defaulting to the wrapping, and then selectively disabling it.

from puppet-summary.

skx avatar skx commented on September 26, 2024

If you can build from source - and regenerate the bindata.go file, as documented in HACKING.md - then this change should be all that is required:

  diff --git a/data/report.template b/data/report.template
  index 83e0c2f..6626274 100644
  --- a/data/report.template
  +++ b/data/report.template
  @@ -63,7 +63,7 @@
             <div class="col-sm-1 col-md-1">
             </div>
             <div class="col-sm-11 col-md-11">
  -            {{range .LogMessages}}
  +            <pre>{{range .LogMessages}}</pre>
               <p>{{.}}</p>
               {{else}}
               <p>Nothing reported.</p>

I'll commit that as a new release this evening.

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024

Sure, I'll give it a go and report:)

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024

This looks way better. But I needed to set <pre> one line lower:

  diff --git a/data/report.template b/data/report.template
  index 83e0c2f..6626274 100644
  --- a/data/report.template
  +++ b/data/report.template
  @@ -63,7 +63,7 @@
             <div class="col-sm-1 col-md-1">
             </div>
             <div class="col-sm-11 col-md-11">
              {{range .LogMessages}}
  -            <p>{{.}}</p>
  +            <pre><p>{{.}}</p></pre>
               {{else}}
               <p>Nothing reported.</p>

We could do some CSS modification as well to lower the line-heigh inside <pre> to get rid of extra blank space under the text:P.

from puppet-summary.

skx avatar skx commented on September 26, 2024

D'oh. That's what happens when I make a quick diff without compiling/testing!

CSS change is probably reasonable too :)

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024

I see you are loading CSS from CDN. What would be the best way to do modifications? Inline CSS or extra .css file?

As far as changes go, it looks OK to me if I change:

p:
  margin: 0; (default 0 0 10px)
pre:
  padding: 5px 9px; (default 9,5px)

from puppet-summary.

skx avatar skx commented on September 26, 2024

I'd probably place it in-line to avoid having to write a handler to serve "/extra.css".

(If the change were more general I'd probably make the other decision, but since this is only a change useful for pre tags, which will only show up in the report-view I think inline is fine.)

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024

Nice.

If you don't mind, I can create a PR.

from puppet-summary.

skx avatar skx commented on September 26, 2024

Please do feel free. I'll not be home for a good few hours and if there is one waiting for me I can bundle it up with a new release quickly enough.

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024

PR created.

I've testing it and it looks OK on my side. Try it yourself too and merge if you think it's good:)

from puppet-summary.

skx avatar skx commented on September 26, 2024

The change looks good - but it doesn't show up as a PR against this repository...

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024

Sorry, I just edited the file via web and didn't look where PR landed. Fixed that.

from puppet-summary.

skx avatar skx commented on September 26, 2024

Closed in #41 - much appreciated. I'll sort out a new release shortly.

from puppet-summary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.