Condividi tramite


Set-MarkdownOption

Sets the colors and styles used for rendering Markdown content in the console.

Sintassi

IndividualSetting (impostazione predefinita).

Set-MarkdownOption
    [-Header1Color <String>]
    [-Header2Color <String>]
    [-Header3Color <String>]
    [-Header4Color <String>]
    [-Header5Color <String>]
    [-Header6Color <String>]
    [-Code <String>]
    [-ImageAltTextForegroundColor <String>]
    [-LinkForegroundColor <String>]
    [-ItalicsForegroundColor <String>]
    [-BoldForegroundColor <String>]
    [-PassThru]
    [<CommonParameters>]

Theme

Set-MarkdownOption
    -Theme <String>
    [-PassThru]
    [<CommonParameters>]

InputObject

Set-MarkdownOption
    [-InputObject] <PSObject>
    [-PassThru]
    [<CommonParameters>]

Descrizione

Sets the colors and styles used for rendering Markdown content in the console. These styles are defined using ANSI escape codes that change the color and style of the Markdown text being rendered.

For more information about Markdown, see the CommonMark website.

Note

The string values used in the settings are the characters that follow the Escape character ([char]0x1B) for the ANSI escape sequence. Do not include the Escape character in the string. For more information about ANSI escape codes work, see ANSI_escape_code.

Esempio

Example 1 - Switch to the Light Theme

This example selects the Light theme and displays the new configuration using the PassThru parameter.

Set-MarkdownOption -Theme Light -PassThru
Header1         : [7m
Header2         : [4;33m
Header3         : [4;34m
Header4         : [4;35m
Header5         : [4;36m
Header6         : [4;30m
Code            : [48;2;155;155;155;38;2;30;30;30m
Link            : [4;38;5;117m
Image           : [33m
EmphasisBold    : [1m
EmphasisItalics : [36m

Example 2 - Customize the color and style settings

This example changes the escape code for the Markdown headers. The default configuration for headers renders them as underlined text of various colors. This change removes the underline style.

$mdOptions = Get-MarkdownOption
$mdOptions.Header2 = '[93m'
$mdOptions.Header3 = '[94m'
$mdOptions.Header4 = '[95m'
$mdOptions.Header5 = '[96m'
$mdOptions.Header6 = '[97m'
Set-MarkdownOption -InputObject $mdOptions -PassThru
Header1         : [7m
Header2         : [93m
Header3         : [94m
Header4         : [95m
Header5         : [96m
Header6         : [97m
Code            : [48;2;155;155;155;38;2;30;30;31m
Link            : [4;38;5;117m
Image           : [33m
EmphasisBold    : [1m
EmphasisItalics : [36m

Parametri

-BoldForegroundColor

Sets the foreground color for rendering bold Markdown text.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

IndividualSetting
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-Code

Sets the color for rendering code blocks and spans in Markdown text.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

IndividualSetting
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-Header1Color

Sets the color for rendering Header1 blocks in Markdown text.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

IndividualSetting
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-Header2Color

Sets the color for rendering Header2 blocks in Markdown text.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

IndividualSetting
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-Header3Color

Sets the color for rendering Header3 blocks in Markdown text.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

IndividualSetting
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-Header4Color

Sets the color for rendering Header4 blocks in Markdown text.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

IndividualSetting
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-Header5Color

Sets the color for rendering Header5 blocks in Markdown text.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

IndividualSetting
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-Header6Color

Sets the color for rendering Header6 blocks in Markdown text.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

IndividualSetting
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-ImageAltTextForegroundColor

Sets the foreground color for rendering the alternate text of an image element in Markdown text.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

IndividualSetting
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-InputObject

A PSMarkdownOptionInfo object containing the configuration to be set.

Proprietà dei parametri

Tipo:PSObject
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

InputObject
Posizione:0
Obbligatorio:True
Valore dalla pipeline:True
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-ItalicsForegroundColor

Sets the foreground color for rendering the italics in Markdown text.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

IndividualSetting
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-LinkForegroundColor

Sets the foreground color for rendering hyperlinks in Markdown text.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

IndividualSetting
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-PassThru

Causes the cmdlet to output a PSMarkdownOptionInfo object containing the new configuration.

Proprietà dei parametri

Tipo:SwitchParameter
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

(All)
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-Theme

Selects a theme containing predefined color settings. The possible values are Dark and Light.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Valori accettati:Dark, Light
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

Theme
Posizione:Named
Obbligatorio:True
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Input

PSObject

Output

Microsoft.PowerShell.MarkdownRender.PSMarkdownOptionInfo

Note

The string values used to define the color and style must match the regular expression ^\[*[0-9;]*?m{1}.