Read in .md file to udcard?

Latest PSU.

Is it possible to have a UDCard that reads in the content from .md file?
Can’t get it to work, it would bee great if it was possible.

Goto the marketplace and look for UniversalDashboard.Markdown. It will allow you to render the text from .md files. I have a releasenotes.md for my dashboard that renders on the homepage.

Thanks, but that’s not what I’m after or well not everything I’ll just write it by my self :slight_smile:

Are you trying to render the markdown to HTML?

For now it’s just a textfile that I have just written two or three lines/rows in but when I’m using this script it just write everything out at the same line/row why don’t
work? Can’t understand that.

New-UDGrid -Spacing '1' -Container -Content {
    $RootChildFiles = Get-ChildItem -Path $RootPathNews | select-object -ExpandProperty name
    foreach ($ChildFile in $RootChildFiles) {
        $FileCollect = Get-ChildItem "$($RootPathNews)\$($ChildFile)" | Measure-Object
        $FileCollect.count
        if ($FileCollect.count -eq 0) {

        }
        else {
            $ContentFile = Get-Content "$($RootPathNews)\$($ChildFile)"
            New-UDGrid -Item -MediumSize 4 -Content {
                New-UDCard -Title "$ChildFile" -Content {
                    New-UDDynamic -Id "$ChildFile" -content {
                        foreach ($line in $ContentFile) {
                            New-UDHTML -Markup "$($line)"
                            New-UDHTML -Markup '<br>t'
                        }
                    } -LoadingComponent {
                        New-UDProgress -Circular
                    }  
                }
            }
        }
    }

I did also try this, but it’s the same issue.

New-UDGrid -Spacing '1' -Container -Content {
    $RootChildFiles = Get-ChildItem -Path $RootPathNews | select-object -ExpandProperty name
    foreach ($ChildFile in $RootChildFiles) {
        $FileCollect = Get-ChildItem "$($RootPathNews)\$($ChildFile)" | Measure-Object
        $FileCollect.count
        if ($FileCollect.count -eq 0) {

        }
        else {
            $ContentFile = Get-Content "$($RootPathNews)\$($ChildFile)"
            New-UDGrid -Item -MediumSize 4 -Content {
                New-UDCard -Title "$ChildFile" -Content {
                    New-UDDynamic -Id "$ChildFile" -content {
                        foreach ($line in $ContentFile) {
                            New-UDHTML -Markup "$($line)<br>"
                        }
                    } -LoadingComponent {
                        New-UDProgress -Circular
                    }  
                }
            }
        }
    }
}

And I tried this;

New-UDGrid -Spacing '1' -Container -Content {
    $RootChildFiles = Get-ChildItem -Path $RootPathNews | select-object -ExpandProperty name
    foreach ($ChildFile in $RootChildFiles) {
        $FileCollect = Get-ChildItem "$($RootPathNews)\$($ChildFile)" | Measure-Object
        $FileCollect.count
        if ($FileCollect.count -eq 0) {

        }
        else {
            $ContentFile = Get-Content "$($RootPathNews)\$($ChildFile)"
            New-UDGrid -Item -MediumSize 4 -Content {
                New-UDCard -Title "$ChildFile" -Content {
                    New-UDDynamic -Id "$ChildFile" -content {
                        [System.IO.File]::ReadLines("$($RootPathNews)\$($ChildFile)") | ForEach-Object {
                            New-UDHTML -Markup "$($_)"
                        }
                    } -LoadingComponent {
                        New-UDProgress -Circular
                    }  
                }
            }
        }
    }
}

Try overriding the styles using New-UDStyle. I have an example here: New lines ignored in New-UDCard - #5 by adam