From b0086b232de1ad63ccc74b9b617816a6f53aaccc Mon Sep 17 00:00:00 2001 From: Radek Adamec Date: Tue, 22 Jan 2019 13:33:37 +0100 Subject: [PATCH] v2.0.3 --- .../SourceOnlyPackages/Model/NuProps.cs | 28 +++++++- .../SourceOnlyPackagesAddOn.cs | 11 +++ MarkupDoc/MarkupDoc.csproj | 2 +- MarkupDoc/Properties/AssemblyInfo.cs | 6 +- changelog.md | 7 ++ ...dOns.SourceOnlyPackages.Model__gb4dfb.html | 36 ++++++++-- ...AddOns.SourceOnlyPackages.Model__gb4dfb.md | 67 +++++++++++++++++-- 7 files changed, 141 insertions(+), 16 deletions(-) diff --git a/MarkupDoc/AddOns/SourceOnlyPackages/Model/NuProps.cs b/MarkupDoc/AddOns/SourceOnlyPackages/Model/NuProps.cs index 306b4ab..0d20325 100644 --- a/MarkupDoc/AddOns/SourceOnlyPackages/Model/NuProps.cs +++ b/MarkupDoc/AddOns/SourceOnlyPackages/Model/NuProps.cs @@ -5,6 +5,7 @@ using System.Text; using System.Xml.Linq; using net.adamec.dev.markupdoc.Utils; +using net.adamec.dev.markupdoc.XmlDocumentation; namespace net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model { @@ -21,7 +22,8 @@ namespace net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model /// <NuProp.Tags></NuProp.Tags>package tags (optional) /// <NuProp.Includes type = "" />file includes (optional). If type="Folder", the package will include all compile files in folder, if type="FolderRecursive" the subfolders will be also included /// <NuProp.Using id = "" version=""/>package imports (optional). Version is optional - /// <NuProp.Needs id="" />"external" imports needed (optional) - not included in package, just info when consuming!!! + /// <NuProp.Needs id="" />"external" imports needed (optional) - not included in package, just info when consuming!!! + /// <NuProp.Remarks cref="" /> type to get the XML Documentation remarks from to document the source only package. /// /// public class NuProps @@ -72,7 +74,7 @@ public enum IncludesTypeEnum } /// - /// Master flag whether the class containts the valid metadata for source-only package + /// Master flag whether the class contains the valid metadata for source-only package /// public bool HasNuProps { get; } /// @@ -107,10 +109,15 @@ public enum IncludesTypeEnum public IncludesTypeEnum IncludesType { get; } = IncludesTypeEnum.None; /// - /// List of the dependencied that are to be declared within the package + /// List of the dependencies that are to be declared within the package /// public IReadOnlyList Usings { get; } + /// + /// Type to get the XML Documentation remarks from to document the source only package + /// + public string PackageRemarksSource { get; } + /// /// List of external references (NuGet package dependencies) that are not declared in the package, but the consumer has to include /// @@ -204,6 +211,12 @@ public NuProps(string fileName, IReadOnlyCollection allFiles) } } + PackageRemarksSource = nuPropElements + .FirstOrDefault(e => e.Name.LocalName == "NuProp.Remarks" && e.Attribute("cref")?.Value != null)? + .Attribute("cref")? + .Value; + + //Get all package files (processing the includes when applicable) var packageFiles = new List(); PackageFiles = packageFiles; @@ -232,5 +245,14 @@ public NuProps(string fileName, IReadOnlyCollection allFiles) //It's valid source-only package definition (metadata) HasNuProps = true; } + + /// + /// Returns the string representation of current object + /// + /// + public override string ToString() + { + return PackageId; + } } } diff --git a/MarkupDoc/AddOns/SourceOnlyPackages/SourceOnlyPackagesAddOn.cs b/MarkupDoc/AddOns/SourceOnlyPackages/SourceOnlyPackagesAddOn.cs index 8007550..4d11bb5 100644 --- a/MarkupDoc/AddOns/SourceOnlyPackages/SourceOnlyPackagesAddOn.cs +++ b/MarkupDoc/AddOns/SourceOnlyPackages/SourceOnlyPackagesAddOn.cs @@ -197,6 +197,17 @@ await markup.WriteParaAsync(new Txt() nuProps.ExternalReferences))); } + if (nuProps.PackageRemarksSource != null && + root.AllMembersByDocId.TryGetValue(nuProps.PackageRemarksSource, out var member)) + { + var remarksDocumentation = member.Documentation?.GetRemarks(member)?.Render(markup, member); + if (!string.IsNullOrEmpty(remarksDocumentation)) + { + await markup.WriteH3Async("Remarks"); + await markup.WriteParaAsync(remarksDocumentation); + } + } + if (MembersBySourceOnlyPackage.TryGetValue(nuProps, out var members) && members.Count > 0) { await markup.WriteParaAsync(new Txt() diff --git a/MarkupDoc/MarkupDoc.csproj b/MarkupDoc/MarkupDoc.csproj index 4e77b12..f959ab1 100644 --- a/MarkupDoc/MarkupDoc.csproj +++ b/MarkupDoc/MarkupDoc.csproj @@ -142,7 +142,7 @@ 3.2.0 - 1.0.31 + 1.1.2 2.10.0 diff --git a/MarkupDoc/Properties/AssemblyInfo.cs b/MarkupDoc/Properties/AssemblyInfo.cs index 27456ce..420d2f5 100644 --- a/MarkupDoc/Properties/AssemblyInfo.cs +++ b/MarkupDoc/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Radek Adamec")] [assembly: AssemblyProduct("MarkupDoc")] -[assembly: AssemblyCopyright("Copyright © Radek Adamec 2018")] +[assembly: AssemblyCopyright("Copyright © Radek Adamec 2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.2.0")] -[assembly: AssemblyFileVersion("2.0.2.0")] +[assembly: AssemblyVersion("2.0.3.0")] +[assembly: AssemblyFileVersion("2.0.3.0")] diff --git a/changelog.md b/changelog.md index 34f7f99..48bc397 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [2.0.3] - 2019-01-22 ## +### Added ### +- Added support for documentation comment (reference to type to get the XML Documentation remarks from to document the source only package). +### Changed ### +- Updated Microsoft.Build.Locator package version + ## [2.0.2] - 2018-12-30 ## ### Fixed ### - Relative paths to source files from source-only packages corrected in output @@ -44,6 +50,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added ### - Initial release +[2.0.3]: https://github.com/adamecr/MarkupDoc/compare/v2.0.2...v2.0.3 [2.0.2]: https://github.com/adamecr/MarkupDoc/compare/v2.0.1...v2.0.2 [2.0.1]: https://github.com/adamecr/MarkupDoc/compare/v2.0.0...v2.0.1 [2.0.0]: https://github.com/adamecr/MarkupDoc/compare/v1.0.0...v2.0.0 diff --git a/doc/net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.html b/doc/net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.html index 54ff366..9c4769e 100644 --- a/doc/net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.html +++ b/doc/net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.html @@ -60,21 +60,22 @@

DeclaringFilepublicFull path to the file declaring the source-only package (containing the package metadata as <NuProp.xxxx/> XML documentation comments ExternalReferencespublicList of external references (NuGet package dependencies) that are not declared in the package, but the consumer has to include -HasNuPropspublicMaster flag whether the NuProps class containts the valid metadata for source-only package +HasNuPropspublicMaster flag whether the NuProps class contains the valid metadata for source-only package IncludesTypepublicDefinition of the additional files to include into the source-only package PackageDescriptionpublicOptional description of the package PackageFilespublicList of all files to be included into the source-only package PackageIdpublicUnique ID of the package +PackageRemarksSourcepublicType to get the XML Documentation remarks from to document the source only package PackageTagspublicOptional package tags divided by space PackageVersionpublicOptional version of the package. -UsingspublicList of the dependencied that are to be declared within the package +UsingspublicList of the dependencies that are to be declared within the package

Constructors

@@ -82,6 +83,11 @@

Constructors

NuProps(string, IReadOnlyCollection<string>)publicCTOR - Checks the compilation file with given fileName for the source-only package metadata. When the metadata are present and valid, the NuProps object is initialized and HasNuProps property is set to true

+

Methods

+ + +
NameModifierSummary
ToString()publicReturns the string representation of current object
+

Go to namespaces or types

NuProps.DeclaringFile Property

@@ -109,7 +115,7 @@

NuProps
Sources: AddOns\SourceOnlyPackages\Model\NuProps.cs

-

Master flag whether the NuProps class containts the valid metadata for source-only package

+

Master flag whether the NuProps class contains the valid metadata for source-only package

public bool HasNuProps { get; }

Property value

bool

Go to namespaces or types

@@ -156,6 +162,16 @@

string

Go to namespaces or types

+

NuProps.PackageRemarksSource Property

+

Namespace: net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model
+Assembly: MarkupDoc
+Type: NuProps
+Sources: AddOns\SourceOnlyPackages\Model\NuProps.cs

+

Type to get the XML Documentation remarks from to document the source only package

+
public string PackageRemarksSource { get; }
+

Property value

string

+

Go to namespaces or types

+

NuProps.PackageTags Property

Namespace: net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model
Assembly: MarkupDoc
@@ -183,7 +199,7 @@

NuProps
Sources: AddOns\SourceOnlyPackages\Model\NuProps.cs

-

List of the dependencied that are to be declared within the package

+

List of the dependencies that are to be declared within the package

public IReadOnlyList<net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model.NuProps.NuPropUsing> Usings { get; }

Property value

IReadOnlyList<net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model.NuProps.NuPropUsing>

Go to namespaces or types

@@ -198,6 +214,16 @@

string fileName
Full path to the compliation file
IReadOnlyCollection<string> allFiles
List of all files in compilation, used to resolve the includes (Folder, FolderRecursive) when needed

Go to namespaces or types

+

NuProps.ToString() Method

+

Namespace: net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model
+Assembly: MarkupDoc
+Type: NuProps
+Sources: AddOns\SourceOnlyPackages\Model\NuProps.cs

+

Returns the string representation of current object

+
public override string ToString()
+

Return value

string
PackageId
Overrides: object.ToString

+

Go to namespaces or types

+

NuProps.NuPropUsing Class

Namespace: net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model
Assembly: MarkupDoc
diff --git a/doc/net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md b/doc/net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md index 85f3cca..bd490cb 100644 --- a/doc/net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md +++ b/doc/net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md @@ -54,6 +54,7 @@ Source-only NuGet packages contain just the source code that is added to the pro - <NuProp.Includes type = "" /> - file includes (optional). If type="Folder", the package will include all compile files in folder, if type="FolderRecursive" the subfolders will be also included - <NuProp.Using id = "" version=""/> - package imports (optional). Version is optional - <NuProp.Needs id="" /> - "external" imports needed (optional) - not included in package, just info when consuming!!! + - <NuProp.Remarks cref="" /> - type to get the XML Documentation remarks from to document the source only package. @@ -66,14 +67,15 @@ Source-only NuGet packages contain just the source code that is added to the pro | ------ | ---------- | --------- | | [DeclaringFile](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.declaringfile__11s348v) | public | Full path to the file declaring the source-only package (containing the package metadata as <NuProp.xxxx/> XML documentation comments | | [ExternalReferences](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.externalreferences__1cpn3h1) | public | List of external references (NuGet package dependencies) that are not declared in the package, but the consumer has to include | - | [HasNuProps](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.hasnuprops__17gaag3) | public | Master flag whether the [NuProps](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#t-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops__4yj5ni) class containts the valid metadata for source-only package | + | [HasNuProps](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.hasnuprops__17gaag3) | public | Master flag whether the [NuProps](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#t-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops__4yj5ni) class contains the valid metadata for source-only package | | [IncludesType](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.includestype__zb9t6r) | public | Definition of the additional files to include into the source-only package | | [PackageDescription](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.packagedescription__o0pb0m) | public | Optional description of the package | | [PackageFiles](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.packagefiles__deuupz) | public | List of all files to be included into the source-only package | | [PackageId](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.packageid__4tnxdb) | public | Unique ID of the package | + | [PackageRemarksSource](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.packageremarkssource__1irywj4) | public | Type to get the XML Documentation remarks from to document the source only package | | [PackageTags](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.packagetags__ioqk03) | public | Optional package tags divided by space | | [PackageVersion](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.packageversion__fcxdho) | public | Optional version of the package. | - | [Usings](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.usings__f9kpil) | public | List of the dependencied that are to be declared within the package | + | [Usings](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.usings__f9kpil) | public | List of the dependencies that are to be declared within the package | @@ -87,6 +89,15 @@ Source-only NuGet packages contain just the source code that is added to the pro +### Methods ### + + | Name | Modifier | Summary | + | ------ | ---------- | --------- | + | [ToString()](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#m-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.tostring__1gffuz7) | public | Returns the string representation of current object | + + + + Go to [namespaces](MarkupDoc.md#namespace-list) or [types](MarkupDoc.md#type-list) @@ -148,7 +159,7 @@ Type: [NuProps](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb Sources: AddOns\SourceOnlyPackages\Model\NuProps.cs
-Master flag whether the [NuProps](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#t-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops__4yj5ni) class containts the valid metadata for source-only package +Master flag whether the [NuProps](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#t-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops__4yj5ni) class contains the valid metadata for source-only package @@ -265,6 +276,30 @@ Go to [namespaces](MarkupDoc.md#namespace-list) or [types](MarkupDoc.md#type-lis +## NuProps.PackageRemarksSource Property ## +Namespace: [net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#n-net.adamec.dev.markupdoc.addons.sourceonlypackages.model__gb4dfb) +Assembly: MarkupDoc +Type: [NuProps](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#t-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops__4yj5ni) +Sources: AddOns\SourceOnlyPackages\Model\NuProps.cs + + +Type to get the XML Documentation remarks from to document the source only package + + + +```csharp +public string PackageRemarksSource { get; } +``` + +Property value

string
+ + +Go to [namespaces](MarkupDoc.md#namespace-list) or [types](MarkupDoc.md#type-list) + + + + + ## NuProps.PackageTags Property ## Namespace: [net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#n-net.adamec.dev.markupdoc.addons.sourceonlypackages.model__gb4dfb) Assembly: MarkupDoc @@ -324,7 +359,7 @@ Type: [NuProps](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb Sources: AddOns\SourceOnlyPackages\Model\NuProps.cs -List of the dependencied that are to be declared within the package +List of the dependencies that are to be declared within the package @@ -363,6 +398,30 @@ Go to [namespaces](MarkupDoc.md#namespace-list) or [types](MarkupDoc.md#type-lis +## NuProps.ToString() Method ## +Namespace: [net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#n-net.adamec.dev.markupdoc.addons.sourceonlypackages.model__gb4dfb) +Assembly: MarkupDoc +Type: [NuProps](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#t-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops__4yj5ni) +Sources: AddOns\SourceOnlyPackages\Model\NuProps.cs + + +Returns the string representation of current object + + + +```csharp +public override string ToString() +``` + +Return value
string
[PackageId](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#p-net.adamec.dev.markupdoc.addons.sourceonlypackages.model.nuprops.packageid__4tnxdb)
Overrides: object.ToString + + +Go to [namespaces](MarkupDoc.md#namespace-list) or [types](MarkupDoc.md#type-list) + + + + + ## NuProps.NuPropUsing Class ## Namespace: [net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model](net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model__gb4dfb.md#n-net.adamec.dev.markupdoc.addons.sourceonlypackages.model__gb4dfb) Assembly: MarkupDoc