Badgerati / Pode.Web

Web template framework for use with the Pode PowerShell web server
MIT License
189 stars 24 forks source link

Simple line break #579

Open nixtar opened 3 months ago

nixtar commented 3 months ago

I feel like I must be missing something super simple.

I'm trying to just output 2 lines in a table column...

I started by trying to just output what I want to a card and this is where I ran into issues.

I just want something like this:

Hello Line2

With no added spacing etc between the lines, just a simple <br>.

First I tried adding a line break to a PodeWebText such as HellornLine2 but it was removed from the output.

Then I looked for some kind of line break element and the closest I found was PodeWebLine but that adds an actual line with spacing etc.

Putting 2 paragraphs works but there are margins between them. With that in mind the following works but feels like a lot for something so simple:

New-PodeWebCard -Name 'Welcome' -Content @(
    New-PodeWebParagraph -Value "Hello" | Add-PodeWebStyle -Key "margin-bottom" -Value "0" | Add-PodeWebStyle -Key "color" -Value "green"
    New-PodeWebParagraph -Value "Line2"
)

image

Badgerati commented 3 months ago

It's actually something I've had noted down for a while, to convert new-lines into <br/> for Text/Paragraph elements. I'll get it added.

If you want the first value to be a different colour to the second however, then your use of paragraphs and styling would be the only way.

nixtar commented 3 months ago

That would be perfect for our use case. ❤️

Yeah the use of colours there was mostly just me leaning into the styling.