diff --git a/.azure-pipelines/azure-pipelines.yaml b/.azure-pipelines/azure-pipelines.yaml index 282a2506..e6083481 100644 --- a/.azure-pipelines/azure-pipelines.yaml +++ b/.azure-pipelines/azure-pipelines.yaml @@ -2,12 +2,12 @@ # CI pipeline for PSDocs variables: - version: '0.8.0' + version: '0.9.0' buildConfiguration: 'Release' disable.coverage.autogenerate: 'true' imageName: 'ubuntu-18.04' - # Use build number format, i.e. 0.7.0-B2004001 + # Use build number format, i.e. 0.9.0-B2004001 name: $(version)-B$(date:yyMM)$(rev:rrr) trigger: diff --git a/CHANGELOG.md b/CHANGELOG.md index 99fe2f31..ad050545 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +What's changed since v0.8.0: + +- General improvements: + - Added support for document data and metadata in `end` convention blocks. [#148](https://github.com/BernieWhite/PSDocs/issues/148) + ## v0.8.0 What's changed since v0.7.0: diff --git a/src/PSDocs/Processor/IDocumentResult.cs b/src/PSDocs/Processor/IDocumentResult.cs index 8e70a2b4..5997bfa5 100644 --- a/src/PSDocs/Processor/IDocumentResult.cs +++ b/src/PSDocs/Processor/IDocumentResult.cs @@ -1,4 +1,7 @@  +using System.Collections; +using System.Collections.Specialized; + namespace PSDocs.Processor { internal interface IDocumentResult @@ -12,5 +15,9 @@ internal interface IDocumentResult string OutputPath { get; } string FullName { get; } + + OrderedDictionary Metadata { get; } + + Hashtable Data { get; } } } diff --git a/src/PSDocs/Processor/Markdown/MarkdownProcessor.cs b/src/PSDocs/Processor/Markdown/MarkdownProcessor.cs index 728a266f..0e7e524b 100644 --- a/src/PSDocs/Processor/Markdown/MarkdownProcessor.cs +++ b/src/PSDocs/Processor/Markdown/MarkdownProcessor.cs @@ -2,6 +2,8 @@ using PSDocs.Configuration; using PSDocs.Models; using PSDocs.Runtime; +using System.Collections; +using System.Collections.Specialized; using System.Diagnostics; using System.IO; @@ -27,6 +29,8 @@ internal DocumentResult(DocumentContext documentContext, string markdown) Culture = documentContext.Culture; OutputPath = PSDocumentOption.GetRootedPath(documentContext.OutputPath); FullName = GetFullName(); + Metadata = documentContext.Metadata; + Data = documentContext.Data; } [DebuggerStepThrough] @@ -45,6 +49,10 @@ public override string ToString() public string FullName { get; } + public OrderedDictionary Metadata { get; } + + public Hashtable Data { get; } + private string GetFullName() { var fileName = string.Concat(InstanceName, Extension); diff --git a/src/PSDocs/Runtime/PSDocs.cs b/src/PSDocs/Runtime/PSDocs.cs index 1a0cefe1..547951e6 100644 --- a/src/PSDocs/Runtime/PSDocs.cs +++ b/src/PSDocs/Runtime/PSDocs.cs @@ -1,5 +1,4 @@ -using PSDocs.Models; using System.Collections; using System.Management.Automation; using System.Threading;