Skip to content

Commit

Permalink
v2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
adamecr committed Jan 22, 2019
1 parent dbf19ce commit b0086b2
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 16 deletions.
28 changes: 25 additions & 3 deletions MarkupDoc/AddOns/SourceOnlyPackages/Model/NuProps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -21,7 +22,8 @@ namespace net.adamec.dev.markupdoc.AddOns.SourceOnlyPackages.Model
/// <item><term>&lt;NuProp.Tags&gt;&lt;/NuProp.Tags&gt;</term><description>package tags (optional)</description></item>
/// <item><term>&lt;NuProp.Includes type = "" /&gt;</term><description>file includes (optional). If type="Folder", the package will include all compile files in folder, if type="FolderRecursive" the subfolders will be also included</description></item>
/// <item><term>&lt;NuProp.Using id = "" version=""/&gt;</term><description>package imports (optional). Version is optional</description></item>
/// <item><term>&lt;NuProp.Needs id="" /&gt;</term><description>"external" imports needed (optional) - not included in package, just info when consuming!!!</description></item>
/// <item><term>&lt;NuProp.Needs id="" /&gt;</term><description>"external" imports needed (optional) - not included in package, just info when consuming!!!</description></item>
/// <item><term>&lt;NuProp.Remarks cref="" /&gt;</term><description> type to get the XML Documentation remarks from to document the source only package.</description></item>
/// </list>
/// </remarks>
public class NuProps
Expand Down Expand Up @@ -72,7 +74,7 @@ public enum IncludesTypeEnum
}

/// <summary>
/// Master flag whether the <see cref="NuProps"/> class containts the valid metadata for source-only package
/// Master flag whether the <see cref="NuProps"/> class contains the valid metadata for source-only package
/// </summary>
public bool HasNuProps { get; }
/// <summary>
Expand Down Expand Up @@ -107,10 +109,15 @@ public enum IncludesTypeEnum
public IncludesTypeEnum IncludesType { get; } = IncludesTypeEnum.None;

/// <summary>
/// List of the dependencied that are to be declared within the package
/// List of the dependencies that are to be declared within the package
/// </summary>
public IReadOnlyList<NuPropUsing> Usings { get; }

/// <summary>
/// Type to get the XML Documentation remarks from to document the source only package
/// </summary>
public string PackageRemarksSource { get; }

/// <summary>
/// List of external references (NuGet package dependencies) that are not declared in the package, but the consumer has to include
/// </summary>
Expand Down Expand Up @@ -204,6 +211,12 @@ public NuProps(string fileName, IReadOnlyCollection<string> 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<string>();
PackageFiles = packageFiles;
Expand Down Expand Up @@ -232,5 +245,14 @@ public NuProps(string fileName, IReadOnlyCollection<string> allFiles)
//It's valid source-only package definition (metadata)
HasNuProps = true;
}

/// <summary>
/// Returns the string representation of current object
/// </summary>
/// <returns><see cref="PackageId"/></returns>
public override string ToString()
{
return PackageId;
}
}
}
11 changes: 11 additions & 0 deletions MarkupDoc/AddOns/SourceOnlyPackages/SourceOnlyPackagesAddOn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion MarkupDoc/MarkupDoc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<Version>3.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Build.Locator">
<Version>1.0.31</Version>
<Version>1.1.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp">
<Version>2.10.0</Version>
Expand Down
6 changes: 3 additions & 3 deletions MarkupDoc/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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("")]

Expand All @@ -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")]
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <NuProp.Remarks cref=""> 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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit b0086b2

Please sign in to comment.