Skip to content

Commit 9a8f4b6

Browse files
author
James Brundage
committed
docs: MarkX Types Documentation
1 parent 9194bae commit 9a8f4b6

7 files changed

Lines changed: 61 additions & 0 deletions

File tree

‎Types/MarkX/MarkX.format.ps1‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
<#
2+
.SYNOPSIS
3+
MarkX Formatting
4+
.DESCRIPTION
5+
MarkX formatting source
6+
#>
17
Write-FormatView -TypeName MarkX -Property Markdown -Wrap

‎Types/MarkX/get_Images.ps1‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
<#
2+
.SYNOPSIS
3+
Gets Markdown Images
4+
.DESCRIPTION
5+
Gets `<img>` tags found within Markdown after it has been converted to XML
6+
.NOTES
7+
If the Markdown could not be converted to XML, this will return nothing.
8+
#>
19
foreach ($aNode in $this.XML | Select-Xml //img) {
210
if ($aNode.Node.src) {
311
$aNode.Node

‎Types/MarkX/get_Input.ps1‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
<#
2+
.SYNOPSIS
3+
Gets MarkX input
4+
.DESCRIPTION
5+
Gets the input objects for a MarkX object.
6+
#>
17
return $this.'#input'

‎Types/MarkX/get_Link.ps1‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
<#
2+
.SYNOPSIS
3+
Gets Markdown Links
4+
.DESCRIPTION
5+
Gets anchor links from within Markdown content.
6+
.NOTES
7+
This will return the links nodes after the Markdown is converted to XML.
8+
9+
If XML conversion fails, this will not return any values.
10+
11+
To find hyperlinks within Markdown, use `.FindHyperlink()`
12+
#>
113
foreach ($aNode in $this.XML | Select-Xml //a) {
214
if ($aNode.Node.href) {
315
$aNode.Node

‎Types/MarkX/get_Markdown.ps1‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1+
<#
2+
.SYNOPSIS
3+
Gets Markdown
4+
.DESCRIPTION
5+
Gets the cached Markdown value for any MarkX object.
6+
7+
This should be a markdown representation of the object.
8+
#>
19
return $this.'#Markdown'

‎Types/MarkX/set_Input.ps1‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
<#
2+
.SYNOPSIS
3+
Sets MarkX Input
4+
.DESCRIPTION
5+
Sets the input for a MarkX file or site.
6+
7+
This will attempt to convert the input to Markdown,
8+
and then will `.Sync()` the object.
9+
#>
110
param(
11+
# One or more input objects
212
[PSObject[]]$InputObject
313
)
414

15+
# Set the `#Input` property
516
$this | Add-Member NoteProperty '#Input' $InputObject -Force
617

18+
# and then Sync.
719
$this.Sync()

‎Types/MarkX/set_Markdown.ps1‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1+
<#
2+
.SYNOPSIS
3+
Sets Markdown
4+
.DESCRIPTION
5+
Sets the Markdown on an object.
6+
.NOTES
7+
This will change the `.Input` property, which will then `.Sync()` the markdown.
8+
#>
19
param(
10+
# Any new or updated markdown content.
211
[PSObject[]]$Markdown
312
)
413

0 commit comments

Comments
 (0)