sarafian / markdownps Goto Github PK
View Code? Open in Web Editor NEWA powershell module to render markdown files
License: MIT License
A powershell module to render markdown files
License: MIT License
This is how it currently works
New-MDQuote -Lines @("Line 1","Line 2")
> Line 1
>
> Line 2
Why the blank line between Line1 and Line2.
I checked the syntax guide here which doesn't have multiline example.
This is another doc link with multi line and nested quotes. They don't required empty "> " line between lines either.
Test files should not be published with the module. This is a bug in Sarafian/PowerShellTemplate#8
It has been suggested to move the render of the Demo.ps1
to an independent file.
Also the new github alerts implemented in GH-28 will not render correctly as part of the quote currently in the readme file.
Add markdown syntax to add github alerts like this
Note
Useful information that users should know, even when skimming content.
Github docs link
I can work on this and do pull request if you are still accepting pull requests.
Hey, would a security bug that I dont want to disclose on public forum. How do I reach you/update you.
Also update appveyor secure key
PowerShell Gallery key is expired and module won't publish.
From GH-27 the description is there and the solution as well. But the repository has moved forward and @aaronparker hasn't responded. So continue here and include his changes.
Hello!
We use this great PowerShell module to auto-generate markdown file and commit it to the repository.
But we have faced with issue that column size depend on content of the column. So if the length of one line was changes, all other lines will be realigned too and it will cause noise for the whole table. So table diff will be overcrowded
It would be great to have a parameter like columnsSizes
- array of int, where we can hardcode width of columns and they will be used for table
I can contribute with this changes, just want to make sure that this request sounds good to you.
From GH-33 and as part of the implementation from GH-28 the multiline quote is now broken
It was
> Line1
>
> Line2
and became
> Line1
> Line2
But this is rendered as one line and apparently there must be 2 empty spaces trailing Line1
for it to show correctly.
Line1
Line2
But this is not human readable hence the prefered solution is to add empty lines though the rendering is a bit different
Line1
Line2
Since the New-MDAlert
uses the New-MDQuote
and the same logic applies, this will fix both. Tests need to be fixed as well.
Don't forget the Showcase and the changelog
Also mention the reason for this in the code based on the following links
Links
Hello,
When I install MarkdownPS 1.5
module and try to import it, I get the following error:
Import-Module : The specified wildcard character pattern is not valid: @{HelpUri=; ScriptBlock=
[CmdletBinding()]
[OutputType([string])]
Param (
...
It looks like all functions work as expected after this error but it produces a lot of noise in our logs.
Version 1.4
works correctly so it looks like issue comes from psd1
file that was changed between 1.4 and 1.5 versions (MarkdownPS.psd1 contains a huge inline export in field FunctionsToExport
in version 1.5)
Thank you for implementation and supporting this great PowerShell module, hope this issue will be resolved.
VERBOSE: Loading module from path '/Users/***/.local/share/powershell/Modules/MarkdownPS/1.5/MarkdownPS.psd1'.
VERBOSE: Populating RepositorySourceLocation property for module MarkdownPS.
VERBOSE: Loading module from path '/Users/***/.local/share/powershell/Modules/MarkdownPS/1.5/MarkdownPS.psm1'.
Import-Module : The specified wildcard character pattern is not valid: @{HelpUri=; ScriptBlock=
[CmdletBinding()]
[OutputType([string])]
Param (
[Parameter(
Mandatory = $false,
Position = 0,
ValueFromPipeline = $true,
ParameterSetName="Source"
)]
[ValidateNotNullOrEmpty()]
[string]$Source,
[Parameter(
Mandatory = $false
)]
[ValidateNotNullOrEmpty()]
[string]$Title=$null,
[Parameter(
Mandatory = $false
)]
[string]$AltText=$null,
[Parameter(
Mandatory = $false,
ParameterSetName="Shields.io"
)]
[string]$Subject=$null,
[Parameter(
Mandatory = $false,
ParameterSetName="Shields.io"
)]
[string]$Status=$null,
[Parameter(
Mandatory = $false,
ParameterSetName="Shields.io"
)]
[ValidateSet("brightgreen","green","yellowgreen","yellow","orange","red","lightgrey","blue")]
[string]$Color=$null,
[Parameter(
Mandatory = $false,
ParameterSetName="Shields.io"
)]
[ValidateSet("plastic","flat","flat-square","social")]
[string]$Style=$null,
[Parameter(
Mandatory = $false
)]
[string]$Link=$null
)
Begin {
$output=""
}
Process {
if(-not $Source -and $Color)
{
$Subject=$Subject.Replace("-","--").Replace("_","__")
$Subject=[System.Uri]::EscapeDataString($Subject)
$Status=$Status.Replace("-","--").Replace("_","__")
$Status=[System.Uri]::EscapeDataString($Status)
#When running from powershell [System.Uri]::EscapeDataString is not escaping ()
if(-not $ise)
{
$Subject=$Subject.Replace("(","%28").Replace(")","%29")
$Status=$Status.Replace("(","%28").Replace(")","%29")
}
$shieldIo="$Subject-$Status-$Color"
$Source="https://img.shields.io/badge/$shieldIo.svg"
if($Style)
{
$Source+="?style=$Style"
}
}
$output+="![$AltText]($Source"
if($Title)
{
$output+=" ""$Title"""
}
$output+=")"
if($Link)
{
$output=New-MDLink -Text $output -Link $Link
}
}
End {
$output
}
; CmdletBinding=True; DefaultParameterSet=; Definition=
[CmdletBinding()]
[OutputType([string])]
Param (
[Parameter(
Mandatory = $false,
Position = 0,
ValueFromPipeline = $true,
ParameterSetName="Source"
)]
[ValidateNotNullOrEmpty()]
[string]$Source,
[Parameter(
Mandatory = $false
)]
[ValidateNotNullOrEmpty()]
[string]$Title=$null,
[Parameter(
Mandatory = $false
)]
[string]$AltText=$null,
[Parameter(
Mandatory = $false,
ParameterSetName="Shields.io"
)]
[string]$Subject=$null,
[Parameter(
Mandatory = $false,
ParameterSetName="Shields.io"
)]
[string]$Status=$null,
[Parameter(
Mandatory = $false,
ParameterSetName="Shields.io"
)]
[ValidateSet("brightgreen","green","yellowgreen","yellow","orange","red","lightgrey","blue")]
[string]$Color=$null,
[Parameter(
Mandatory = $false,
ParameterSetName="Shields.io"
)]
[ValidateSet("plastic","flat","flat-square","social")]
[string]$Style=$null,
[Parameter(
Mandatory = $false
)]
[string]$Link=$null
)
Begin {
$output=""
}
Process {
if(-not $Source -and $Color)
{
$Subject=$Subject.Replace("-","--").Replace("_","__")
$Subject=[System.Uri]::EscapeDataString($Subject)
$Status=$Status.Replace("-","--").Replace("_","__")
$Status=[System.Uri]::EscapeDataString($Status)
#When running from powershell [System.Uri]::EscapeDataString is not escaping ()
if(-not $ise)
{
$Subject=$Subject.Replace("(","%28").Replace(")","%29")
$Status=$Status.Replace("(","%28").Replace(")","%29")
}
$shieldIo="$Subject-$Status-$Color"
$Source="https://img.shields.io/badge/$shieldIo.svg"
if($Style)
{
$Source+="?style=$Style"
}
}
$output+="![$AltText]($Source"
if($Title)
{
$output+=" ""$Title"""
}
$output+=")"
if($Link)
{
$output=New-MDLink -Text $output -Link $Link
}
}
End {
$output
}
; Options=None; Description=; Verb=New; Noun=MDImage; HelpFile=; OutputType=System.Collections.ObjectModel.ReadOnlyCollection`1[System.Management.Automation.PSTypeName]; CommandType=Function; Source=MarkDownPS; Version=1.4; Visibility=Public; ModuleName=MarkDownPS; Module=MarkDownPS; RemotingCapability=PowerShell; Parameters=System.Collections.Generic.Dictionary`2[System.String,System.Management.Automation.ParameterMetadata]; ParameterSets=System.Collections.ObjectModel.ReadOnlyCollection`1[System.Management.Automation.CommandParameterSetInfo]}
At line:1 char:1
+ Import-Module MarkdownPS -RequiredVersion 1.5 -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Module], WildcardPatternException
+ FullyQualifiedErrorId : RuntimeException,Microsoft.PowerShell.Commands.ImportModuleCommand
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.