@@ -13,13 +13,53 @@ $markXProtoType = [PSCustomObject]@{PSTypeName='MarkX'}
1313
1414$allMarkdown = @ (:nextInput foreach ($md in $this.Input ) {
1515 if ($md -isnot [string ]) {
16+ if ($md -is [PSModuleInfo ]) {
17+ # Since we have already decorated this type,
18+ # we need to get the underlying module path with reflection
19+ $modulePath = $md.GetType ().GetProperty(" Path" ).GetValue($md )
20+ if (-not $this.Header ) {
21+ $this.Header = [Ordered ]@ {
22+ title = $md.name
23+ description = $md.description
24+ author = $md.author
25+ copyright = $md.copyright
26+ companyName = $md.companyName
27+ version = $md.version
28+ guid = $md.guid
29+ licenseUri = $md.licenseUri
30+ releaseNotes = $md.releaseNotes
31+ projectUri = $md.projectUri
32+ privateData = $md.privateData
33+ }
34+ }
35+
36+ @ (
37+ " # $ ( $md.name ) @ $ ( $md.version ) "
38+ [Environment ]::newline
39+ " ## $ ( $md.description ) "
40+
41+ if ($md.privateData.PSData.PSIntro ) {
42+ [Environment ]::newline
43+ $md.PrivateData.PSData.PSIntro
44+ }
45+ elseif ($md.privateData.PSIntro ) {
46+ [Environment ]::newline
47+ $md.PrivateData.PSIntro
48+ }
49+
50+ )
51+
52+ $md = ($modulePath | Split-Path ) -as [IO.DirectoryInfo ]
53+ }
54+
1655 if ($md -is [IO.DirectoryInfo ]) {
1756 $this |
1857 Add-Member NoteProperty ' #Path' $md.Fullname - Force
1958 $this.Site = " $ ( $md.FullName ) "
2059 $this.Site.includes = $this.Include
2160 continue nextInput
2261 }
62+
2363 # If the markdown was a file
2464 if ($md -is [IO.FileInfo ] -and
2565 # and it had a markdown extension
0 commit comments