diff --git a/docs/reference/docfx-json-reference.md b/docs/reference/docfx-json-reference.md index f895710be1c..294250d9b9b 100644 --- a/docs/reference/docfx-json-reference.md +++ b/docs/reference/docfx-json-reference.md @@ -297,11 +297,18 @@ Specifies the source projects using [File Mappings](#file-mappings). ### `output` -Defines the output folder of the generated metadata files relative to `docfx.json` directory. The `docfx metadata --output ` command line argument overrides this value. +Specifies the output folder of the generated metadata files relative to `docfx.json` directory. The `docfx metadata --output ` command line argument overrides this value. + +### `outputFormat` + +Specifies the generated output file format. + +- `mref` (default): output as ManagedReference YAML files. +- `markdown`: Output as common-mark compliant markdown file. ### `dest` -Defines the output folder of the generated metadata files relative to `docfx.json` directory. The `docfx metadata --output ` command line argument prepends this value. +Specifies the output folder of the generated metadata files relative to `docfx.json` directory. The `docfx metadata --output ` command line argument prepends this value. ### `shouldSkipMarkup` @@ -309,7 +316,7 @@ If set to true, DocFX would not render triple-slash-comments in source code as m ### `filter` -Defines the filter configuration file, please go to [How to filter out unwanted apis attributes](../tutorial/howto_filter_out_unwanted_apis_attributes.md) for more details. +Specifies the filter configuration file, please go to [How to filter out unwanted apis attributes](../tutorial/howto_filter_out_unwanted_apis_attributes.md) for more details. ### `disableDefaultFilter` @@ -321,7 +328,7 @@ Disables generation of view source links. ### `properties` -Defines an optional set of MSBuild properties used when interpreting project files. These are the same properties that are passed to msbuild via the `/property:name=value` command line argument. +Specifies an optional set of MSBuild properties used when interpreting project files. These are the same properties that are passed to msbuild via the `/property:name=value` command line argument. ```json { @@ -343,14 +350,14 @@ Do not run `dotnet restore` before building the projects. ### `namespaceLayout` -Defines how namespaces in TOC are organized: +Specifies how namespaces in TOC are organized: - `flattened` (default): Renders namespaces as a single flat list. - `nested`: Renders namespaces in a nested tree form. ### `memberLayout` -Defines how member pages are organized: +Specifies how member pages are organized: - `samePage` (default): Places members in the same page as their containing type. - `separatePages`: Places members in separate pages. @@ -361,7 +368,7 @@ When enabled, continues documentation generation in case of compilation errors. ### `EnumSortOrder` -Defines how enum members are sorted: +Specifies how enum members are sorted: - `alphabetic` (default): Sort enum members in alphabetic order. - `declaringOrder`: Sort enum members in the order as they are declared in the source code. diff --git a/src/Docfx.Dotnet/DotnetApiCatalog.Compile.cs b/src/Docfx.Dotnet/DotnetApiCatalog.Compile.cs new file mode 100644 index 00000000000..feb125092ea --- /dev/null +++ b/src/Docfx.Dotnet/DotnetApiCatalog.Compile.cs @@ -0,0 +1,146 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using Docfx.Common; +using Microsoft.Build.Construction; +using Microsoft.Build.Framework; +using Microsoft.Build.Logging; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.MSBuild; + +#nullable enable + +namespace Docfx.Dotnet; + +partial class DotnetApiCatalog +{ + private static async Task> Compile(ExtractMetadataConfig config, DotnetApiOptions options) + { + var files = config.Files?.Select(s => new FileInformation(s)) + .GroupBy(f => f.Type) + .ToDictionary(s => s.Key, s => s.Distinct().ToList()) ?? new(); + + var msbuildProperties = config.MSBuildProperties ?? new Dictionary(); + if (!msbuildProperties.ContainsKey("Configuration")) + { + msbuildProperties["Configuration"] = "Release"; + } + + var msbuildLogger = new ConsoleLogger(Logger.LogLevelThreshold switch + { + LogLevel.Verbose => LoggerVerbosity.Normal, + LogLevel.Diagnostic => LoggerVerbosity.Diagnostic, + _ => LoggerVerbosity.Quiet, + }); + + var workspace = MSBuildWorkspace.Create(msbuildProperties); + workspace.WorkspaceFailed += (sender, e) => Logger.LogWarning($"{e.Diagnostic}"); + + if (files.TryGetValue(FileType.NotSupported, out var unsupportedFiles)) + { + foreach (var file in unsupportedFiles) + { + Logger.LogWarning($"Skip unsupported file {file}"); + } + } + + var hasCompilationError = false; + var projectCompilations = new HashSet(); + var assemblies = new List<(IAssemblySymbol, Compilation)>(); + + if (files.TryGetValue(FileType.Solution, out var solutionFiles)) + { + foreach (var solution in solutionFiles.Select(s => s.NormalizedPath)) + { + Logger.LogInfo($"Loading solution {solution}"); + foreach (var project in SolutionFile.Parse(solution).ProjectsInOrder) + { + if (project.ProjectType is SolutionProjectType.KnownToBeMSBuildFormat && + await LoadCompilationFromProject(project.AbsolutePath) is { } compilation) + { + projectCompilations.Add(compilation); + } + } + } + } + + if (files.TryGetValue(FileType.Project, out var projectFiles)) + { + foreach (var projectFile in projectFiles) + { + if (await LoadCompilationFromProject(projectFile.NormalizedPath) is { } compilation) + { + projectCompilations.Add(compilation); + } + } + } + + foreach (var compilation in projectCompilations) + { + hasCompilationError |= compilation.CheckDiagnostics(config.AllowCompilationErrors); + assemblies.Add((compilation.Assembly, compilation)); + } + + if (files.TryGetValue(FileType.CSSourceCode, out var csFiles)) + { + var compilation = CompilationHelper.CreateCompilationFromCSharpFiles(csFiles.Select(f => f.NormalizedPath)); + hasCompilationError |= compilation.CheckDiagnostics(config.AllowCompilationErrors); + assemblies.Add((compilation.Assembly, compilation)); + } + + if (files.TryGetValue(FileType.VBSourceCode, out var vbFiles)) + { + var compilation = CompilationHelper.CreateCompilationFromVBFiles(vbFiles.Select(f => f.NormalizedPath)); + hasCompilationError |= compilation.CheckDiagnostics(config.AllowCompilationErrors); + assemblies.Add((compilation.Assembly, compilation)); + } + + if (files.TryGetValue(FileType.Assembly, out var assemblyFiles)) + { + foreach (var assemblyFile in assemblyFiles) + { + Logger.LogInfo($"Loading assembly {assemblyFile.NormalizedPath}"); + var (compilation, assembly) = CompilationHelper.CreateCompilationFromAssembly(assemblyFile.NormalizedPath, config.References); + hasCompilationError |= compilation.CheckDiagnostics(config.AllowCompilationErrors); + assemblies.Add((assembly, compilation)); + } + } + + if (hasCompilationError) + { + return new(); + } + + if (assemblies.Count <= 0) + { + Logger.LogWarning("No .NET API project detected."); + } + + return assemblies; + + async Task LoadCompilationFromProject(string path) + { + var project = workspace.CurrentSolution.Projects.FirstOrDefault( + p => FilePathComparer.OSPlatformSensitiveRelativePathComparer.Equals(p.FilePath, path)); + + if (project is null) + { + Logger.LogInfo($"Loading project {path}"); + if (!config.NoRestore) + { + await Process.Start("dotnet", $"restore \"{path}\"").WaitForExitAsync(); + } + project = await workspace.OpenProjectAsync(path, msbuildLogger); + } + + if (!project.SupportsCompilation) + { + Logger.LogInfo($"Skip unsupported project {project.FilePath}."); + return null; + } + + return await project.GetCompilationAsync(); + } + } +} diff --git a/src/Docfx.Dotnet/DotnetApiCatalog.ManagedReference.cs b/src/Docfx.Dotnet/DotnetApiCatalog.ManagedReference.cs new file mode 100644 index 00000000000..6310aa2ab34 --- /dev/null +++ b/src/Docfx.Dotnet/DotnetApiCatalog.ManagedReference.cs @@ -0,0 +1,200 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Docfx.Common; +using Docfx.DataContracts.Common; +using Docfx.DataContracts.ManagedReference; +using Microsoft.CodeAnalysis; + +#nullable enable + +namespace Docfx.Dotnet; + +partial class DotnetApiCatalog +{ + private static void CreateManagedReference(List<(IAssemblySymbol symbol, Compilation compilation)> assemblies, ExtractMetadataConfig config, DotnetApiOptions options) + { + var projectMetadataList = new List(); + var filter = new SymbolFilter(config, options); + var extensionMethods = assemblies.SelectMany(assembly => assembly.Item1.FindExtensionMethods(filter)).ToArray(); + var allAssemblies = new HashSet(assemblies.Select(a => a.Item1), SymbolEqualityComparer.Default); + + foreach (var (assembly, compilation) in assemblies) + { + Logger.LogInfo($"Processing {assembly.Name}"); + var projectMetadata = assembly.Accept(new SymbolVisitorAdapter( + compilation, new(compilation, config.MemberLayout, allAssemblies), config, filter, extensionMethods)); + + if (projectMetadata != null) + projectMetadataList.Add(projectMetadata); + } + + Logger.LogInfo($"Creating output..."); + var allMembers = new Dictionary(); + var allReferences = new Dictionary(); + MergeMembers(allMembers, projectMetadataList); + MergeReferences(allReferences, projectMetadataList); + + if (allMembers.Count == 0) + { + var value = StringExtension.ToDelimitedString(projectMetadataList.Select(s => s.Name)); + Logger.Log(LogLevel.Warning, $"No .NET API detected for {value}."); + return; + } + + using (new PerformanceScope("ResolveAndExport")) + { + ResolveAndExportYamlMetadata(allMembers, allReferences); + } + + void ResolveAndExportYamlMetadata( + Dictionary allMembers, Dictionary allReferences) + { + var outputFileNames = new Dictionary(FilePathComparer.OSPlatformSensitiveStringComparer); + var model = YamlMetadataResolver.ResolveMetadata(allMembers, allReferences, config.NamespaceLayout); + + // generate toc.yml + model.TocYamlViewModel.Type = MemberType.Toc; + + var tocViewModel = new TocRootViewModel + { + Metadata = new() { ["memberLayout"] = config.MemberLayout }, + Items = model.TocYamlViewModel.ToTocViewModel(), + }; + string tocFilePath = Path.Combine(config.OutputFolder, "toc.yml"); + + YamlUtility.Serialize(tocFilePath, tocViewModel, YamlMime.TableOfContent); + outputFileNames.Add(tocFilePath, 1); + + ApiReferenceViewModel indexer = new(); + + // generate each item's yaml + var members = model.Members; + foreach (var memberModel in members) + { + var fileName = memberModel.Name.Replace('`', '-'); + var outputFileName = GetUniqueFileNameWithSuffix(fileName + Constants.YamlExtension, outputFileNames); + string itemFilePath = Path.Combine(config.OutputFolder, outputFileName); + var memberViewModel = memberModel.ToPageViewModel(config); + memberViewModel.ShouldSkipMarkup = config.ShouldSkipMarkup; + memberViewModel.MemberLayout = config.MemberLayout; + YamlUtility.Serialize(itemFilePath, memberViewModel, YamlMime.ManagedReference); + Logger.Log(LogLevel.Diagnostic, $"Metadata file for {memberModel.Name} is saved to {itemFilePath}."); + AddMemberToIndexer(memberModel, outputFileName, indexer); + } + + // generate manifest file + JsonUtility.Serialize(Path.Combine(config.OutputFolder, ".manifest"), indexer, Newtonsoft.Json.Formatting.Indented); + } + } + + private static string GetUniqueFileNameWithSuffix(string fileName, Dictionary existingFileNames) + { + if (existingFileNames.TryGetValue(fileName, out int suffix)) + { + existingFileNames[fileName] = suffix + 1; + var newFileName = $"{fileName}_{suffix}"; + var extensionIndex = fileName.LastIndexOf('.'); + if (extensionIndex > -1) + { + newFileName = $"{fileName.Substring(0, extensionIndex)}_{suffix}.{fileName.Substring(extensionIndex + 1)}"; + } + return GetUniqueFileNameWithSuffix(newFileName, existingFileNames); + } + else + { + existingFileNames[fileName] = 1; + return fileName; + } + } + + private static void AddMemberToIndexer(MetadataItem memberModel, string outputPath, ApiReferenceViewModel indexer) + { + if (memberModel.Type == MemberType.Namespace) + { + indexer.Add(memberModel.Name, outputPath); + } + else + { + TreeIterator.Preorder(memberModel, null, s => s!.Items, (member, parent) => + { + if (indexer.TryGetValue(member!.Name, out var path)) + { + Logger.LogWarning($"{member.Name} already exists in {path}, the duplicate one {outputPath} will be ignored."); + } + else + { + indexer.Add(member.Name, outputPath); + } + return true; + }); + } + } + + private static void MergeMembers(Dictionary result, List items) + { + foreach (var item in items) + { + MergeNode(item); + } + + bool MergeNode(MetadataItem node) + { + if (node.Type is MemberType.Assembly) + { + foreach (var item in node.Items ?? new()) + { + MergeNode(item); + } + return false; + } + + if (!result.TryGetValue(node.Name, out var existingNode)) + { + result.Add(node.Name, node); + foreach (var item in node.Items ?? new()) + { + MergeNode(item); + } + return true; + } + + if (node.Type is MemberType.Namespace or MemberType.Class) + { + foreach (var item in node.Items ?? new()) + { + if (MergeNode(item)) + { + existingNode.Items ??= new(); + existingNode.Items.Add(item); + } + } + return false; + } + + Logger.Log(LogLevel.Warning, $"Ignore duplicated member {node.Type}:{node.Name} from {node.Source?.Path} as it already exist in {existingNode.Source?.Path}."); + return false; + } + } + + private static void MergeReferences(Dictionary result, List items) + { + foreach (var project in items) + { + if (project.References != null) + { + foreach (var pair in project.References) + { + if (!result.ContainsKey(pair.Key)) + { + result[pair.Key] = pair.Value; + } + else + { + result[pair.Key].Merge(pair.Value); + } + } + } + } + } +} diff --git a/src/Docfx.Dotnet/DotnetApiCatalog.Page.cs b/src/Docfx.Dotnet/DotnetApiCatalog.Page.cs new file mode 100644 index 00000000000..c94b717218c --- /dev/null +++ b/src/Docfx.Dotnet/DotnetApiCatalog.Page.cs @@ -0,0 +1,650 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Concurrent; +using System.Text.RegularExpressions; +using Docfx.Common; +using Docfx.DataContracts.ManagedReference; +using Docfx.Plugins; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Shared.Extensions; + +#nullable enable + +namespace Docfx.Dotnet; + +partial class DotnetApiCatalog +{ + private static void CreatePages(Func output, List<(IAssemblySymbol symbol, Compilation compilation)> assemblies, ExtractMetadataConfig config, DotnetApiOptions options) + { + Directory.CreateDirectory(config.OutputFolder); + + var filter = new SymbolFilter(config, options); + var extensionMethods = assemblies.SelectMany(assembly => assembly.symbol.FindExtensionMethods(filter)).ToArray(); + var allAssemblies = new HashSet(assemblies.Select(a => a.symbol), SymbolEqualityComparer.Default); + var commentCache = new ConcurrentDictionary(SymbolEqualityComparer.Default); + var toc = CreateToc(assemblies, config, options); + var allSymbols = EnumerateToc(toc).SelectMany(node => node.symbols).ToList(); + allSymbols.Sort((a, b) => a.symbol.Name.CompareTo(b.symbol.Name)); + + Parallel.ForEach(EnumerateToc(toc), n => SaveTocNode(n.id, n.symbols)); + + Logger.LogInfo($"Export succeed: {EnumerateToc(toc).Count()} items"); + + void SaveTocNode(string id, List<(ISymbol symbol, Compilation compilation)> symbols) + { + var writer = output(config.OutputFolder, id); + var symbol = symbols[0].symbol; + var compilation = symbols[0].compilation; + var comment = Comment(symbol, compilation); + + switch (symbols[0].symbol) + { + case INamespaceSymbol ns: + Namespace(); + break; + + case INamedTypeSymbol type: + switch (type.TypeKind) + { + case TypeKind.Enum: Enum(type); break; + case TypeKind.Delegate: Delegate(type); break; + case TypeKind.Interface or TypeKind.Structure or TypeKind.Class: ClassLike(type); break; + default: throw new NotSupportedException($"Unknown symbol type kind {type.TypeKind}"); + } + break; + + case IFieldSymbol: + MemberHeader("Field"); + foreach (var (s, c) in symbols) + Field((IFieldSymbol)s, c, 2); + break; + + case IPropertySymbol: + MemberHeader("Property"); + foreach (var (s, c) in symbols) + Property((IPropertySymbol)s, c, 2); + break; + + case IEventSymbol: + MemberHeader("Event"); + foreach (var (s, c) in symbols) + Event((IEventSymbol)s, c, 2); + break; + + case IMethodSymbol method: + MemberHeader(method switch + { + _ when SymbolHelper.IsConstructor(method) => "Constructor", + _ when SymbolHelper.IsOperator(method) => "Operator", + _ when SymbolHelper.IsMember(method) => "Method", + _ => throw new NotSupportedException($"Unknown method type {method.MethodKind}"), + }); ; + foreach (var (s, c) in symbols) + Method((IMethodSymbol)s, c, 2); + break; + + default: + throw new NotSupportedException($"Unknown symbol type kind {symbols[0].symbol}"); + } + + writer.End(); + + void Namespace() + { + var namespaceSymbols = symbols.Select(n => n.symbol).ToHashSet(SymbolEqualityComparer.Default); + var types = ( + from s in allSymbols + where s.symbol.Kind is SymbolKind.NamedType && namespaceSymbols.Contains(s.symbol.ContainingNamespace) + select (symbol: (INamedTypeSymbol)s.symbol, s.compilation)).ToList(); + + writer.Heading(1, $"Namespace {symbol}"); + + Summary(comment); + Namespaces(); + Types(t => t.TypeKind is TypeKind.Class, "Classes"); + Types(t => t.TypeKind is TypeKind.Struct, "Structs"); + Types(t => t.TypeKind is TypeKind.Interface, "Interfaces"); + Types(t => t.TypeKind is TypeKind.Enum, "Enums"); + Types(t => t.TypeKind is TypeKind.Delegate, "Delegates"); + + void Namespaces() + { + var items = symbols + .SelectMany(n => ((INamespaceSymbol)n.symbol).GetNamespaceMembers().Select(symbol => (symbol, n.compilation))) + .DistinctBy(n => n.symbol.Name) + .OrderBy(n => n.symbol.Name) + .ToList(); + + if (items.Count is 0) + return; + + writer.Heading(3, "Namespaces"); + SummaryList(items); + } + + void Types(Func predicate, string headingText) + { + var items = types.Where(t => predicate(t.symbol)).ToList(); + if (items.Count == 0) + return; + + writer.Heading(3, headingText); + SummaryList(items); + } + } + + void Enum(INamedTypeSymbol type) + { + writer.Heading(1, $"Enum {SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp)}"); + + writer.Facts(Facts().ToArray()); + Summary(comment); + Syntax(symbol); + + ExtensionMethods(type); + + EnumFields(type); + + Examples(comment); + Remarks(comment); + SeeAlsos(comment); + } + + void Delegate(INamedTypeSymbol type) + { + writer.Heading(1, $"Delegate {SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp)}"); + + writer.Facts(Facts().ToArray()); + Summary(comment); + Syntax(symbol); + + var invokeMethod = type.DelegateInvokeMethod!; + Parameters(invokeMethod, comment, 4); + Returns(invokeMethod, comment, 4); + TypeParameters(invokeMethod.ContainingType, comment, 4); + + ExtensionMethods(type); + + Examples(comment); + Remarks(comment); + SeeAlsos(comment); + } + + void ClassLike(INamedTypeSymbol type) + { + var typeHeader = type.TypeKind switch + { + TypeKind.Interface => "Interface", + TypeKind.Class => "Class", + TypeKind.Struct => "Struct", + _ => throw new InvalidOperationException(), + }; + + writer.Heading(1, $"{typeHeader} {SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp)}"); + + writer.Facts(Facts().ToArray()); + Summary(comment); + Syntax(symbol); + + TypeParameters(symbol, comment, 4); + Inheritance(); + Derived(); + Implements(); + InheritedMembers(); + ExtensionMethods(type); + + Examples(comment); + Remarks(comment); + + Methods(SymbolHelper.IsConstructor, "Constructors"); + Fields(); + Properties(); + Methods(SymbolHelper.IsMethod, "Methods"); + Events(); + Methods(SymbolHelper.IsOperator, "Operators"); + + SeeAlsos(comment); + + void Fields() + { + var items = ( + from s in symbols + from symbol in ((INamedTypeSymbol)s.symbol).GetMembers().OfType() + where filter.IncludeApi(symbol) + orderby symbol.Name + select (symbol, s.compilation)).ToList(); + + if (items.Count is 0) + return; + + writer.Heading(2, "Fields"); + + if (config.MemberLayout is MemberLayout.SeparatePages) + { + SummaryList(items); + return; + } + + foreach (var (s, c) in items) + Field(s, c, 3); + } + + void Properties() + { + var items = ( + from s in symbols + from symbol in ((INamedTypeSymbol)s.symbol).GetMembers().OfType() + where filter.IncludeApi(symbol) + orderby symbol.Name + select (symbol, s.compilation)).ToList(); + + if (items.Count is 0) + return; + + writer.Heading(2, "Properties"); + + if (config.MemberLayout is MemberLayout.SeparatePages) + { + SummaryList(items); + return; + } + + foreach (var (s, c) in items) + Property(s, c, 3); + } + + void Methods(Func predicate, string headingText) + { + var items = ( + from s in symbols + from symbol in ((INamedTypeSymbol)s.symbol).GetMembers().OfType() + where filter.IncludeApi(symbol) && predicate(symbol) + orderby symbol.Name + select (symbol, s.compilation)).ToList(); + + if (items.Count is 0) + return; + + writer.Heading(2, headingText); + if (config.MemberLayout is MemberLayout.SeparatePages) + { + SummaryList(items); + return; + } + + foreach (var (s, c) in items) + Method(s, c, 3); + } + + void Events() + { + var items = ( + from s in symbols + from symbol in ((INamedTypeSymbol)s.symbol).GetMembers().OfType() + where filter.IncludeApi(symbol) + orderby symbol.Name + select (symbol, s.compilation)).ToList(); + + if (items.Count is 0) + return; + + if (config.MemberLayout is MemberLayout.SeparatePages) + { + SummaryList(items); + return; + } + + foreach (var (s, c) in items) + Event(s, c, 3); + } + + void Inheritance() + { + var items = new List(); + for (var i = type; i is not null && i.SpecialType is not SpecialType.System_ValueType; i = i.BaseType) + items.Add(i); + + if (items.Count <= 1) + return; + + items.Reverse(); + writer.Heading(6, "Inheritance"); + List(items, ListDelimiter.LeftArrow); + } + + void Derived() + { + var items = ( + from s in allSymbols + where s.symbol.Kind is SymbolKind.NamedType && SymbolEqualityComparer.Default.Equals(((INamedTypeSymbol)s.symbol).BaseType, symbol) + select s.symbol).ToList(); + + if (items.Count is 0) + return; + + writer.Heading(6, "Derived"); + List(items); + } + + void Implements() + { + var items = type.AllInterfaces.Where(filter.IncludeApi).ToList(); + if (items.Count is 0) + return; + + writer.Heading(6, "Implements"); + List(items); + } + + void InheritedMembers() + { + var items = type.GetInheritedMembers(filter).ToList(); + if (items.Count is 0) + return; + + writer.Heading(6, "Inherited Members"); + List(items); + } + } + + void MemberHeader(string headingText) + { + writer.Heading(1, $"{headingText} {SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp, overload: true)}"); + writer.Facts(Facts().ToArray()); + } + + void ExtensionMethods(INamedTypeSymbol type) + { + var items = extensionMethods + .Where(m => m.Language == symbol.Language) + .Select(m => m.ReduceExtensionMethod(type)) + .OfType() + .OrderBy(i => i.Name) + .ToList(); + + if (items.Count is 0) + return; + + writer.Heading(6, "Extension Methods"); + List(items); + } + + void SummaryList(IEnumerable<(T, Compilation)> items) where T : ISymbol + { + writer.ParameterList(items.Select(i => + { + var (symbol, compilation) = i; + var comment = Comment(symbol, compilation); + var type = symbol is INamedTypeSymbol ? ShortLink(symbol, compilation) : NameOnlyLink(symbol, compilation); + return new Parameter { type =type, docs = comment?.Summary }; + }).ToArray()); + } + + void List(IEnumerable items, ListDelimiter delimiter = ListDelimiter.Comma) + { + writer.List(delimiter, items.Select(i => ShortLink(i, compilation)).ToArray()); + } + + void Parameters(ISymbol symbol, XmlComment? comment, int headingLevel) + { + var parameters = symbol.GetParameters(); + if (!parameters.Any()) + return; + + writer.Heading(headingLevel, "Parameters"); + writer.ParameterList(parameters.Select(ToParameter).ToArray()); + + Parameter ToParameter(IParameterSymbol param) + { + var docs = comment?.Parameters is { } p && p.TryGetValue(param.Name, out var value) ? value : null; + return new() { name = param.Name, type = FullLink(param.Type, compilation), docs = docs }; + } + } + + void Returns(IMethodSymbol symbol, XmlComment? comment, int headingLevel) + { + if (symbol.ReturnType is null || symbol.ReturnType.SpecialType is SpecialType.System_Void) + return; + + writer.Heading(headingLevel, "Returns"); + writer.ParameterList(new Parameter { type = FullLink(symbol.ReturnType, compilation), docs = comment?.Returns }); + } + + void TypeParameters(ISymbol symbol, XmlComment? comment, int headingLevel) + { + if (symbol.GetTypeParameters() is { } typeParameters && typeParameters.Length is 0) + return; + + writer.Heading(headingLevel, "Type Parameters"); + writer.ParameterList(typeParameters.Select(ToParameter).ToArray()); + + Parameter ToParameter(ITypeParameterSymbol param) + { + var docs = comment?.TypeParameters is { } p && p.TryGetValue(param.Name, out var value) ? value : null; + return new() { name = param.Name, docs = docs }; + } + } + + void Method(IMethodSymbol symbol, Compilation compilation, int headingLevel) + { + var fragment = Regex.Replace(VisitorHelper.GetId(symbol), @"\W", "_"); + writer.Heading(headingLevel, SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp), fragment); + + var comment = Comment(symbol, compilation); + Summary(comment); + Syntax(symbol); + + Parameters(symbol, comment, headingLevel + 1); + Returns(symbol, comment, headingLevel + 1); + TypeParameters(symbol, comment, headingLevel + 1); + + Examples(comment, headingLevel + 1); + Remarks(comment, headingLevel + 1); + Exceptions(comment, headingLevel + 1); + SeeAlsos(comment, headingLevel + 1); + } + + void Field(IFieldSymbol symbol, Compilation compilation, int headingLevel) + { + var fragment = Regex.Replace(VisitorHelper.GetId(symbol), @"\W", "_"); + writer.Heading(headingLevel, SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp), fragment); + + var comment = Comment(symbol, compilation); + Summary(comment); + Syntax(symbol); + + writer.Heading(headingLevel + 1, "Field Value"); + writer.ParameterList(new Parameter { type = FullLink(symbol.Type, compilation) }); + + Examples(comment, headingLevel + 1); + Remarks(comment, headingLevel + 1); + Exceptions(comment, headingLevel + 1); + SeeAlsos(comment, headingLevel + 1); + } + + void Property(IPropertySymbol symbol, Compilation compilation, int headingLevel) + { + var fragment = Regex.Replace(VisitorHelper.GetId(symbol), @"\W", "_"); + writer.Heading(headingLevel, SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp), fragment); + + var comment = Comment(symbol, compilation); + Summary(comment); + Syntax(symbol); + + writer.Heading(headingLevel + 1, "Property Value"); + writer.ParameterList(new Parameter { type = FullLink(symbol.Type, compilation) }); + + Examples(comment, headingLevel + 1); + Remarks(comment, headingLevel + 1); + Exceptions(comment, headingLevel + 1); + SeeAlsos(comment, headingLevel + 1); + } + + void Event(IEventSymbol symbol, Compilation compilation, int headingLevel) + { + var fragment = Regex.Replace(VisitorHelper.GetId(symbol), @"\W", "_"); + writer.Heading(headingLevel, SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp), fragment); + + var comment = Comment(symbol, compilation); + Summary(comment); + Syntax(symbol); + + writer.Heading(headingLevel + 1, "Event Type"); + writer.ParameterList(new Parameter { type = FullLink(symbol.Type, compilation) }); + + Examples(comment, headingLevel + 1); + Remarks(comment, headingLevel + 1); + Exceptions(comment, headingLevel + 1); + SeeAlsos(comment, headingLevel + 1); + } + + void EnumFields(INamedTypeSymbol type) + { + var items = type.GetMembers().OfType().Where(filter.IncludeApi).ToList(); + if (!items.Any()) + return; + + if (config.EnumSortOrder is EnumSortOrder.Alphabetic) + items = items.OrderBy(m => m.Name).ToList(); + + writer.Heading(2, "Fields"); + writer.ParameterList(items.Select(ToParameter).ToArray()); + + Parameter ToParameter(IFieldSymbol item) + { + var docs = Comment(item, compilation) is { } comment ? comment.Summary : null; + return new() { name = item.Name, defaultValue = $"{item.ConstantValue}", docs = docs }; + } + } + + IEnumerable Facts() + { + yield return new("Namespace", ShortLink(symbol.ContainingNamespace, compilation)); + + var assemblies = symbols.Select(s => s.symbol.ContainingAssembly.Name).Where(n => n != "?").Distinct().Select(n => $"{n}.dll").ToList(); + if (assemblies.Count > 0) + yield return new("Assembly", new[] { new TextSpan(string.Join(", ", assemblies)) }); + } + + void Summary(XmlComment? comment) + { + if (!string.IsNullOrEmpty(comment?.Summary)) + writer.Markdown(comment.Summary); + } + + void Syntax(ISymbol symbol) + { + var syntax = SymbolFormatter.GetSyntax(symbol, SyntaxLanguage.CSharp, filter); + writer.Declaration(syntax, "csharp"); + } + + void Examples(XmlComment? comment, int headingLevel = 2) + { + if (comment?.Examples?.Count > 0) + { + writer.Heading(headingLevel, "Examples"); + + foreach (var example in comment.Examples) + writer.Markdown(example); + } + } + + void Remarks(XmlComment? comment, int headingLevel = 2) + { + if (!string.IsNullOrEmpty(comment?.Remarks)) + { + writer.Heading(headingLevel, "Remarks"); + writer.Markdown(comment.Remarks); + } + } + + void Exceptions(XmlComment? comment, int headingLevel = 2) + { + if (comment?.Exceptions?.Count > 0) + { + writer.Heading(headingLevel, "Exceptions"); + writer.ParameterList(comment.Exceptions.Select( + e => new Parameter() { type = Cref(e.CommentId), docs = e.Description }).ToArray()); + } + } + + void SeeAlsos(XmlComment? comment, int headingLevel = 2) + { + if (comment?.SeeAlsos?.Count > 0) + { + writer.Heading(headingLevel, "See Also"); + writer.List(ListDelimiter.NewLine, comment.SeeAlsos.Select(s => s.LinkType switch + { + LinkType.CRef => Cref(s.CommentId), + LinkType.HRef => new[] { new TextSpan(s.LinkId, (string?)s.LinkId) }, + _ => throw new NotSupportedException($"{s.LinkType}"), + }).ToArray()); + } + } + + TextSpan[] Cref(string commentId) + { + return DocumentationCommentId.GetFirstSymbolForDeclarationId(commentId, compilation) is { } symbol ? FullLink(symbol, compilation) : Array.Empty(); + } + } + + TextSpan[] ShortLink(ISymbol symbol, Compilation compilation) + { + var title = SymbolFormatter.GetNameWithType(symbol, SyntaxLanguage.CSharp); + var url = SymbolUrlResolver.GetSymbolUrl(symbol, compilation, config.MemberLayout, SymbolUrlKind.Markdown, allAssemblies); + return new[] { new TextSpan(title, url) }; + } + + TextSpan[] FullLink(ISymbol symbol, Compilation compilation) + { + var parts = SymbolFormatter.GetNameWithTypeParts(symbol, SyntaxLanguage.CSharp); + var linkItems = SymbolFormatter.ToLinkItems(parts, compilation, config.MemberLayout, allAssemblies, overload: false, SymbolUrlKind.Markdown); + + return linkItems.Select(i => new TextSpan(i.DisplayName, (string?)i.Href)).ToArray(); + } + + TextSpan[] NameOnlyLink(ISymbol symbol, Compilation compilation) + { + var title = SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp); + var url = SymbolUrlResolver.GetSymbolUrl(symbol, compilation, config.MemberLayout, SymbolUrlKind.Markdown, allAssemblies); + return new[] { new TextSpan(title, url) }; + } + + XmlComment? Comment(ISymbol symbol, Compilation compilation) + { + // Cache XML comment to avoid duplicated parsing and warnings + return commentCache.GetOrAdd(symbol, symbol => + { + var src = VisitorHelper.GetSourceDetail(symbol, compilation); + var context = new XmlCommentParserContext + { + SkipMarkup = config.ShouldSkipMarkup, + AddReferenceDelegate = (a, b) => { }, + Source = src, + ResolveCode = ResolveCode, + }; + + var comment = symbol.GetDocumentationComment(compilation, expandIncludes: true, expandInheritdoc: true); + return XmlComment.Parse(comment.FullXmlFragment, context); + + string? ResolveCode(string source) + { + var basePath = config.CodeSourceBasePath ?? ( + src?.Path is { } sourcePath + ? Path.GetDirectoryName(Path.GetFullPath(Path.Combine(EnvironmentContext.BaseDirectory, sourcePath))) + : null); + + var path = Path.GetFullPath(Path.Combine(basePath ?? "", source)); + if (!File.Exists(path)) + { + Logger.LogWarning($"Source file '{path}' not found."); + return null; + } + + return File.ReadAllText(path); + } + }); + } + } +} diff --git a/src/Docfx.Dotnet/DotnetApiCatalog.Toc.cs b/src/Docfx.Dotnet/DotnetApiCatalog.Toc.cs new file mode 100644 index 00000000000..30114dde945 --- /dev/null +++ b/src/Docfx.Dotnet/DotnetApiCatalog.Toc.cs @@ -0,0 +1,255 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Docfx.Common; +using Docfx.DataContracts.ManagedReference; +using Microsoft.CodeAnalysis; + +#nullable enable + +namespace Docfx.Dotnet; + +partial class DotnetApiCatalog +{ + enum TocNodeType + { + None, + Namespace, + Class, + Struct, + Interface, + Enum, + Delegate, + Constructor, + Field, + Property, + Method, + Event, + Operator, + } + + class TocNode + { + public string name { get; init; } = ""; + public string? href { get; init; } + public List? items { get; set; } + + internal TocNodeType type; + internal string? id; + internal bool containsLeafNodes; + internal List<(ISymbol symbol, Compilation compilation)> symbols = new(); + } + + private static List CreateToc(List<(IAssemblySymbol symbol, Compilation compilation)> assemblies, ExtractMetadataConfig config, DotnetApiOptions options) + { + Logger.LogWarning($"Markdown output format is experimental."); + + Directory.CreateDirectory(config.OutputFolder); + + var filter = new SymbolFilter(config, options); + var tocNodes = new Dictionary(); + var toc = assemblies.SelectMany(a => CreateToc(a.symbol.GlobalNamespace, a.compilation)).ToList(); + + SortToc(toc, root: true); + + YamlUtility.Serialize(Path.Combine(config.OutputFolder, "toc.yml"), toc, YamlMime.TableOfContent); + return toc; + + IEnumerable CreateToc(ISymbol symbol, Compilation compilation) + { + if (!filter.IncludeApi(symbol)) + yield break; + + switch (symbol) + { + case INamespaceSymbol ns when ns.IsGlobalNamespace: + foreach (var child in ns.GetNamespaceMembers()) + foreach (var item in CreateToc(child, compilation)) + yield return item; + break; + + case INamespaceSymbol ns: + foreach (var item in CreateNamespaceToc(ns)) + yield return item; + break; + + case INamedTypeSymbol type: + foreach (var item in CreateNamedTypeToc(type)) + yield return item; + break; + + case IFieldSymbol or IPropertySymbol or IMethodSymbol or IEventSymbol: + foreach (var item in CreateMemberToc(symbol)) + yield return item; + break; + + default: + throw new NotSupportedException($"Unknown symbol {symbol}"); + } + + IEnumerable CreateNamespaceToc(INamespaceSymbol ns) + { + var idExists = true; + var id = VisitorHelper.PathFriendlyId(VisitorHelper.GetId(symbol)); + if (!tocNodes.TryGetValue(id, out var node)) + { + idExists = false; + tocNodes.Add(id, node = new() + { + id = id, + name = config.NamespaceLayout is NamespaceLayout.Nested ? symbol.Name : symbol.ToString() ?? "", + href = $"{id}.md", + type = TocNodeType.Namespace, + }); + } + + node.items ??= new(); + node.symbols.Add((symbol, compilation)); + + foreach (var child in ns.GetNamespaceMembers()) + { + if (config.NamespaceLayout is NamespaceLayout.Flattened) + foreach (var item in CreateToc(child, compilation)) + yield return item; + else if (config.NamespaceLayout is NamespaceLayout.Nested) + node.items.AddRange(CreateToc(child, compilation)); + } + + foreach (var child in ns.GetTypeMembers()) + { + node.items.AddRange(CreateToc(child, compilation)); + } + + node.containsLeafNodes = node.items.Any(i => i.containsLeafNodes); + if (!idExists && node.containsLeafNodes) + { + yield return node; + } + } + + IEnumerable CreateNamedTypeToc(INamedTypeSymbol type) + { + var idExists = true; + var id = VisitorHelper.PathFriendlyId(VisitorHelper.GetId(symbol)); + if (!tocNodes.TryGetValue(id, out var node)) + { + idExists = false; + tocNodes.Add(id, node = new() + { + id = id, + name = SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp), + href = $"{id}.md", + containsLeafNodes = true, + type = type.TypeKind switch + { + TypeKind.Class => TocNodeType.Class, + TypeKind.Interface => TocNodeType.Interface, + TypeKind.Struct => TocNodeType.Struct, + TypeKind.Delegate => TocNodeType.Delegate, + TypeKind.Enum => TocNodeType.Enum, + _ => throw new NotSupportedException($"Unknown type kind {type.TypeKind}"), + } + }); + } + + foreach (var child in type.GetTypeMembers()) + { + foreach (var item in CreateToc(child, compilation)) + yield return item; + } + + if (config.MemberLayout is MemberLayout.SeparatePages && type.TypeKind is TypeKind.Class or TypeKind.Interface or TypeKind.Struct) + { + node.items ??= new(); + foreach (var member in type.GetMembers()) + node.items.AddRange(CreateToc(member, compilation)); + } + + node.symbols.Add((symbol, compilation)); + + if (!idExists) + { + yield return node; + } + } + + IEnumerable CreateMemberToc(ISymbol symbol) + { + var type = symbol switch + { + IPropertySymbol => TocNodeType.Property, + IFieldSymbol => TocNodeType.Field, + IEventSymbol => TocNodeType.Event, + IMethodSymbol method when SymbolHelper.IsConstructor(method) => TocNodeType.Constructor, + IMethodSymbol method when SymbolHelper.IsMethod(method) => TocNodeType.Method, + IMethodSymbol method when SymbolHelper.IsOperator(method) => TocNodeType.Operator, + _ => TocNodeType.None, + }; + + if (type is TocNodeType.None) + yield break; + + var id = VisitorHelper.PathFriendlyId(VisitorHelper.GetOverloadId(symbol)); + if (!tocNodes.TryGetValue(id, out var node)) + { + tocNodes.Add(id, node = new() + { + id = id, + name = SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp, overload: true), + href = $"{id}.md", + containsLeafNodes = true, + type = type, + }); + yield return node; + } + + node.symbols.Add((symbol, compilation)); + } + } + + static void SortToc(List items, bool root) + { + items.Sort((a, b) => a.type.CompareTo(b.type) is var r && r is 0 ? a.name.CompareTo(b.name) : r); + + if (!root) + { + InsertCategory(TocNodeType.Class, "Classes"); + InsertCategory(TocNodeType.Struct, "Structs"); + InsertCategory(TocNodeType.Interface, "Interfaces"); + InsertCategory(TocNodeType.Enum, "Enums"); + InsertCategory(TocNodeType.Delegate, "Delegates"); + InsertCategory(TocNodeType.Constructor, "Constructors"); + InsertCategory(TocNodeType.Field, "Fields"); + InsertCategory(TocNodeType.Property, "Properties"); + InsertCategory(TocNodeType.Method, "Methods"); + InsertCategory(TocNodeType.Event, "Events"); + InsertCategory(TocNodeType.Operator, "Operators"); + } + + foreach (var item in items) + { + if (item.items is not null) + SortToc(item.items, root: false); + } + + void InsertCategory(TocNodeType type, string name) + { + if (items.FirstOrDefault(i => i.type == type) is { } node) + items.Insert(items.IndexOf(node), new() { name = name }); + } + } + } + + private static IEnumerable<(string id, List<(ISymbol symbol, Compilation compilation)> symbols)> EnumerateToc(List items) + { + foreach (var item in items) + { + if (item.items is not null) + foreach (var i in EnumerateToc(item.items)) + yield return i; + + if (item.id is not null && item.symbols.Count > 0) + yield return (item.id, item.symbols); + } + } +} diff --git a/src/Docfx.Dotnet/DotnetApiCatalog.cs b/src/Docfx.Dotnet/DotnetApiCatalog.cs index 6e399efb11f..c28ced9b00f 100644 --- a/src/Docfx.Dotnet/DotnetApiCatalog.cs +++ b/src/Docfx.Dotnet/DotnetApiCatalog.cs @@ -12,7 +12,7 @@ namespace Docfx.Dotnet; /// /// Provides access to a .NET API definitions and their associated documentation. /// -public static class DotnetApiCatalog +public static partial class DotnetApiCatalog { /// /// Generates metadata reference YAML files using docfx.json config. @@ -67,22 +67,33 @@ internal static async Task Exec(MetadataJsonConfig config, DotnetApiOptions opti VisitorHelper.GlobalNamespaceId = item.GlobalNamespaceId; EnvironmentContext.SetGitFeaturesDisabled(item.DisableGitFeatures); - // TODO: Use plugin to generate metadata for files with different extension? - using var worker = new ExtractMetadataWorker(ConvertConfig(item, configDirectory, outputDirectory), options); - await worker.ExtractMetadataAsync(); + await Build(ConvertConfig(item, configDirectory, outputDirectory), options); } VisitorHelper.GlobalNamespaceId = originalGlobalNamespaceId; } } - catch (AggregateException e) - { - throw e.GetBaseException(); - } finally { EnvironmentContext.Clean(); } + + async Task Build(ExtractMetadataConfig config, DotnetApiOptions options) + { + var assemblies = await Compile(config, options); + + switch (config.OutputFormat) + { + case MetadataOutputFormat.Markdown: + Logger.LogWarning($"Markdown output format is experimental."); + CreatePages(MarkdownWriter.Create, assemblies, config, options); + break; + + case MetadataOutputFormat.Mref: + CreateManagedReference(assemblies, config, options); + break; + } + } } private static void EnsureMSBuildLocator() diff --git a/src/Docfx.Dotnet/ExtractMetadata/ExtractMetadataWorker.cs b/src/Docfx.Dotnet/ExtractMetadata/ExtractMetadataWorker.cs deleted file mode 100644 index c4127fb011e..00000000000 --- a/src/Docfx.Dotnet/ExtractMetadata/ExtractMetadataWorker.cs +++ /dev/null @@ -1,356 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Diagnostics; -using Docfx.Common; -using Docfx.DataContracts.Common; -using Docfx.DataContracts.ManagedReference; -using Microsoft.Build.Construction; -using Microsoft.Build.Framework; -using Microsoft.Build.Logging; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.MSBuild; - -#nullable enable - -namespace Docfx.Dotnet; - -internal class ExtractMetadataWorker : IDisposable -{ - private readonly Dictionary> _files; - private readonly ExtractMetadataConfig _config; - private readonly DotnetApiOptions _options; - private readonly ConsoleLogger _msbuildLogger; - - //Lacks UT for shared workspace - private readonly MSBuildWorkspace _workspace; - - public ExtractMetadataWorker(ExtractMetadataConfig config, DotnetApiOptions options) - { - _config = config; - _options = options; - _files = config.Files?.Select(s => new FileInformation(s)) - .GroupBy(f => f.Type) - .ToDictionary(s => s.Key, s => s.Distinct().ToList()) ?? new(); - - var msbuildProperties = config.MSBuildProperties ?? new Dictionary(); - if (!msbuildProperties.ContainsKey("Configuration")) - { - msbuildProperties["Configuration"] = "Release"; - } - - _msbuildLogger = new(Logger.LogLevelThreshold switch - { - LogLevel.Verbose => LoggerVerbosity.Normal, - LogLevel.Diagnostic => LoggerVerbosity.Diagnostic, - _ => LoggerVerbosity.Quiet, - }); - - _workspace = MSBuildWorkspace.Create(msbuildProperties); - _workspace.WorkspaceFailed += (sender, e) => Logger.LogWarning($"{e.Diagnostic}"); - } - - public void Dispose() - { - _workspace.Dispose(); - } - - public async Task ExtractMetadataAsync() - { - if (_files.TryGetValue(FileType.NotSupported, out var unsupportedFiles)) - { - foreach (var file in unsupportedFiles) - { - Logger.LogWarning($"Skip unsupported file {file}"); - } - } - - var hasCompilationError = false; - var projectCompilations = new HashSet(); - var assemblies = new List<(IAssemblySymbol, Compilation)>(); - - if (_files.TryGetValue(FileType.Solution, out var solutionFiles)) - { - foreach (var solution in solutionFiles.Select(s => s.NormalizedPath)) - { - Logger.LogInfo($"Loading solution {solution}"); - foreach (var project in SolutionFile.Parse(solution).ProjectsInOrder) - { - if (project.ProjectType is SolutionProjectType.KnownToBeMSBuildFormat && - await LoadCompilationFromProject(project.AbsolutePath) is { } compilation) - { - projectCompilations.Add(compilation); - } - } - } - } - - if (_files.TryGetValue(FileType.Project, out var projectFiles)) - { - foreach (var projectFile in projectFiles) - { - if (await LoadCompilationFromProject(projectFile.NormalizedPath) is { } compilation) - { - projectCompilations.Add(compilation); - } - } - } - - foreach (var compilation in projectCompilations) - { - hasCompilationError |= compilation.CheckDiagnostics(_config.AllowCompilationErrors); - assemblies.Add((compilation.Assembly, compilation)); - } - - if (_files.TryGetValue(FileType.CSSourceCode, out var csFiles)) - { - var compilation = CompilationHelper.CreateCompilationFromCSharpFiles(csFiles.Select(f => f.NormalizedPath)); - hasCompilationError |= compilation.CheckDiagnostics(_config.AllowCompilationErrors); - assemblies.Add((compilation.Assembly, compilation)); - } - - if (_files.TryGetValue(FileType.VBSourceCode, out var vbFiles)) - { - var compilation = CompilationHelper.CreateCompilationFromVBFiles(vbFiles.Select(f => f.NormalizedPath)); - hasCompilationError |= compilation.CheckDiagnostics(_config.AllowCompilationErrors); - assemblies.Add((compilation.Assembly, compilation)); - } - - if (_files.TryGetValue(FileType.Assembly, out var assemblyFiles)) - { - foreach (var assemblyFile in assemblyFiles) - { - Logger.LogInfo($"Loading assembly {assemblyFile.NormalizedPath}"); - var (compilation, assembly) = CompilationHelper.CreateCompilationFromAssembly(assemblyFile.NormalizedPath, _config.References); - hasCompilationError |= compilation.CheckDiagnostics(_config.AllowCompilationErrors); - assemblies.Add((assembly, compilation)); - } - } - - if (hasCompilationError) - { - return; - } - - if (assemblies.Count <= 0) - { - Logger.LogWarning("No .NET API project detected."); - return; - } - - if (_config.OutputFormat is MetadataOutputFormat.Markdown) - { - MarkdownFormatter.Save(assemblies, _config, _options); - return; - } - - var projectMetadataList = new List(); - var filter = new SymbolFilter(_config, _options); - var extensionMethods = assemblies.SelectMany(assembly => assembly.Item1.FindExtensionMethods(filter)).ToArray(); - var allAssemblies = new HashSet(assemblies.Select(a => a.Item1), SymbolEqualityComparer.Default); - - foreach (var (assembly, compilation) in assemblies) - { - Logger.LogInfo($"Processing {assembly.Name}"); - var projectMetadata = assembly.Accept(new SymbolVisitorAdapter( - compilation, new(compilation, _config.MemberLayout, allAssemblies), _config, filter, extensionMethods)); - - if (projectMetadata != null) - projectMetadataList.Add(projectMetadata); - } - - Logger.LogInfo($"Creating output..."); - var allMembers = new Dictionary(); - var allReferences = new Dictionary(); - MergeMembers(allMembers, projectMetadataList); - MergeReferences(allReferences, projectMetadataList); - - if (allMembers.Count == 0) - { - var value = StringExtension.ToDelimitedString(projectMetadataList.Select(s => s.Name)); - Logger.Log(LogLevel.Warning, $"No .NET API detected for {value}."); - return; - } - - using (new PerformanceScope("ResolveAndExport")) - { - ResolveAndExportYamlMetadata(allMembers, allReferences); - } - } - - private async Task LoadCompilationFromProject(string path) - { - var project = _workspace.CurrentSolution.Projects.FirstOrDefault( - p => FilePathComparer.OSPlatformSensitiveRelativePathComparer.Equals(p.FilePath, path)); - - if (project is null) - { - Logger.LogInfo($"Loading project {path}"); - if (!_config.NoRestore) - { - await Process.Start("dotnet", $"restore \"{path}\"").WaitForExitAsync(); - } - project = await _workspace.OpenProjectAsync(path, _msbuildLogger); - } - - if (!project.SupportsCompilation) - { - Logger.LogInfo($"Skip unsupported project {project.FilePath}."); - return null; - } - - return await project.GetCompilationAsync(); - } - - private void ResolveAndExportYamlMetadata( - Dictionary allMembers, Dictionary allReferences) - { - var outputFileNames = new Dictionary(FilePathComparer.OSPlatformSensitiveStringComparer); - var model = YamlMetadataResolver.ResolveMetadata(allMembers, allReferences, _config.NamespaceLayout); - - var tocFileName = Constants.TocYamlFileName; - - // generate toc.yml - model.TocYamlViewModel.Type = MemberType.Toc; - - var tocViewModel = new TocRootViewModel - { - Metadata = new() { ["memberLayout"] = _config.MemberLayout }, - Items = model.TocYamlViewModel.ToTocViewModel(), - }; - string tocFilePath = Path.Combine(_config.OutputFolder, tocFileName); - - YamlUtility.Serialize(tocFilePath, tocViewModel, YamlMime.TableOfContent); - outputFileNames.Add(tocFilePath, 1); - - ApiReferenceViewModel indexer = new(); - - // generate each item's yaml - var members = model.Members; - foreach (var memberModel in members) - { - var fileName = memberModel.Name.Replace('`', '-'); - var outputFileName = GetUniqueFileNameWithSuffix(fileName + Constants.YamlExtension, outputFileNames); - string itemFilePath = Path.Combine(_config.OutputFolder, outputFileName); - var memberViewModel = memberModel.ToPageViewModel(_config); - memberViewModel.ShouldSkipMarkup = _config.ShouldSkipMarkup; - memberViewModel.MemberLayout = _config.MemberLayout; - YamlUtility.Serialize(itemFilePath, memberViewModel, YamlMime.ManagedReference); - Logger.Log(LogLevel.Diagnostic, $"Metadata file for {memberModel.Name} is saved to {itemFilePath}."); - AddMemberToIndexer(memberModel, outputFileName, indexer); - } - - // generate manifest file - JsonUtility.Serialize(Path.Combine(_config.OutputFolder, ".manifest"), indexer, Newtonsoft.Json.Formatting.Indented); - } - - private static string GetUniqueFileNameWithSuffix(string fileName, Dictionary existingFileNames) - { - if (existingFileNames.TryGetValue(fileName, out int suffix)) - { - existingFileNames[fileName] = suffix + 1; - var newFileName = $"{fileName}_{suffix}"; - var extensionIndex = fileName.LastIndexOf('.'); - if (extensionIndex > -1) - { - newFileName = $"{fileName.Substring(0, extensionIndex)}_{suffix}.{fileName.Substring(extensionIndex + 1)}"; - } - return GetUniqueFileNameWithSuffix(newFileName, existingFileNames); - } - else - { - existingFileNames[fileName] = 1; - return fileName; - } - } - - private static void AddMemberToIndexer(MetadataItem memberModel, string outputPath, ApiReferenceViewModel indexer) - { - if (memberModel.Type == MemberType.Namespace) - { - indexer.Add(memberModel.Name, outputPath); - } - else - { - TreeIterator.Preorder(memberModel, null, s => s!.Items, (member, parent) => - { - if (indexer.TryGetValue(member!.Name, out var path)) - { - Logger.LogWarning($"{member.Name} already exists in {path}, the duplicate one {outputPath} will be ignored."); - } - else - { - indexer.Add(member.Name, outputPath); - } - return true; - }); - } - } - - private static void MergeMembers(Dictionary result, List items) - { - foreach (var item in items) - { - MergeNode(item); - } - - bool MergeNode(MetadataItem node) - { - if (node.Type is MemberType.Assembly) - { - foreach (var item in node.Items ?? new()) - { - MergeNode(item); - } - return false; - } - - if (!result.TryGetValue(node.Name, out var existingNode)) - { - result.Add(node.Name, node); - foreach (var item in node.Items ?? new()) - { - MergeNode(item); - } - return true; - } - - if (node.Type is MemberType.Namespace or MemberType.Class) - { - foreach (var item in node.Items ?? new()) - { - if (MergeNode(item)) - { - existingNode.Items ??= new(); - existingNode.Items.Add(item); - } - } - return false; - } - - Logger.Log(LogLevel.Warning, $"Ignore duplicated member {node.Type}:{node.Name} from {node.Source?.Path} as it already exist in {existingNode.Source?.Path}."); - return false; - } - } - - private static void MergeReferences(Dictionary result, List items) - { - foreach (var project in items) - { - if (project.References != null) - { - foreach (var pair in project.References) - { - if (!result.ContainsKey(pair.Key)) - { - result[pair.Key] = pair.Value; - } - else - { - result[pair.Key].Merge(pair.Value); - } - } - } - } - } -} diff --git a/src/Docfx.Dotnet/ExtractMetadata/ApiReferenceViewModel.cs b/src/Docfx.Dotnet/ManagedReference/ApiReferenceViewModel.cs similarity index 100% rename from src/Docfx.Dotnet/ExtractMetadata/ApiReferenceViewModel.cs rename to src/Docfx.Dotnet/ManagedReference/ApiReferenceViewModel.cs diff --git a/src/Docfx.Dotnet/ExtractMetadata/ExtractMetadataConfig.cs b/src/Docfx.Dotnet/ManagedReference/ExtractMetadataConfig.cs similarity index 100% rename from src/Docfx.Dotnet/ExtractMetadata/ExtractMetadataConfig.cs rename to src/Docfx.Dotnet/ManagedReference/ExtractMetadataConfig.cs diff --git a/src/Docfx.Dotnet/ExtractMetadata/ExtractMetadataException.cs b/src/Docfx.Dotnet/ManagedReference/ExtractMetadataException.cs similarity index 100% rename from src/Docfx.Dotnet/ExtractMetadata/ExtractMetadataException.cs rename to src/Docfx.Dotnet/ManagedReference/ExtractMetadataException.cs diff --git a/src/Docfx.Dotnet/ExtractMetadata/MetadataItem.cs b/src/Docfx.Dotnet/ManagedReference/MetadataItem.cs similarity index 100% rename from src/Docfx.Dotnet/ExtractMetadata/MetadataItem.cs rename to src/Docfx.Dotnet/ManagedReference/MetadataItem.cs diff --git a/src/Docfx.Dotnet/ExtractMetadata/MetadataModel.cs b/src/Docfx.Dotnet/ManagedReference/MetadataModel.cs similarity index 100% rename from src/Docfx.Dotnet/ExtractMetadata/MetadataModel.cs rename to src/Docfx.Dotnet/ManagedReference/MetadataModel.cs diff --git a/src/Docfx.Dotnet/ManagedReference/AdditionalNotes.cs b/src/Docfx.Dotnet/ManagedReference/Models/AdditionalNotes.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/AdditionalNotes.cs rename to src/Docfx.Dotnet/ManagedReference/Models/AdditionalNotes.cs diff --git a/src/Docfx.Dotnet/ManagedReference/ApiParameter.cs b/src/Docfx.Dotnet/ManagedReference/Models/ApiParameter.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/ApiParameter.cs rename to src/Docfx.Dotnet/ManagedReference/Models/ApiParameter.cs diff --git a/src/Docfx.Dotnet/ManagedReference/ArgumentInfo.cs b/src/Docfx.Dotnet/ManagedReference/Models/ArgumentInfo.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/ArgumentInfo.cs rename to src/Docfx.Dotnet/ManagedReference/Models/ArgumentInfo.cs diff --git a/src/Docfx.Dotnet/ManagedReference/AttributeInfo.cs b/src/Docfx.Dotnet/ManagedReference/Models/AttributeInfo.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/AttributeInfo.cs rename to src/Docfx.Dotnet/ManagedReference/Models/AttributeInfo.cs diff --git a/src/Docfx.Dotnet/ManagedReference/ExceptionInfo.cs b/src/Docfx.Dotnet/ManagedReference/Models/ExceptionInfo.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/ExceptionInfo.cs rename to src/Docfx.Dotnet/ManagedReference/Models/ExceptionInfo.cs diff --git a/src/Docfx.Dotnet/ManagedReference/ItemViewModel.cs b/src/Docfx.Dotnet/ManagedReference/Models/ItemViewModel.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/ItemViewModel.cs rename to src/Docfx.Dotnet/ManagedReference/Models/ItemViewModel.cs diff --git a/src/Docfx.Dotnet/ManagedReference/LinkInfo.cs b/src/Docfx.Dotnet/ManagedReference/Models/LinkInfo.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/LinkInfo.cs rename to src/Docfx.Dotnet/ManagedReference/Models/LinkInfo.cs diff --git a/src/Docfx.Dotnet/ManagedReference/MemberType.cs b/src/Docfx.Dotnet/ManagedReference/Models/MemberType.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/MemberType.cs rename to src/Docfx.Dotnet/ManagedReference/Models/MemberType.cs diff --git a/src/Docfx.Dotnet/ManagedReference/NamedArgumentInfo.cs b/src/Docfx.Dotnet/ManagedReference/Models/NamedArgumentInfo.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/NamedArgumentInfo.cs rename to src/Docfx.Dotnet/ManagedReference/Models/NamedArgumentInfo.cs diff --git a/src/Docfx.Dotnet/ManagedReference/PageViewModel.cs b/src/Docfx.Dotnet/ManagedReference/Models/PageViewModel.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/PageViewModel.cs rename to src/Docfx.Dotnet/ManagedReference/Models/PageViewModel.cs diff --git a/src/Docfx.Dotnet/ManagedReference/SyntaxDetailViewModel.cs b/src/Docfx.Dotnet/ManagedReference/Models/SyntaxDetailViewModel.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/SyntaxDetailViewModel.cs rename to src/Docfx.Dotnet/ManagedReference/Models/SyntaxDetailViewModel.cs diff --git a/src/Docfx.Dotnet/ManagedReference/SyntaxLanguage.cs b/src/Docfx.Dotnet/ManagedReference/Models/SyntaxLanguage.cs similarity index 100% rename from src/Docfx.Dotnet/ManagedReference/SyntaxLanguage.cs rename to src/Docfx.Dotnet/ManagedReference/Models/SyntaxLanguage.cs diff --git a/src/Docfx.Dotnet/ExtractMetadata/ReferenceItem.cs b/src/Docfx.Dotnet/ManagedReference/ReferenceItem.cs similarity index 100% rename from src/Docfx.Dotnet/ExtractMetadata/ReferenceItem.cs rename to src/Docfx.Dotnet/ManagedReference/ReferenceItem.cs diff --git a/src/Docfx.Dotnet/Resolvers/BuildMembers.cs b/src/Docfx.Dotnet/ManagedReference/Resolvers/BuildMembers.cs similarity index 100% rename from src/Docfx.Dotnet/Resolvers/BuildMembers.cs rename to src/Docfx.Dotnet/ManagedReference/Resolvers/BuildMembers.cs diff --git a/src/Docfx.Dotnet/Resolvers/BuildToc.cs b/src/Docfx.Dotnet/ManagedReference/Resolvers/BuildToc.cs similarity index 100% rename from src/Docfx.Dotnet/Resolvers/BuildToc.cs rename to src/Docfx.Dotnet/ManagedReference/Resolvers/BuildToc.cs diff --git a/src/Docfx.Dotnet/Resolvers/IResolverPipeline.cs b/src/Docfx.Dotnet/ManagedReference/Resolvers/IResolverPipeline.cs similarity index 100% rename from src/Docfx.Dotnet/Resolvers/IResolverPipeline.cs rename to src/Docfx.Dotnet/ManagedReference/Resolvers/IResolverPipeline.cs diff --git a/src/Docfx.Dotnet/Resolvers/LayoutCheckAndCleanup.cs b/src/Docfx.Dotnet/ManagedReference/Resolvers/LayoutCheckAndCleanup.cs similarity index 100% rename from src/Docfx.Dotnet/Resolvers/LayoutCheckAndCleanup.cs rename to src/Docfx.Dotnet/ManagedReference/Resolvers/LayoutCheckAndCleanup.cs diff --git a/src/Docfx.Dotnet/Resolvers/NormalizeSyntax.cs b/src/Docfx.Dotnet/ManagedReference/Resolvers/NormalizeSyntax.cs similarity index 100% rename from src/Docfx.Dotnet/Resolvers/NormalizeSyntax.cs rename to src/Docfx.Dotnet/ManagedReference/Resolvers/NormalizeSyntax.cs diff --git a/src/Docfx.Dotnet/Resolvers/ResolveReference.cs b/src/Docfx.Dotnet/ManagedReference/Resolvers/ResolveReference.cs similarity index 100% rename from src/Docfx.Dotnet/Resolvers/ResolveReference.cs rename to src/Docfx.Dotnet/ManagedReference/Resolvers/ResolveReference.cs diff --git a/src/Docfx.Dotnet/Resolvers/ResolverContext.cs b/src/Docfx.Dotnet/ManagedReference/Resolvers/ResolverContext.cs similarity index 100% rename from src/Docfx.Dotnet/Resolvers/ResolverContext.cs rename to src/Docfx.Dotnet/ManagedReference/Resolvers/ResolverContext.cs diff --git a/src/Docfx.Dotnet/Resolvers/SetDerivedClass.cs b/src/Docfx.Dotnet/ManagedReference/Resolvers/SetDerivedClass.cs similarity index 100% rename from src/Docfx.Dotnet/Resolvers/SetDerivedClass.cs rename to src/Docfx.Dotnet/ManagedReference/Resolvers/SetDerivedClass.cs diff --git a/src/Docfx.Dotnet/Resolvers/SetParent.cs b/src/Docfx.Dotnet/ManagedReference/Resolvers/SetParent.cs similarity index 100% rename from src/Docfx.Dotnet/Resolvers/SetParent.cs rename to src/Docfx.Dotnet/ManagedReference/Resolvers/SetParent.cs diff --git a/src/Docfx.Dotnet/Resolvers/YamlMetadataResolver.cs b/src/Docfx.Dotnet/ManagedReference/Resolvers/YamlMetadataResolver.cs similarity index 100% rename from src/Docfx.Dotnet/Resolvers/YamlMetadataResolver.cs rename to src/Docfx.Dotnet/ManagedReference/Resolvers/YamlMetadataResolver.cs diff --git a/src/Docfx.Dotnet/ExtractMetadata/SyntaxDetail.cs b/src/Docfx.Dotnet/ManagedReference/SyntaxDetail.cs similarity index 100% rename from src/Docfx.Dotnet/ExtractMetadata/SyntaxDetail.cs rename to src/Docfx.Dotnet/ManagedReference/SyntaxDetail.cs diff --git a/src/Docfx.Dotnet/Visitors/SpecIdCoreVisitor.cs b/src/Docfx.Dotnet/ManagedReference/Visitors/SpecIdCoreVisitor.cs similarity index 100% rename from src/Docfx.Dotnet/Visitors/SpecIdCoreVisitor.cs rename to src/Docfx.Dotnet/ManagedReference/Visitors/SpecIdCoreVisitor.cs diff --git a/src/Docfx.Dotnet/Visitors/SpecIdHelper.cs b/src/Docfx.Dotnet/ManagedReference/Visitors/SpecIdHelper.cs similarity index 100% rename from src/Docfx.Dotnet/Visitors/SpecIdHelper.cs rename to src/Docfx.Dotnet/ManagedReference/Visitors/SpecIdHelper.cs diff --git a/src/Docfx.Dotnet/Visitors/SymbolVisitorAdapter.cs b/src/Docfx.Dotnet/ManagedReference/Visitors/SymbolVisitorAdapter.cs similarity index 100% rename from src/Docfx.Dotnet/Visitors/SymbolVisitorAdapter.cs rename to src/Docfx.Dotnet/ManagedReference/Visitors/SymbolVisitorAdapter.cs diff --git a/src/Docfx.Dotnet/Visitors/TypeGenericParameterNameVisitor.cs b/src/Docfx.Dotnet/ManagedReference/Visitors/TypeGenericParameterNameVisitor.cs similarity index 100% rename from src/Docfx.Dotnet/Visitors/TypeGenericParameterNameVisitor.cs rename to src/Docfx.Dotnet/ManagedReference/Visitors/TypeGenericParameterNameVisitor.cs diff --git a/src/Docfx.Dotnet/Visitors/VisitorHelper.cs b/src/Docfx.Dotnet/ManagedReference/Visitors/VisitorHelper.cs similarity index 100% rename from src/Docfx.Dotnet/Visitors/VisitorHelper.cs rename to src/Docfx.Dotnet/ManagedReference/Visitors/VisitorHelper.cs diff --git a/src/Docfx.Dotnet/Visitors/YamlModelGenerator.cs b/src/Docfx.Dotnet/ManagedReference/Visitors/YamlModelGenerator.cs similarity index 100% rename from src/Docfx.Dotnet/Visitors/YamlModelGenerator.cs rename to src/Docfx.Dotnet/ManagedReference/Visitors/YamlModelGenerator.cs diff --git a/src/Docfx.Dotnet/MarkdownFormatter.cs b/src/Docfx.Dotnet/MarkdownFormatter.cs deleted file mode 100644 index 66cc03f0727..00000000000 --- a/src/Docfx.Dotnet/MarkdownFormatter.cs +++ /dev/null @@ -1,922 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections.Concurrent; -using System.Text; -using System.Text.RegularExpressions; -using Docfx.Common; -using Docfx.DataContracts.ManagedReference; -using Docfx.Plugins; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Shared.Extensions; - -#nullable enable - -namespace Docfx.Dotnet; - -static class MarkdownFormatter -{ - enum TocNodeType - { - None, - Namespace, - Class, - Struct, - Interface, - Enum, - Delegate, - Constructor, - Field, - Property, - Method, - Event, - Operator, - } - - class TocNode - { - public string name { get; init; } = ""; - public string? href { get; init; } - public List? items { get; set; } - - internal TocNodeType type; - internal string? id; - internal bool containsLeafNodes; - internal List<(ISymbol symbol, Compilation compilation)> symbols = new(); - } - - public static void Save(List<(IAssemblySymbol symbol, Compilation compilation)> assemblies, ExtractMetadataConfig config, DotnetApiOptions options) - { - Logger.LogWarning($"Markdown output format is experimental."); - - Directory.CreateDirectory(config.OutputFolder); - - var filter = new SymbolFilter(config, options); - var extensionMethods = assemblies.SelectMany(assembly => assembly.symbol.FindExtensionMethods(filter)).ToArray(); - var allAssemblies = new HashSet(assemblies.Select(a => a.symbol), SymbolEqualityComparer.Default); - var commentCache = new ConcurrentDictionary(SymbolEqualityComparer.Default); - - var tocNodes = new Dictionary(); - var allSymbols = new List<(ISymbol symbol, Compilation compilation)>(); - var toc = assemblies.SelectMany(a => CreateToc(a.symbol.GlobalNamespace, a.compilation)).ToList(); - - allSymbols.Sort((a, b) => a.symbol.Name.CompareTo(b.symbol.Name)); - SortToc(toc, root: true); - - YamlUtility.Serialize(Path.Combine(config.OutputFolder, "toc.yml"), toc, YamlMime.TableOfContent); - Parallel.ForEach(EnumerateToc(toc), n => SaveTocNode(n.id, n.symbols)); - - Logger.LogInfo($"Export succeed: {EnumerateToc(toc).Count()} items"); - - IEnumerable CreateToc(ISymbol symbol, Compilation compilation) - { - if (!filter.IncludeApi(symbol)) - yield break; - - switch (symbol) - { - case INamespaceSymbol ns when ns.IsGlobalNamespace: - foreach (var child in ns.GetNamespaceMembers()) - foreach (var item in CreateToc(child, compilation)) - yield return item; - break; - - case INamespaceSymbol ns: - foreach (var item in CreateNamespaceToc(ns)) - yield return item; - break; - - case INamedTypeSymbol type: - foreach (var item in CreateNamedTypeToc(type)) - yield return item; - break; - - case IFieldSymbol or IPropertySymbol or IMethodSymbol or IEventSymbol: - foreach (var item in CreateMemberToc(symbol)) - yield return item; - break; - - default: - throw new NotSupportedException($"Unknown symbol {symbol}"); - } - - IEnumerable CreateNamespaceToc(INamespaceSymbol ns) - { - var idExists = true; - var id = VisitorHelper.PathFriendlyId(VisitorHelper.GetId(symbol)); - if (!tocNodes.TryGetValue(id, out var node)) - { - idExists = false; - tocNodes.Add(id, node = new() - { - id = id, - name = config.NamespaceLayout is NamespaceLayout.Nested ? symbol.Name : symbol.ToString() ?? "", - href = $"{id}.md", - type = TocNodeType.Namespace, - }); - } - - node.items ??= new(); - node.symbols.Add((symbol, compilation)); - allSymbols.Add((symbol, compilation)); - - foreach (var child in ns.GetNamespaceMembers()) - { - if (config.NamespaceLayout is NamespaceLayout.Flattened) - foreach (var item in CreateToc(child, compilation)) - yield return item; - else if (config.NamespaceLayout is NamespaceLayout.Nested) - node.items.AddRange(CreateToc(child, compilation)); - } - - foreach (var child in ns.GetTypeMembers()) - { - node.items.AddRange(CreateToc(child, compilation)); - } - - node.containsLeafNodes = node.items.Any(i => i.containsLeafNodes); - if (!idExists && node.containsLeafNodes) - { - yield return node; - } - } - - IEnumerable CreateNamedTypeToc(INamedTypeSymbol type) - { - var idExists = true; - var id = VisitorHelper.PathFriendlyId(VisitorHelper.GetId(symbol)); - if (!tocNodes.TryGetValue(id, out var node)) - { - idExists = false; - tocNodes.Add(id, node = new() - { - id = id, - name = SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp), - href = $"{id}.md", - containsLeafNodes = true, - type = type.TypeKind switch - { - TypeKind.Class => TocNodeType.Class, - TypeKind.Interface => TocNodeType.Interface, - TypeKind.Struct => TocNodeType.Struct, - TypeKind.Delegate => TocNodeType.Delegate, - TypeKind.Enum => TocNodeType.Enum, - _ => throw new NotSupportedException($"Unknown type kind {type.TypeKind}"), - } - }); - } - - foreach (var child in type.GetTypeMembers()) - { - foreach (var item in CreateToc(child, compilation)) - yield return item; - } - - if (config.MemberLayout is MemberLayout.SeparatePages && type.TypeKind is TypeKind.Class or TypeKind.Interface or TypeKind.Struct) - { - node.items ??= new(); - foreach (var member in type.GetMembers()) - node.items.AddRange(CreateToc(member, compilation)); - } - - node.symbols.Add((symbol, compilation)); - allSymbols.Add((symbol, compilation)); - - if (!idExists) - { - yield return node; - } - } - - IEnumerable CreateMemberToc(ISymbol symbol) - { - var type = symbol switch - { - IPropertySymbol => TocNodeType.Property, - IFieldSymbol => TocNodeType.Field, - IEventSymbol => TocNodeType.Event, - IMethodSymbol method when SymbolHelper.IsConstructor(method) => TocNodeType.Constructor, - IMethodSymbol method when SymbolHelper.IsMethod(method) => TocNodeType.Method, - IMethodSymbol method when SymbolHelper.IsOperator(method) => TocNodeType.Operator, - _ => TocNodeType.None, - }; - - if (type is TocNodeType.None) - yield break; - - var id = VisitorHelper.PathFriendlyId(VisitorHelper.GetOverloadId(symbol)); - if (!tocNodes.TryGetValue(id, out var node)) - { - tocNodes.Add(id, node = new() - { - id = id, - name = SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp, overload: true), - href = $"{id}.md", - containsLeafNodes = true, - type = type, - }); - yield return node; - } - - node.symbols.Add((symbol, compilation)); - } - } - - static void SortToc(List items, bool root) - { - items.Sort((a, b) => a.type.CompareTo(b.type) is var r && r is 0 ? a.name.CompareTo(b.name) : r); - - if (!root) - { - InsertCategory(TocNodeType.Class, "Classes"); - InsertCategory(TocNodeType.Struct, "Structs"); - InsertCategory(TocNodeType.Interface, "Interfaces"); - InsertCategory(TocNodeType.Enum, "Enums"); - InsertCategory(TocNodeType.Delegate, "Delegates"); - InsertCategory(TocNodeType.Constructor, "Constructors"); - InsertCategory(TocNodeType.Field, "Fields"); - InsertCategory(TocNodeType.Property, "Properties"); - InsertCategory(TocNodeType.Method, "Methods"); - InsertCategory(TocNodeType.Event, "Events"); - InsertCategory(TocNodeType.Operator, "Operators"); - } - - foreach (var item in items) - { - if (item.items is not null) - SortToc(item.items, root: false); - } - - void InsertCategory(TocNodeType type, string name) - { - if (items.FirstOrDefault(i => i.type == type) is { } node) - items.Insert(items.IndexOf(node), new() { name = name }); - } - } - - static IEnumerable<(string id, List<(ISymbol symbol, Compilation compilation)> symbols)> EnumerateToc(List items) - { - foreach (var item in items) - { - if (item.items is not null) - foreach (var i in EnumerateToc(item.items)) - yield return i; - - if (item.id is not null && item.symbols.Count > 0) - yield return (item.id, item.symbols); - } - } - - void SaveTocNode(string id, List<(ISymbol symbol, Compilation compilation)> symbols) - { - var sb = new StringBuilder(); - var symbol = symbols[0].symbol; - var compilation = symbols[0].compilation; - var comment = Comment(symbol, compilation); - - switch (symbols[0].symbol) - { - case INamespaceSymbol ns: - Namespace(); - break; - - case INamedTypeSymbol type: - switch (type.TypeKind) - { - case TypeKind.Enum: Enum(type); break; - case TypeKind.Delegate: Delegate(type); break; - case TypeKind.Interface or TypeKind.Structure or TypeKind.Class: ClassLike(type); break; - default: throw new NotSupportedException($"Unknown symbol type kind {type.TypeKind}"); - } - break; - - case IFieldSymbol: - MemberHeader("Field"); - foreach (var (s, c) in symbols) - Field((IFieldSymbol)s, c, "##"); - break; - - case IPropertySymbol: - MemberHeader("Property"); - foreach (var (s, c) in symbols) - Property((IPropertySymbol)s, c, "##"); - break; - - case IEventSymbol: - MemberHeader("Event"); - foreach (var (s, c) in symbols) - Event((IEventSymbol)s, c, "##"); - break; - - case IMethodSymbol method: - MemberHeader(method switch - { - _ when SymbolHelper.IsConstructor(method) => "Constructor", - _ when SymbolHelper.IsOperator(method) => "Operator", - _ when SymbolHelper.IsMember(method) => "Method", - _ => throw new NotSupportedException($"Unknown method type {method.MethodKind}"), - }); ; - foreach (var (s, c) in symbols) - Method((IMethodSymbol)s, c, "##"); - break; - - default: - throw new NotSupportedException($"Unknown symbol type kind {symbols[0].symbol}"); - } - - File.WriteAllText(Path.Combine(config.OutputFolder, $"{id}.md"), sb.ToString()); - - void Namespace() - { - var namespaceSymbols = symbols.Select(n => n.symbol).ToHashSet(SymbolEqualityComparer.Default); - var types = ( - from s in allSymbols - where s.symbol.Kind is SymbolKind.NamedType && namespaceSymbols.Contains(s.symbol.ContainingNamespace) - select (symbol: (INamedTypeSymbol)s.symbol, s.compilation)).ToList(); - - sb.AppendLine($"# Namespace {Escape(symbol.ToString()!)}").AppendLine(); - - Summary(comment); - Namespaces(); - Types(t => t.TypeKind is TypeKind.Class, "Classes"); - Types(t => t.TypeKind is TypeKind.Struct, "Structs"); - Types(t => t.TypeKind is TypeKind.Interface, "Interfaces"); - Types(t => t.TypeKind is TypeKind.Enum, "Enums"); - Types(t => t.TypeKind is TypeKind.Delegate, "Delegates"); - - File.WriteAllText(Path.Combine(config.OutputFolder, $"{id}.md"), sb.ToString()); - - void Namespaces() - { - var items = symbols - .SelectMany(n => ((INamespaceSymbol)n.symbol).GetNamespaceMembers().Select(symbol => (symbol, n.compilation))) - .DistinctBy(n => n.symbol.Name) - .OrderBy(n => n.symbol.Name) - .ToList(); - - if (items.Count is 0) - return; - - sb.AppendLine($"### Namespaces").AppendLine(); - - foreach (var (symbol, compilation) in items) - { - sb.AppendLine(ShortLink(symbol, compilation)).AppendLine(); - var comment = Comment(symbol, compilation); - if (!string.IsNullOrEmpty(comment?.Summary)) - sb.AppendLine(comment.Summary).AppendLine(); - } - } - - void Types(Func predicate, string headingText) - { - var items = types.Where(t => predicate(t.symbol)).ToList(); - if (items.Count == 0) - return; - - sb.AppendLine($"### {headingText}").AppendLine(); - - foreach (var (symbol, compilation) in items) - { - sb.AppendLine(ShortLink(symbol, compilation)).AppendLine(); - var comment = Comment(symbol, compilation); - if (!string.IsNullOrEmpty(comment?.Summary)) - sb.AppendLine(comment.Summary).AppendLine(); - } - } - } - - void Enum(INamedTypeSymbol type) - { - sb.AppendLine($"# Enum {Escape(SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp))}").AppendLine(); - - Info(); - Summary(comment); - Syntax(symbol); - - ExtensionMethods(type); - - EnumFields(type); - - Examples(comment); - Remarks(comment); - SeeAlsos(comment); - } - - void Delegate(INamedTypeSymbol type) - { - sb.AppendLine($"# Delegate {Escape(SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp))}").AppendLine(); - - Info(); - Summary(comment); - Syntax(symbol); - - var invokeMethod = type.DelegateInvokeMethod!; - Parameters(invokeMethod, comment); - Returns(invokeMethod, comment); - TypeParameters(invokeMethod.ContainingType, comment); - - ExtensionMethods(type); - - Examples(comment); - Remarks(comment); - SeeAlsos(comment); - } - - void ClassLike(INamedTypeSymbol type) - { - var typeHeader = type.TypeKind switch - { - TypeKind.Interface => "Interface", - TypeKind.Class => "Class", - TypeKind.Struct => "Struct", - _ => throw new InvalidOperationException(), - }; - - sb.AppendLine($"# {typeHeader} {Escape(SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp))}").AppendLine(); - - Info(); - Summary(comment); - Syntax(symbol); - - TypeParameters(symbol, comment); - Inheritance(); - Derived(); - Implements(); - InheritedMembers(); - ExtensionMethods(type); - - Examples(comment); - Remarks(comment); - - Methods(SymbolHelper.IsConstructor, "Constructors"); - Fields(); - Properties(); - Methods(SymbolHelper.IsMethod, "Methods"); - Events(); - Methods(SymbolHelper.IsOperator, "Operators"); - - SeeAlsos(comment); - - void Fields() - { - var items = ( - from s in symbols - from symbol in ((INamedTypeSymbol)s.symbol).GetMembers().OfType() - where filter.IncludeApi(symbol) - orderby symbol.Name - select (symbol, s.compilation)).ToList(); - - if (items.Count is 0) - return; - - sb.AppendLine($"## Fields").AppendLine(); - - if (config.MemberLayout is MemberLayout.SeparatePages) - { - MemberSummaryList(items); - return; - } - - foreach (var (s, c) in items) - Field(s, c, "###"); - } - - void Properties() - { - var items = ( - from s in symbols - from symbol in ((INamedTypeSymbol)s.symbol).GetMembers().OfType() - where filter.IncludeApi(symbol) - orderby symbol.Name - select (symbol, s.compilation)).ToList(); - - if (items.Count is 0) - return; - - sb.AppendLine($"## Properties").AppendLine(); - - if (config.MemberLayout is MemberLayout.SeparatePages) - { - MemberSummaryList(items); - return; - } - - foreach (var (s, c) in items) - Property(s, c, "###"); - } - - void Methods(Func predicate, string headingText) - { - var items = ( - from s in symbols - from symbol in ((INamedTypeSymbol)s.symbol).GetMembers().OfType() - where filter.IncludeApi(symbol) && predicate(symbol) - orderby symbol.Name - select (symbol, s.compilation)).ToList(); - - if (items.Count is 0) - return; - - sb.AppendLine($"## {headingText}").AppendLine(); - - if (config.MemberLayout is MemberLayout.SeparatePages) - { - MemberSummaryList(items); - return; - } - - foreach (var (s, c) in items) - Method(s, c, "###"); - } - - void Events() - { - var items = ( - from s in symbols - from symbol in ((INamedTypeSymbol)s.symbol).GetMembers().OfType() - where filter.IncludeApi(symbol) - orderby symbol.Name - select (symbol, s.compilation)).ToList(); - - if (items.Count is 0) - return; - - if (config.MemberLayout is MemberLayout.SeparatePages) - { - MemberSummaryList(items); - return; - } - - foreach (var (s, c) in items) - Event(s, c, "###"); - } - - void MemberSummaryList(IEnumerable<(T, Compilation)> symbols) where T : ISymbol - { - foreach (var (s, c) in symbols) - { - sb.AppendLine(NameOnlyLink(s, c)).AppendLine(); - Summary(Comment(s, c)); - } - } - - void Inheritance() - { - var items = new List(); - for (var i = type; i is not null && i.SpecialType is not SpecialType.System_ValueType; i = i.BaseType) - items.Add(i); - - if (items.Count <= 1) - return; - - items.Reverse(); - sb.AppendLine($"###### Inheritance"); - List(" \u2190 ", items); - } - - void Derived() - { - var items = ( - from s in allSymbols - where s.symbol.Kind is SymbolKind.NamedType && SymbolEqualityComparer.Default.Equals(((INamedTypeSymbol)s.symbol).BaseType, symbol) - select s.symbol).ToList(); - - if (items.Count is 0) - return; - - sb.AppendLine($"###### Derived"); - List(", ", items); - } - - void Implements() - { - var items = type.AllInterfaces.Where(filter.IncludeApi).ToList(); - if (items.Count is 0) - return; - - sb.AppendLine($"###### Implements"); - List(", ", items); - } - - void InheritedMembers() - { - var items = type.GetInheritedMembers(filter).ToList(); - if (items.Count is 0) - return; - - sb.AppendLine($"###### Inherited Members"); - List(", ", items); - } - } - - void MemberHeader(string headingText) - { - sb.AppendLine($"# {headingText} {Escape(SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp, overload: true))}").AppendLine(); - Info(); - } - - void ExtensionMethods(INamedTypeSymbol type) - { - var items = extensionMethods - .Where(m => m.Language == symbol.Language) - .Select(m => m.ReduceExtensionMethod(type)) - .OfType() - .OrderBy(i => i.Name) - .ToList(); - - if (items.Count is 0) - return; - - sb.AppendLine($"###### Extension Methods"); - List(", ", items); - } - - void List(string separator, IEnumerable items) - { - sb.AppendLine(string.Join(separator, items.Select(i => "\n" + ShortLink(i, compilation)))).AppendLine(); - } - - void Parameters(ISymbol symbol, XmlComment? comment, string heading = "##") - { - var parameters = symbol.GetParameters(); - if (!parameters.Any()) - return; - - sb.AppendLine($"{heading} Parameters").AppendLine(); - - foreach (var param in parameters) - { - sb.AppendLine($"`{Escape(param.Name)}` {FullLink(param.Type, compilation)}").AppendLine(); - - if (comment?.Parameters?.TryGetValue(param.Name, out var value) ?? false) - sb.AppendLine($"{value}").AppendLine(); - } - } - - void Returns(IMethodSymbol symbol, XmlComment? comment, string heading = "##") - { - if (symbol.ReturnType is null || symbol.ReturnType.SpecialType is SpecialType.System_Void) - return; - - sb.AppendLine($"{heading} Returns").AppendLine(); - sb.AppendLine(FullLink(symbol.ReturnType, compilation)).AppendLine(); - - if (!string.IsNullOrEmpty(comment?.Returns)) - sb.AppendLine($"{comment.Returns}").AppendLine(); - } - - void TypeParameters(ISymbol symbol, XmlComment? comment, string heading = "##") - { - if (symbol.GetTypeParameters() is { } typeParameters && typeParameters.Length is 0) - return; - - sb.AppendLine($"{heading} Type Parameters").AppendLine(); - - foreach (var param in typeParameters) - { - sb.AppendLine($"`{Escape(param.Name)}`").AppendLine(); - - if (comment?.TypeParameters?.TryGetValue(param.Name, out var value) ?? false) - sb.AppendLine($"{value}").AppendLine(); - } - } - - void Method(IMethodSymbol symbol, Compilation compilation, string heading) - { - var fragment = Regex.Replace(VisitorHelper.GetId(symbol), @"\W", "_"); - sb.AppendLine($"{heading} {Escape(SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp))}").AppendLine(); - - var comment = Comment(symbol, compilation); - Summary(comment); - Syntax(symbol); - - Parameters(symbol, comment, $"{heading}#"); - Returns(symbol, comment, $"{heading}#"); - TypeParameters(symbol, comment, $"{heading}#"); - - Examples(comment, $"{heading}#"); - Remarks(comment, $"{heading}#"); - Exceptions(comment, $"{heading}#"); - SeeAlsos(comment, $"{heading}#"); - } - - void Field(IFieldSymbol symbol, Compilation compilation, string heading) - { - var fragment = Regex.Replace(VisitorHelper.GetId(symbol), @"\W", "_"); - sb.AppendLine($"{heading} {Escape(SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp))}").AppendLine(); - - var comment = Comment(symbol, compilation); - Summary(comment); - Syntax(symbol); - - sb.AppendLine($"{heading}# Field Value").AppendLine(); - sb.AppendLine(FullLink(symbol.Type, compilation)).AppendLine(); - - Examples(comment, $"{heading}#"); - Remarks(comment, $"{heading}#"); - Exceptions(comment, $"{heading}#"); - SeeAlsos(comment, $"{heading}#"); - } - - void Property(IPropertySymbol symbol, Compilation compilation, string heading) - { - var fragment = Regex.Replace(VisitorHelper.GetId(symbol), @"\W", "_"); - sb.AppendLine($"{heading} {Escape(SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp))}").AppendLine(); - - var comment = Comment(symbol, compilation); - Summary(comment); - Syntax(symbol); - - sb.AppendLine($"{heading}# Property Value").AppendLine(); - sb.AppendLine(FullLink(symbol.Type, compilation)).AppendLine(); - - Examples(comment, $"{heading}#"); - Remarks(comment, $"{heading}#"); - Exceptions(comment, $"{heading}#"); - SeeAlsos(comment, $"{heading}#"); - } - - void Event(IEventSymbol symbol, Compilation compilation, string heading) - { - var fragment = Regex.Replace(VisitorHelper.GetId(symbol), @"\W", "_"); - sb.AppendLine($"{heading} {Escape(SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp))}").AppendLine(); - - var comment = Comment(symbol, compilation); - Summary(comment); - Syntax(symbol); - - sb.AppendLine($"{heading}# Event Type").AppendLine(); - sb.AppendLine(FullLink(symbol.Type, compilation)).AppendLine(); - - Examples(comment, $"{heading}#"); - Remarks(comment, $"{heading}#"); - Exceptions(comment, $"{heading}#"); - SeeAlsos(comment, $"{heading}#"); - } - - void EnumFields(INamedTypeSymbol type) - { - var items = type.GetMembers().OfType().Where(filter.IncludeApi).ToList(); - if (!items.Any()) - return; - - if (config.EnumSortOrder is EnumSortOrder.Alphabetic) - items = items.OrderBy(m => m.Name).ToList(); - - sb.AppendLine($"## Fields").AppendLine(); - - foreach (var item in items) - { - sb.AppendLine($"### `{Escape(item.Name)} = {item.ConstantValue}`").AppendLine(); - - if (Comment(item, compilation) is { } comment) - sb.AppendLine($"{Escape(comment.Summary)}").AppendLine(); - } - } - - void Info() - { - sb.AppendLine($"Namespace: {ShortLink(symbol.ContainingNamespace, compilation)} "); - - var assemblies = symbols.Select(s => s.symbol.ContainingAssembly.Name).Where(n => n != "?").Distinct().Select(n => $"{n}.dll").ToList(); - if (assemblies.Count > 0) - sb.AppendLine($"Assembly: {string.Join(", ", assemblies)}").AppendLine(); - } - - void Summary(XmlComment? comment) - { - if (!string.IsNullOrEmpty(comment?.Summary)) - sb.AppendLine(comment.Summary).AppendLine(); - } - - void Syntax(ISymbol symbol) - { - var syntax = SymbolFormatter.GetSyntax(symbol, SyntaxLanguage.CSharp, filter); - sb.AppendLine("```csharp").AppendLine(syntax).AppendLine("```").AppendLine(); - } - - void Examples(XmlComment? comment, string heading = "##") - { - if (comment?.Examples?.Count > 0) - { - sb.AppendLine($"{heading} Examples").AppendLine(); - - foreach (var example in comment.Examples) - sb.AppendLine(example).AppendLine(); - } - } - - void Remarks(XmlComment? comment, string heading = "##") - { - if (!string.IsNullOrEmpty(comment?.Remarks)) - { - sb.AppendLine($"{heading} Remarks").AppendLine(); - sb.AppendLine(comment.Remarks).AppendLine(); - } - } - - void Exceptions(XmlComment? comment, string heading = "##") - { - if (comment?.Exceptions?.Count > 0) - { - sb.AppendLine($"{heading} Exceptions").AppendLine(); - - foreach (var exception in comment.Exceptions) - { - sb.AppendLine(Cref(exception.CommentId)).AppendLine(); - sb.AppendLine(exception.Description).AppendLine(); - } - } - } - - void SeeAlsos(XmlComment? comment, string heading = "##") - { - if (comment?.SeeAlsos?.Count > 0) - { - sb.AppendLine($"{heading} See Also").AppendLine(); - - foreach (var seealso in comment.SeeAlsos) - { - var content = seealso.LinkType switch - { - LinkType.CRef => Cref(seealso.CommentId), - LinkType.HRef => $"<{Escape(seealso.LinkId)}>", - _ => throw new NotSupportedException($"{seealso.LinkType}"), - }; - sb.AppendLine(content).AppendLine(); - } - } - } - - string Cref(string commentId) - { - return DocumentationCommentId.GetFirstSymbolForDeclarationId(commentId, compilation) is { } symbol ? FullLink(symbol, compilation) : ""; - } - } - - string ShortLink(ISymbol symbol, Compilation compilation) - { - var title = SymbolFormatter.GetNameWithType(symbol, SyntaxLanguage.CSharp); - var url = SymbolUrlResolver.GetSymbolUrl(symbol, compilation, config.MemberLayout, SymbolUrlKind.Markdown, allAssemblies); - return string.IsNullOrEmpty(url) ? Escape(title) : $"[{Escape(title)}]({Escape(url)})"; - } - - string FullLink(ISymbol symbol, Compilation compilation) - { - var parts = SymbolFormatter.GetNameWithTypeParts(symbol, SyntaxLanguage.CSharp); - var linkItems = SymbolFormatter.ToLinkItems(parts, compilation, config.MemberLayout, allAssemblies, overload: false, SymbolUrlKind.Markdown); - - return string.Concat(linkItems.Select(i => - string.IsNullOrEmpty(i.Href) ? Escape(i.DisplayName) : $"[{Escape(i.DisplayName)}]({Escape(i.Href)})")); - } - - string NameOnlyLink(ISymbol symbol, Compilation compilation) - { - var title = SymbolFormatter.GetName(symbol, SyntaxLanguage.CSharp); - var url = SymbolUrlResolver.GetSymbolUrl(symbol, compilation, config.MemberLayout, SymbolUrlKind.Markdown, allAssemblies); - return string.IsNullOrEmpty(url) ? Escape(title) : $"[{Escape(title)}]({Escape(url)})"; - } - - XmlComment? Comment(ISymbol symbol, Compilation compilation) - { - // Cache XML comment to avoid duplicated parsing and warnings - return commentCache.GetOrAdd(symbol, symbol => - { - var src = VisitorHelper.GetSourceDetail(symbol, compilation); - var context = new XmlCommentParserContext - { - SkipMarkup = config.ShouldSkipMarkup, - AddReferenceDelegate = (a, b) => { }, - Source = src, - ResolveCode = ResolveCode, - }; - - var comment = symbol.GetDocumentationComment(compilation, expandIncludes: true, expandInheritdoc: true); - return XmlComment.Parse(comment.FullXmlFragment, context); - - string? ResolveCode(string source) - { - var basePath = config.CodeSourceBasePath ?? ( - src?.Path is { } sourcePath - ? Path.GetDirectoryName(Path.GetFullPath(Path.Combine(EnvironmentContext.BaseDirectory, sourcePath))) - : null); - - var path = Path.GetFullPath(Path.Combine(basePath ?? "", source)); - if (!File.Exists(path)) - { - Logger.LogWarning($"Source file '{path}' not found."); - return null; - } - - return File.ReadAllText(path); - } - }); - } - - static string Escape(string text) - { - return text; - } - } -} diff --git a/src/Docfx.Dotnet/MetadataJsonConfig.cs b/src/Docfx.Dotnet/MetadataJsonConfig.cs index ca1b5c31cd5..b5d78a31d72 100644 --- a/src/Docfx.Dotnet/MetadataJsonConfig.cs +++ b/src/Docfx.Dotnet/MetadataJsonConfig.cs @@ -61,7 +61,7 @@ internal enum MetadataOutputFormat /// /// Output as ManagedReference YAML files /// - MrefYaml, + Mref, /// /// Output as common-mark compliant markdown file diff --git a/src/Docfx.Dotnet/PageWriter.cs b/src/Docfx.Dotnet/PageWriter.cs new file mode 100644 index 00000000000..1fcd0b39376 --- /dev/null +++ b/src/Docfx.Dotnet/PageWriter.cs @@ -0,0 +1,162 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#nullable enable + +using System.Text; + +namespace Docfx.Dotnet; + +enum ListDelimiter +{ + Comma, + NewLine, + LeftArrow, +} + +readonly record struct TextSpan(string text, string? href = null); +readonly record struct Fact(string name, TextSpan[] value); + +class Parameter +{ + public string? name { get; init; } + public TextSpan[]? type { get; init; } + public string? defaultValue { get; init; } + public string? docs { get; init; } +} + +abstract class PageWriter +{ + public abstract void Heading(int level, string title, string? id = null); + public abstract void Facts(params Fact[] facts); + public abstract void Markdown(string markdown); + public abstract void ParameterList(params Parameter[] parameters); + public abstract void List(ListDelimiter delimiter, params TextSpan[][] items); + public abstract void Declaration(string syntax, string? language = null); + public abstract void End(); +} + +class MarkdownWriter : PageWriter +{ + private string _path = default!; + private readonly StringBuilder _sb = new(); + + public static MarkdownWriter Create(string outuputFolder, string id) + { + return new() { _path = Path.Combine(outuputFolder, $"{id}.md") }; + } + + public override void End() + { + File.WriteAllText(_path, _sb.ToString()); + } + + public override void Declaration(string syntax, string? language = null) + { + _sb.AppendLine($"```{language}").AppendLine(syntax).AppendLine("```").AppendLine(); + } + + public override void Heading(int level, string title, string? id = null) + { + _sb.Append($"{new string('#', level)} "); + if (!string.IsNullOrEmpty(id)) + _sb.Append($""); + _sb.AppendLine(Escape(title)).AppendLine(); + } + + public override void Facts(params Fact[] facts) + { + for (var i = 0; i < facts.Length; i++) + { + var item = facts[i]; + _sb.Append(Escape(item.name)).Append(": "); + Text(item.value); + _sb.AppendLine(i == facts.Length - 1 ? "" : " "); + } + _sb.AppendLine(); + } + + public override void List(ListDelimiter delimiter, params TextSpan[][] items) + { + for (var i = 0; i < items.Length - 1; i++) + { + Text(items[i]); + _sb.AppendLine(delimiter switch + { + ListDelimiter.LeftArrow => " \u2190 ", + ListDelimiter.Comma => ", ", + ListDelimiter.NewLine => " ", + _ => throw new NotSupportedException($"Unknown delimiter {delimiter}"), + }); + } + + Text(items[^1]); + _sb.AppendLine().AppendLine(); + } + + public override void Markdown(string markdown) + { + _sb.AppendLine(markdown).AppendLine(); + } + + public override void ParameterList(params Parameter[] parameters) + { + foreach (var param in parameters) + { + if (!string.IsNullOrEmpty(param.name)) + { + _sb.Append('`').Append(Escape(param.name)); + if (!string.IsNullOrEmpty(param.defaultValue)) + _sb.Append(" = ").Append(Escape(param.defaultValue)); + _sb.Append("` "); + } + + if (param.type != null) + Text(param.type); + + _sb.AppendLine().AppendLine(); + + if (!string.IsNullOrEmpty(param.docs)) + _sb.AppendLine(param.docs).AppendLine(); + } + } + + private void Text(params TextSpan[] spans) + { + foreach (var span in spans) + { + if (string.IsNullOrEmpty(span.href)) + _sb.Append(Escape(span.text)); + else + _sb.Append($"[{Escape(span.text)}]({Escape(span.href)})"); + } + } + + private string Escape(string text) + { + const string EscapeChars = "\\`*_{}[]()#+-!>~\"'"; + + var needEscape = false; + foreach (var c in text) + { + if (EscapeChars.Contains(c)) + { + needEscape = true; + break; + } + } + + if (!needEscape) + return text; + + var sb = new StringBuilder(); + foreach (var c in text) + { + if (EscapeChars.Contains(c)) + sb.Append('\\'); + sb.Append(c); + } + + return sb.ToString(); + } +} diff --git a/test/Docfx.Dotnet.Tests/SymbolUrlResolverUnitTest.cs b/test/Docfx.Dotnet.Tests/SymbolUrlResolverUnitTest.cs index d5d27a04e70..9a6bb24bb6e 100644 --- a/test/Docfx.Dotnet.Tests/SymbolUrlResolverUnitTest.cs +++ b/test/Docfx.Dotnet.Tests/SymbolUrlResolverUnitTest.cs @@ -85,13 +85,13 @@ public static void GetPdbSourceLinkUrlTest() Assert.NotNull(type); var compilationLink = ReplaceSHA(SymbolUrlResolver.GetPdbSourceLinkUrl(compilation, type)); Assert.True(compilationLink?.StartsWith("https://github.com/")); - Assert.True(compilationLink?.EndsWith("/blob/*/src/Docfx.Dotnet/DotnetApiCatalog.cs")); + Assert.True(compilationLink?.EndsWith(".cs")); var method = type.GetMembers(nameof(DotnetApiCatalog.GenerateManagedReferenceYamlFiles)).FirstOrDefault(); Assert.NotNull(method); var methodLink = ReplaceSHA(SymbolUrlResolver.GetPdbSourceLinkUrl(compilation, method)); Assert.True(compilationLink?.StartsWith("https://github.com/")); - Assert.True(compilationLink?.EndsWith("/blob/*/src/Docfx.Dotnet/DotnetApiCatalog.cs")); + Assert.True(compilationLink?.EndsWith(".cs")); static string ReplaceSHA(string value) { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/index.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/index.verified.json index 26de2a18f65..bd0d53fc74e 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/index.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/index.verified.json @@ -297,7 +297,7 @@ "md/BuildFromProject.Class1.IIssue8948.html": { "href": "md/BuildFromProject.Class1.IIssue8948.html", "title": "Interface Class1.IIssue8948 | docfx seed website", - "keywords": "Interface Class1.IIssue8948 Namespace: BuildFromProject Assembly: BuildFromProject.dll public interface Class1.IIssue8948 Methods DoNothing () Does nothing with generic type T. void DoNothing() Type Parameters T A generic type." + "keywords": "Interface Class1.IIssue8948 Namespace: BuildFromProject Assembly: BuildFromProject.dll public interface Class1.IIssue8948 Methods DoNothing() Does nothing with generic type T. void DoNothing() Type Parameters T A generic type." }, "md/BuildFromProject.Class1.Issue8665.html": { "href": "md/BuildFromProject.Class1.Issue8665.html", @@ -312,17 +312,17 @@ "md/BuildFromProject.Class1.Issue8948.html": { "href": "md/BuildFromProject.Class1.Issue8948.html", "title": "Class Class1.Issue8948 | docfx seed website", - "keywords": "Class Class1.Issue8948 Namespace: BuildFromProject Assembly: BuildFromProject.dll public class Class1.Issue8948 : Class1.IIssue8948 Inheritance object ← Class1.Issue8948 Implements Class1.IIssue8948 Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods DoNothing () Does nothing with generic type T. public void DoNothing() Type Parameters T A generic type." + "keywords": "Class Class1.Issue8948 Namespace: BuildFromProject Assembly: BuildFromProject.dll public class Class1.Issue8948 : Class1.IIssue8948 Inheritance object ← Class1.Issue8948 Implements Class1.IIssue8948 Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods DoNothing() Does nothing with generic type T. public void DoNothing() Type Parameters T A generic type." }, "md/BuildFromProject.Class1.Test-1.html": { "href": "md/BuildFromProject.Class1.Test-1.html", - "title": "Class Class1.Test | docfx seed website", - "keywords": "Class Class1.Test Namespace: BuildFromProject Assembly: BuildFromProject.dll public class Class1.Test Type Parameters T Inheritance object ← Class1.Test Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()" + "title": "Class Class1.Test | docfx seed website", + "keywords": "Class Class1.Test Namespace: BuildFromProject Assembly: BuildFromProject.dll public class Class1.Test Type Parameters T Inheritance object ← Class1.Test Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()" }, "md/BuildFromProject.Class1.html": { "href": "md/BuildFromProject.Class1.html", "title": "Class Class1 | docfx seed website", - "keywords": "Class Class1 Namespace: BuildFromProject Assembly: BuildFromProject.dll public class Class1 : IClass1 Inheritance object ← Class1 Implements IClass1 Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods Issue1651() Pricing models are used to calculate theoretical option values 1Black Scholes 2Black76 3Black76Fut 4Equity Tree 5Variance Swap 6Dividend Forecast public void Issue1651() Issue1887() IConfiguration related helper and extension routines. public void Issue1887() Issue2623() public void Issue2623() Examples MyClass myClass = new MyClass(); void Update() { myClass.Execute(); } Remarks For example: MyClass myClass = new MyClass(); void Update() { myClass.Execute(); } Issue2723() public void Issue2723() Remarks Note This is a . & \" ' Inline . link for (var i = 0; i > 10; i++) // & \" ' var range = new Range { Min = 0, Max = 10 }; var range = new Range { Min = 0, Max = 10 }; Issue4017() public void Issue4017() Examples public void HookMessageDeleted(BaseSocketClient client) { client.MessageDeleted += HandleMessageDelete; } public Task HandleMessageDelete(Cacheable cachedMessage, ISocketMessageChannel channel) { // check if the message exists in cache; if not, we cannot report what was removed if (!cachedMessage.HasValue) return; var message = cachedMessage.Value; Console.WriteLine($\"A message ({message.Id}) from {message.Author} was removed from the channel {channel.Name} ({channel.Id}):\" + Environment.NewLine + message.Content); return Task.CompletedTask; } Remarks void Update() { myClass.Execute(); } Issue4392() public void Issue4392() Remarks @\"\\\\?\\\" @\"\\\\?\\\" Issue7484() public void Issue7484() Remarks There's really no reason to not believe that this class can test things. Term Description A Term A Description Bee Term Bee Description Issue8764 () public void Issue8764() where T : unmanaged Type Parameters T Issue896() Test public void Issue896() See Also Class1.Test Class1 Issue9216() Calculates the determinant of a 3-dimensional matrix: \\(A = \\begin{vmatrix} a_{11} & a_{12} & a_{13} \\\\ a_{21} & a_{22} & a_{23} \\\\ a_{31} & a_{32} & a_{33} \\end{vmatrix}\\) Returns the smallest value: \\(\\left\\{\\begin{matrix}a, aa\\\\ \\end{matrix} \\right.\\) public static double Issue9216() Returns double XmlCommentIncludeTag() This method should do something... public void XmlCommentIncludeTag() Remarks This is remarks." + "keywords": "Class Class1 Namespace: BuildFromProject Assembly: BuildFromProject.dll public class Class1 : IClass1 Inheritance object ← Class1 Implements IClass1 Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods Issue1651() Pricing models are used to calculate theoretical option values 1Black Scholes 2Black76 3Black76Fut 4Equity Tree 5Variance Swap 6Dividend Forecast public void Issue1651() Issue1887() IConfiguration related helper and extension routines. public void Issue1887() Issue2623() public void Issue2623() Examples MyClass myClass = new MyClass(); void Update() { myClass.Execute(); } Remarks For example: MyClass myClass = new MyClass(); void Update() { myClass.Execute(); } Issue2723() public void Issue2723() Remarks Note This is a . & \" ' Inline . link for (var i = 0; i > 10; i++) // & \" ' var range = new Range { Min = 0, Max = 10 }; var range = new Range { Min = 0, Max = 10 }; Issue4017() public void Issue4017() Examples public void HookMessageDeleted(BaseSocketClient client) { client.MessageDeleted += HandleMessageDelete; } public Task HandleMessageDelete(Cacheable cachedMessage, ISocketMessageChannel channel) { // check if the message exists in cache; if not, we cannot report what was removed if (!cachedMessage.HasValue) return; var message = cachedMessage.Value; Console.WriteLine($\"A message ({message.Id}) from {message.Author} was removed from the channel {channel.Name} ({channel.Id}):\" + Environment.NewLine + message.Content); return Task.CompletedTask; } Remarks void Update() { myClass.Execute(); } Issue4392() public void Issue4392() Remarks @\"\\\\?\\\" @\"\\\\?\\\" Issue7484() public void Issue7484() Remarks There's really no reason to not believe that this class can test things. Term Description A Term A Description Bee Term Bee Description Issue8764() public void Issue8764() where T : unmanaged Type Parameters T Issue896() Test public void Issue896() See Also Class1.Test Class1 Issue9216() Calculates the determinant of a 3-dimensional matrix: \\(A = \\begin{vmatrix} a_{11} & a_{12} & a_{13} \\\\ a_{21} & a_{22} & a_{23} \\\\ a_{31} & a_{32} & a_{33} \\end{vmatrix}\\) Returns the smallest value: \\(\\left\\{\\begin{matrix}a, aa\\\\ \\end{matrix} \\right.\\) public static double Issue9216() Returns double XmlCommentIncludeTag() This method should do something... public void XmlCommentIncludeTag() Remarks This is remarks." }, "md/BuildFromProject.IInheritdoc.html": { "href": "md/BuildFromProject.IInheritdoc.html", @@ -331,13 +331,13 @@ }, "md/BuildFromProject.Inheritdoc.Issue6366.Class1-1.html": { "href": "md/BuildFromProject.Inheritdoc.Issue6366.Class1-1.html", - "title": "Class Inheritdoc.Issue6366.Class1 | docfx seed website", - "keywords": "Class Inheritdoc.Issue6366.Class1 Namespace: BuildFromProject Assembly: BuildFromProject.dll public abstract class Inheritdoc.Issue6366.Class1 Type Parameters T Inheritance object ← Inheritdoc.Issue6366.Class1 Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods TestMethod1(T, int) This text inherited. public abstract T TestMethod1(T parm1, int parm2) Parameters parm1 T This text NOT inherited. parm2 int This text inherited. Returns T This text inherited." + "title": "Class Inheritdoc.Issue6366.Class1 | docfx seed website", + "keywords": "Class Inheritdoc.Issue6366.Class1 Namespace: BuildFromProject Assembly: BuildFromProject.dll public abstract class Inheritdoc.Issue6366.Class1 Type Parameters T Inheritance object ← Inheritdoc.Issue6366.Class1 Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods TestMethod1(T, int) This text inherited. public abstract T TestMethod1(T parm1, int parm2) Parameters parm1 T This text NOT inherited. parm2 int This text inherited. Returns T This text inherited." }, "md/BuildFromProject.Inheritdoc.Issue6366.Class2.html": { "href": "md/BuildFromProject.Inheritdoc.Issue6366.Class2.html", "title": "Class Inheritdoc.Issue6366.Class2 | docfx seed website", - "keywords": "Class Inheritdoc.Issue6366.Class2 Namespace: BuildFromProject Assembly: BuildFromProject.dll public class Inheritdoc.Issue6366.Class2 : Inheritdoc.Issue6366.Class1 Inheritance object ← Inheritdoc.Issue6366.Class1 ← Inheritdoc.Issue6366.Class2 Inherited Members Inheritdoc.Issue6366.Class1 .TestMethod1(bool, int) , object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods TestMethod1(bool, int) This text inherited. public override bool TestMethod1(bool parm1, int parm2) Parameters parm1 bool This text NOT inherited. parm2 int This text inherited. Returns bool This text inherited." + "keywords": "Class Inheritdoc.Issue6366.Class2 Namespace: BuildFromProject Assembly: BuildFromProject.dll public class Inheritdoc.Issue6366.Class2 : Inheritdoc.Issue6366.Class1 Inheritance object ← Inheritdoc.Issue6366.Class1 ← Inheritdoc.Issue6366.Class2 Inherited Members Inheritdoc.Issue6366.Class1.TestMethod1(bool, int), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods TestMethod1(bool, int) This text inherited. public override bool TestMethod1(bool parm1, int parm2) Parameters parm1 bool This text NOT inherited. parm2 int This text inherited. Returns bool This text inherited." }, "md/BuildFromProject.Inheritdoc.Issue6366.html": { "href": "md/BuildFromProject.Inheritdoc.Issue6366.html", @@ -357,7 +357,7 @@ "md/BuildFromProject.Inheritdoc.Issue8101.html": { "href": "md/BuildFromProject.Inheritdoc.Issue8101.html", "title": "Class Inheritdoc.Issue8101 | docfx seed website", - "keywords": "Class Inheritdoc.Issue8101 Namespace: BuildFromProject Assembly: BuildFromProject.dll public class Inheritdoc.Issue8101 Inheritance object ← Inheritdoc.Issue8101 Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods Tween(float, float, float, Action ) Create a new tween. public static object Tween(float from, float to, float duration, Action onChange) Parameters from float The starting value. to float The end value. duration float Total tween duration in seconds. onChange Action A callback that will be invoked every time the tween value changes. Returns object The newly created tween instance. Tween(int, int, float, Action ) Create a new tween. public static object Tween(int from, int to, float duration, Action onChange) Parameters from int The starting value. to int The end value. duration float Total tween duration in seconds. onChange Action A callback that will be invoked every time the tween value changes. Returns object The newly created tween instance." + "keywords": "Class Inheritdoc.Issue8101 Namespace: BuildFromProject Assembly: BuildFromProject.dll public class Inheritdoc.Issue8101 Inheritance object ← Inheritdoc.Issue8101 Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods Tween(float, float, float, Action) Create a new tween. public static object Tween(float from, float to, float duration, Action onChange) Parameters from float The starting value. to float The end value. duration float Total tween duration in seconds. onChange Action A callback that will be invoked every time the tween value changes. Returns object The newly created tween instance. Tween(int, int, float, Action) Create a new tween. public static object Tween(int from, int to, float duration, Action onChange) Parameters from int The starting value. to int The end value. duration float Total tween duration in seconds. onChange Action A callback that will be invoked every time the tween value changes. Returns object The newly created tween instance." }, "md/BuildFromProject.Inheritdoc.Issue8129.html": { "href": "md/BuildFromProject.Inheritdoc.Issue8129.html", @@ -397,7 +397,7 @@ "md/BuildFromProject.html": { "href": "md/BuildFromProject.html", "title": "Namespace BuildFromProject | docfx seed website", - "keywords": "Namespace BuildFromProject Namespaces BuildFromProject.Issue8540 Classes Class1 Inheritdoc.Issue6366.Class1 Inheritdoc.Issue6366.Class2 Inheritdoc Inheritdoc.Issue6366 Inheritdoc.Issue7035 Inheritdoc.Issue7484 This is a test class to have something for DocFX to document. Inheritdoc.Issue8101 Class1.Issue8665 Class1.Issue8696Attribute Class1.Issue8948 Class1.Test Structs Inheritdoc.Issue8129 Interfaces IInheritdoc Class1.IIssue8948" + "keywords": "Namespace BuildFromProject Namespaces BuildFromProject.Issue8540 Classes Inheritdoc.Issue6366.Class1 Class1 Inheritdoc.Issue6366.Class2 Inheritdoc Inheritdoc.Issue6366 Inheritdoc.Issue7035 Inheritdoc.Issue7484 This is a test class to have something for DocFX to document. Inheritdoc.Issue8101 Class1.Issue8665 Class1.Issue8696Attribute Class1.Issue8948 Class1.Test Structs Inheritdoc.Issue8129 Interfaces IInheritdoc Class1.IIssue8948" }, "md/BuildFromVBSourceCode.BaseClass1.html": { "href": "md/BuildFromVBSourceCode.BaseClass1.html", @@ -421,8 +421,8 @@ }, "md/CatLibrary.CatException-1.html": { "href": "md/CatLibrary.CatException-1.html", - "title": "Class CatException | docfx seed website", - "keywords": "Class CatException Namespace: CatLibrary Assembly: CatLibrary.dll public class CatException : Exception, ISerializable Type Parameters T Inheritance object ← Exception ← CatException Implements ISerializable Inherited Members Exception.GetBaseException(), Exception.GetObjectData(SerializationInfo, StreamingContext), Exception.GetType(), Exception.ToString(), Exception.Data, Exception.HelpLink, Exception.HResult, Exception.InnerException, Exception.Message, Exception.Source, Exception.StackTrace, Exception.TargetSite, Exception.SerializeObjectState, object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()" + "title": "Class CatException | docfx seed website", + "keywords": "Class CatException Namespace: CatLibrary Assembly: CatLibrary.dll public class CatException : Exception, ISerializable Type Parameters T Inheritance object ← Exception ← CatException Implements ISerializable Inherited Members Exception.GetBaseException(), Exception.GetObjectData(SerializationInfo, StreamingContext), Exception.GetType(), Exception.ToString(), Exception.Data, Exception.HelpLink, Exception.HResult, Exception.InnerException, Exception.Message, Exception.Source, Exception.StackTrace, Exception.TargetSite, Exception.SerializeObjectState, object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()" }, "md/CatLibrary.Complex-2.html": { "href": "md/CatLibrary.Complex-2.html", @@ -471,13 +471,13 @@ }, "md/CatLibrary.FakeDelegate-1.html": { "href": "md/CatLibrary.FakeDelegate-1.html", - "title": "Delegate FakeDelegate | docfx seed website", - "keywords": "Delegate FakeDelegate Namespace: CatLibrary Assembly: CatLibrary.dll Fake delegate public delegate int FakeDelegate(long num, string name, params object[] scores) Parameters num long Fake para name string Fake para scores object[] Optional Parameter. Returns int Return a fake number to confuse you. Type Parameters T Fake para" + "title": "Delegate FakeDelegate | docfx seed website", + "keywords": "Delegate FakeDelegate Namespace: CatLibrary Assembly: CatLibrary.dll Fake delegate public delegate int FakeDelegate(long num, string name, params object[] scores) Parameters num long Fake para name string Fake para scores object[] Optional Parameter. Returns int Return a fake number to confuse you. Type Parameters T Fake para" }, "md/CatLibrary.IAnimal.html": { "href": "md/CatLibrary.IAnimal.html", "title": "Interface IAnimal | docfx seed website", - "keywords": "Interface IAnimal Namespace: CatLibrary Assembly: CatLibrary.dll This is basic interface of all animal. public interface IAnimal Properties Name Name of Animal. string Name { get; } Property Value string this[int] Return specific number animal's name. string this[int index] { get; } Property Value string Methods Eat() Animal's eat method. void Eat() Eat (Tool) Overload method of eat. This define the animal eat by which tool. void Eat(Tool tool) where Tool : class Parameters tool Tool Tool name. Type Parameters Tool It's a class type. Eat(string) Feed the animal with some food void Eat(string food) Parameters food string Food to eat" + "keywords": "Interface IAnimal Namespace: CatLibrary Assembly: CatLibrary.dll This is basic interface of all animal. public interface IAnimal Properties Name Name of Animal. string Name { get; } Property Value string this[int] Return specific number animal's name. string this[int index] { get; } Property Value string Methods Eat() Animal's eat method. void Eat() Eat(Tool) Overload method of eat. This define the animal eat by which tool. void Eat(Tool tool) where Tool : class Parameters tool Tool Tool name. Type Parameters Tool It's a class type. Eat(string) Feed the animal with some food void Eat(string food) Parameters food string Food to eat" }, "md/CatLibrary.ICat.html": { "href": "md/CatLibrary.ICat.html", @@ -502,7 +502,7 @@ "md/CatLibrary.Tom.html": { "href": "md/CatLibrary.Tom.html", "title": "Class Tom | docfx seed website", - "keywords": "Class Tom Namespace: CatLibrary Assembly: CatLibrary.dll Tom class is only inherit from Object. Not any member inside itself. public class Tom Inheritance object ← Tom Derived TomFromBaseClass Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods TomMethod(Complex, Tuple) This is a Tom Method with complex type as return public Complex TomMethod(Complex a, Tuple b) Parameters a Complex A complex input b Tuple Another complex input Returns Complex Complex TomFromBaseClass Exceptions NotImplementedException This is not implemented ArgumentException This is the exception to be thrown when implemented CatException This is the exception in current documentation" + "keywords": "Class Tom Namespace: CatLibrary Assembly: CatLibrary.dll Tom class is only inherit from Object. Not any member inside itself. public class Tom Inheritance object ← Tom Derived TomFromBaseClass Inherited Members object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString() Methods TomMethod(Complex, Tuple) This is a Tom Method with complex type as return public Complex TomMethod(Complex a, Tuple b) Parameters a Complex A complex input b Tuple Another complex input Returns Complex Complex TomFromBaseClass Exceptions NotImplementedException This is not implemented ArgumentException This is the exception to be thrown when implemented CatException This is the exception in current documentation" }, "md/CatLibrary.TomFromBaseClass.html": { "href": "md/CatLibrary.TomFromBaseClass.html", @@ -512,7 +512,7 @@ "md/CatLibrary.html": { "href": "md/CatLibrary.html", "title": "Namespace CatLibrary | docfx seed website", - "keywords": "Namespace CatLibrary Namespaces CatLibrary.Core Classes Cat Here's main class of this Demo. You can see mostly type of article within this class and you for more detail, please see the remarks. this class is a template class. It has two Generic parameter. they are: T and K. The extension method of this class can refer to ICatExtension class CatException Complex ICatExtension It's the class that contains ICat interface's extension method. This class must be public and static. Also it shouldn't be a geneic class Tom Tom class is only inherit from Object. Not any member inside itself. TomFromBaseClass TomFromBaseClass inherits from @ Interfaces IAnimal This is basic interface of all animal. ICat Cat's interface Delegates FakeDelegate Fake delegate MRefDelegate Generic delegate with many constrains. MRefNormalDelegate Delegate in the namespace" + "keywords": "Namespace CatLibrary Namespaces CatLibrary.Core Classes Cat Here's main class of this Demo. You can see mostly type of article within this class and you for more detail, please see the remarks. this class is a template class. It has two Generic parameter. they are: T and K. The extension method of this class can refer to ICatExtension class CatException Complex ICatExtension It's the class that contains ICat interface's extension method. This class must be public and static. Also it shouldn't be a geneic class Tom Tom class is only inherit from Object. Not any member inside itself. TomFromBaseClass TomFromBaseClass inherits from @ Interfaces IAnimal This is basic interface of all animal. ICat Cat's interface Delegates FakeDelegate Fake delegate MRefDelegate Generic delegate with many constrains. MRefNormalDelegate Delegate in the namespace" }, "md/MRef.Demo.Enumeration.ColorType.html": { "href": "md/MRef.Demo.Enumeration.ColorType.html", diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromAssembly.Class1.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromAssembly.Class1.html.view.verified.json index b10337a0a55..c742d36dd34 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromAssembly.Class1.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromAssembly.Class1.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromAssembly
\nAssembly: BuildFromAssembly.dll

\n

This is a test class.

\n
public class Class1\n
\n
Inheritance
\n

object ←\nClass1

\n
Inherited Members
\n

object.GetType(),\nobject.MemberwiseClone(),\nobject.ToString(),\nobject.Equals(object?),\nobject.Equals(object?, object?),\nobject.ReferenceEquals(object?, object?),\nobject.GetHashCode()

\n

Constructors

\n

Class1()

\n
public Class1()\n
\n

Methods

\n

HelloWorld()

\n

Hello World.

\n
public static void HelloWorld()\n
\n", + "conceptual": "\n

Namespace: BuildFromAssembly
\nAssembly: BuildFromAssembly.dll

\n

This is a test class.

\n
public class Class1\n
\n
Inheritance
\n

object ←\nClass1

\n
Inherited Members
\n

object.GetType(),\nobject.MemberwiseClone(),\nobject.ToString(),\nobject.Equals(object?),\nobject.Equals(object?, object?),\nobject.ReferenceEquals(object?, object?),\nobject.GetHashCode()

\n

Constructors

\n

Class1()

\n
public Class1()\n
\n

Methods

\n

HelloWorld()

\n

Hello World.

\n
public static void HelloWorld()\n
\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromCSharpSourceCode.CSharp.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromCSharpSourceCode.CSharp.html.view.verified.json index b6b67a2354f..e37a1e08637 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromCSharpSourceCode.CSharp.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromCSharpSourceCode.CSharp.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromCSharpSourceCode

\n
public class CSharp\n
\n
Inheritance
\n

object ←\nCSharp

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Main(string[])

\n
public static void Main(string[] args)\n
\n

Parameters

\n

args string[]

\n", + "conceptual": "\n

Namespace: BuildFromCSharpSourceCode

\n
public class CSharp\n
\n
Inheritance
\n

object ←\nCSharp

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Main(string[])

\n
public static void Main(string[] args)\n
\n

Parameters

\n

args string[]

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.IIssue8948.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.IIssue8948.html.view.verified.json index dcb82d0afe3..22b89a266b7 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.IIssue8948.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.IIssue8948.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public interface Class1.IIssue8948\n
\n

Methods

\n

DoNothing()

\n

Does nothing with generic type T.

\n
void DoNothing<T>()\n
\n

Type Parameters

\n

T

\n

A generic type.

\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public interface Class1.IIssue8948\n
\n

Methods

\n

DoNothing<T>()

\n

Does nothing with generic type T.

\n
void DoNothing<T>()\n
\n

Type Parameters

\n

T

\n

A generic type.

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8665.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8665.html.view.verified.json index fdb841e0494..ea8d9ffd9b8 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8665.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8665.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Class1.Issue8665\n
\n
Inheritance
\n

object ←\nClass1.Issue8665

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Constructors

\n

Issue8665()

\n
public Issue8665()\n
\n

Issue8665(int)

\n
public Issue8665(int foo)\n
\n

Parameters

\n

foo int

\n

Issue8665(int, char)

\n
public Issue8665(int foo, char bar)\n
\n

Parameters

\n

foo int

\n

bar char

\n

Issue8665(int, char, string)

\n
public Issue8665(int foo, char bar, string baz)\n
\n

Parameters

\n

foo int

\n

bar char

\n

baz string

\n

Properties

\n

Bar

\n
public char Bar { get; }\n
\n

Property Value

\n

char

\n

Baz

\n
public string Baz { get; }\n
\n

Property Value

\n

string

\n

Foo

\n
public int Foo { get; }\n
\n

Property Value

\n

int

\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Class1.Issue8665\n
\n
Inheritance
\n

object ←\nClass1.Issue8665

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Constructors

\n

Issue8665()

\n
public Issue8665()\n
\n

Issue8665(int)

\n
public Issue8665(int foo)\n
\n

Parameters

\n

foo int

\n

Issue8665(int, char)

\n
public Issue8665(int foo, char bar)\n
\n

Parameters

\n

foo int

\n

bar char

\n

Issue8665(int, char, string)

\n
public Issue8665(int foo, char bar, string baz)\n
\n

Parameters

\n

foo int

\n

bar char

\n

baz string

\n

Properties

\n

Bar

\n
public char Bar { get; }\n
\n

Property Value

\n

char

\n

Baz

\n
public string Baz { get; }\n
\n

Property Value

\n

string

\n

Foo

\n
public int Foo { get; }\n
\n

Property Value

\n

int

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8696Attribute.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8696Attribute.html.view.verified.json index 47b09c5373e..622620b3ed9 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8696Attribute.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8696Attribute.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Class1.Issue8696Attribute : Attribute\n
\n
Inheritance
\n

object ←\nAttribute ←\nClass1.Issue8696Attribute

\n
Inherited Members
\n

Attribute.Equals(object?),\nAttribute.GetCustomAttribute(Assembly, Type),\nAttribute.GetCustomAttribute(Assembly, Type, bool),\nAttribute.GetCustomAttribute(MemberInfo, Type),\nAttribute.GetCustomAttribute(MemberInfo, Type, bool),\nAttribute.GetCustomAttribute(Module, Type),\nAttribute.GetCustomAttribute(Module, Type, bool),\nAttribute.GetCustomAttribute(ParameterInfo, Type),\nAttribute.GetCustomAttribute(ParameterInfo, Type, bool),\nAttribute.GetCustomAttributes(Assembly),\nAttribute.GetCustomAttributes(Assembly, bool),\nAttribute.GetCustomAttributes(Assembly, Type),\nAttribute.GetCustomAttributes(Assembly, Type, bool),\nAttribute.GetCustomAttributes(MemberInfo),\nAttribute.GetCustomAttributes(MemberInfo, bool),\nAttribute.GetCustomAttributes(MemberInfo, Type),\nAttribute.GetCustomAttributes(MemberInfo, Type, bool),\nAttribute.GetCustomAttributes(Module),\nAttribute.GetCustomAttributes(Module, bool),\nAttribute.GetCustomAttributes(Module, Type),\nAttribute.GetCustomAttributes(Module, Type, bool),\nAttribute.GetCustomAttributes(ParameterInfo),\nAttribute.GetCustomAttributes(ParameterInfo, bool),\nAttribute.GetCustomAttributes(ParameterInfo, Type),\nAttribute.GetCustomAttributes(ParameterInfo, Type, bool),\nAttribute.GetHashCode(),\nAttribute.IsDefaultAttribute(),\nAttribute.IsDefined(Assembly, Type),\nAttribute.IsDefined(Assembly, Type, bool),\nAttribute.IsDefined(MemberInfo, Type),\nAttribute.IsDefined(MemberInfo, Type, bool),\nAttribute.IsDefined(Module, Type),\nAttribute.IsDefined(Module, Type, bool),\nAttribute.IsDefined(ParameterInfo, Type),\nAttribute.IsDefined(ParameterInfo, Type, bool),\nAttribute.Match(object?),\nAttribute.TypeId,\nobject.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Constructors

\n

Issue8696Attribute(string?, int, int, string[]?, bool, Type?)

\n
[Class1.Issue8696("Changes the name of the server in the server list", 0, 0, null, false, null)]\npublic Issue8696Attribute(string? description = null, int boundsMin = 0, int boundsMax = 0, string[]? validGameModes = null, bool hasMultipleSelections = false, Type? enumType = null)\n
\n

Parameters

\n

description string?

\n

boundsMin int

\n

boundsMax int

\n

validGameModes string[]?

\n

hasMultipleSelections bool

\n

enumType Type?

\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Class1.Issue8696Attribute : Attribute\n
\n
Inheritance
\n

object ←\nAttribute ←\nClass1.Issue8696Attribute

\n
Inherited Members
\n

Attribute.Equals(object?),\nAttribute.GetCustomAttribute(Assembly, Type),\nAttribute.GetCustomAttribute(Assembly, Type, bool),\nAttribute.GetCustomAttribute(MemberInfo, Type),\nAttribute.GetCustomAttribute(MemberInfo, Type, bool),\nAttribute.GetCustomAttribute(Module, Type),\nAttribute.GetCustomAttribute(Module, Type, bool),\nAttribute.GetCustomAttribute(ParameterInfo, Type),\nAttribute.GetCustomAttribute(ParameterInfo, Type, bool),\nAttribute.GetCustomAttributes(Assembly),\nAttribute.GetCustomAttributes(Assembly, bool),\nAttribute.GetCustomAttributes(Assembly, Type),\nAttribute.GetCustomAttributes(Assembly, Type, bool),\nAttribute.GetCustomAttributes(MemberInfo),\nAttribute.GetCustomAttributes(MemberInfo, bool),\nAttribute.GetCustomAttributes(MemberInfo, Type),\nAttribute.GetCustomAttributes(MemberInfo, Type, bool),\nAttribute.GetCustomAttributes(Module),\nAttribute.GetCustomAttributes(Module, bool),\nAttribute.GetCustomAttributes(Module, Type),\nAttribute.GetCustomAttributes(Module, Type, bool),\nAttribute.GetCustomAttributes(ParameterInfo),\nAttribute.GetCustomAttributes(ParameterInfo, bool),\nAttribute.GetCustomAttributes(ParameterInfo, Type),\nAttribute.GetCustomAttributes(ParameterInfo, Type, bool),\nAttribute.GetHashCode(),\nAttribute.IsDefaultAttribute(),\nAttribute.IsDefined(Assembly, Type),\nAttribute.IsDefined(Assembly, Type, bool),\nAttribute.IsDefined(MemberInfo, Type),\nAttribute.IsDefined(MemberInfo, Type, bool),\nAttribute.IsDefined(Module, Type),\nAttribute.IsDefined(Module, Type, bool),\nAttribute.IsDefined(ParameterInfo, Type),\nAttribute.IsDefined(ParameterInfo, Type, bool),\nAttribute.Match(object?),\nAttribute.TypeId,\nobject.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Constructors

\n

Issue8696Attribute(string?, int, int, string[]?, bool, Type?)

\n
[Class1.Issue8696("Changes the name of the server in the server list", 0, 0, null, false, null)]\npublic Issue8696Attribute(string? description = null, int boundsMin = 0, int boundsMax = 0, string[]? validGameModes = null, bool hasMultipleSelections = false, Type? enumType = null)\n
\n

Parameters

\n

description string?

\n

boundsMin int

\n

boundsMax int

\n

validGameModes string[]?

\n

hasMultipleSelections bool

\n

enumType Type?

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8948.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8948.html.view.verified.json index a0df8715695..c3319383465 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8948.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Issue8948.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Class1.Issue8948 : Class1.IIssue8948\n
\n
Inheritance
\n

object ←\nClass1.Issue8948

\n
Implements
\n

Class1.IIssue8948

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

DoNothing()

\n

Does nothing with generic type T.

\n
public void DoNothing<T>()\n
\n

Type Parameters

\n

T

\n

A generic type.

\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Class1.Issue8948 : Class1.IIssue8948\n
\n
Inheritance
\n

object ←\nClass1.Issue8948

\n
Implements
\n

Class1.IIssue8948

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

DoNothing<T>()

\n

Does nothing with generic type T.

\n
public void DoNothing<T>()\n
\n

Type Parameters

\n

T

\n

A generic type.

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Test-1.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Test-1.html.view.verified.json index 8a11cdaca83..ccccfd2f9a7 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Test-1.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.Test-1.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Class1.Test<T>\n
\n

Type Parameters

\n

T

\n
Inheritance
\n

object ←\nClass1.Test

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Class1.Test<T>\n
\n

Type Parameters

\n

T

\n
Inheritance
\n

object ←\nClass1.Test<T>

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n", "type": "Conceptual", "source": { "remote": { @@ -25,8 +25,8 @@ "_appName": "Seed", "_appTitle": "docfx seed website", "_enableSearch": true, - "rawTitle": "

Class Class1.Test

", - "title": "Class Class1.Test", + "rawTitle": "

Class Class1.Test<T>

", + "title": "Class Class1.Test", "wordCount": 25.0, "_key": "obj/md/BuildFromProject.Class1.Test-1.md", "_navKey": "~/toc.yml", diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.html.view.verified.json index 0240c3edee5..b8f308dd4e6 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Class1.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Class1 : IClass1\n
\n
Inheritance
\n

object ←\nClass1

\n
Implements
\n

IClass1

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Issue1651()

\n

Pricing models are used to calculate theoretical option values

\n
  • 1Black Scholes
  • 2Black76
  • 3Black76Fut
  • 4Equity Tree
  • 5Variance Swap
  • 6Dividend Forecast
\n
public void Issue1651()\n
\n

Issue1887()

\n

IConfiguration related helper and extension routines.

\n
public void Issue1887()\n
\n

Issue2623()

\n
public void Issue2623()\n
\n

Examples

\n
MyClass myClass = new MyClass();\n\nvoid Update()\n{\n    myClass.Execute();\n}\n
\n

Remarks

\n

For example:

\n
MyClass myClass = new MyClass();\n\nvoid Update()\n{\n    myClass.Execute();\n}\n
\n

Issue2723()

\n
public void Issue2723()\n
\n

Remarks

\n
\n
Note
\n

This is a <note>. & " '

\n
\n

Inline <angle brackets>.

\n

link

\n
for (var i = 0; i > 10; i++) // & " '\nvar range = new Range<int> { Min = 0, Max = 10 };\n
\n
var range = new Range<int> { Min = 0, Max = 10 };
\n

Issue4017()

\n
public void Issue4017()\n
\n

Examples

\n
public void HookMessageDeleted(BaseSocketClient client)\n{\n    client.MessageDeleted += HandleMessageDelete;\n}\n\npublic Task HandleMessageDelete(Cacheable<IMessage, ulong> cachedMessage, ISocketMessageChannel channel)\n{\n    // check if the message exists in cache; if not, we cannot report what was removed\n    if (!cachedMessage.HasValue) return;\n    var message = cachedMessage.Value;\n    Console.WriteLine($\"A message ({message.Id}) from {message.Author} was removed from the channel {channel.Name} ({channel.Id}):\"\n        + Environment.NewLine\n        + message.Content);\n    return Task.CompletedTask;\n}
\n

Remarks

\n
void Update()\n{\n    myClass.Execute();\n}
\n

Issue4392()

\n
public void Issue4392()\n
\n

Remarks

\n

@"\\\\?\\"

\n

Issue7484()

\n
public void Issue7484()\n
\n

Remarks

\n

There's really no reason to not believe that this class can test things.

\n
TermDescription
A TermA Description
Bee TermBee Description
\n

Issue8764()

\n
public void Issue8764<T>() where T : unmanaged\n
\n

Type Parameters

\n

T

\n

Issue896()

\n

Test

\n
public void Issue896()\n
\n

See Also

\n

Class1.Test

\n

Class1

\n

Issue9216()

\n

Calculates the determinant of a 3-dimensional matrix:

\n

\\(A = \\begin{vmatrix} a_{11} & a_{12} & a_{13} \\\\ a_{21} & a_{22} & a_{23} \\\\ a_{31} & a_{32} & a_{33} \\end{vmatrix}\\)

\n

Returns the smallest value:

\n

\\(\\left\\{\\begin{matrix}a, a<b \\\\ b, b>a\\\\ \\end{matrix} \\right.\\)

\n
public static double Issue9216()\n
\n

Returns

\n

double

\n

XmlCommentIncludeTag()

\n

This method should do something...

\n
public void XmlCommentIncludeTag()\n
\n

Remarks

\n

This is remarks.

\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Class1 : IClass1\n
\n
Inheritance
\n

object ←\nClass1

\n
Implements
\n

IClass1

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Issue1651()

\n

Pricing models are used to calculate theoretical option values

\n
  • 1Black Scholes
  • 2Black76
  • 3Black76Fut
  • 4Equity Tree
  • 5Variance Swap
  • 6Dividend Forecast
\n
public void Issue1651()\n
\n

Issue1887()

\n

IConfiguration related helper and extension routines.

\n
public void Issue1887()\n
\n

Issue2623()

\n
public void Issue2623()\n
\n

Examples

\n
MyClass myClass = new MyClass();\n\nvoid Update()\n{\n    myClass.Execute();\n}\n
\n

Remarks

\n

For example:

\n
MyClass myClass = new MyClass();\n\nvoid Update()\n{\n    myClass.Execute();\n}\n
\n

Issue2723()

\n
public void Issue2723()\n
\n

Remarks

\n
\n
Note
\n

This is a <note>. & " '

\n
\n

Inline <angle brackets>.

\n

link

\n
for (var i = 0; i > 10; i++) // & " '\nvar range = new Range<int> { Min = 0, Max = 10 };\n
\n
var range = new Range<int> { Min = 0, Max = 10 };
\n

Issue4017()

\n
public void Issue4017()\n
\n

Examples

\n
public void HookMessageDeleted(BaseSocketClient client)\n{\n    client.MessageDeleted += HandleMessageDelete;\n}\n\npublic Task HandleMessageDelete(Cacheable<IMessage, ulong> cachedMessage, ISocketMessageChannel channel)\n{\n    // check if the message exists in cache; if not, we cannot report what was removed\n    if (!cachedMessage.HasValue) return;\n    var message = cachedMessage.Value;\n    Console.WriteLine($\"A message ({message.Id}) from {message.Author} was removed from the channel {channel.Name} ({channel.Id}):\"\n        + Environment.NewLine\n        + message.Content);\n    return Task.CompletedTask;\n}
\n

Remarks

\n
void Update()\n{\n    myClass.Execute();\n}
\n

Issue4392()

\n
public void Issue4392()\n
\n

Remarks

\n

@"\\\\?\\"

\n

Issue7484()

\n
public void Issue7484()\n
\n

Remarks

\n

There's really no reason to not believe that this class can test things.

\n
TermDescription
A TermA Description
Bee TermBee Description
\n

Issue8764<T>()

\n
public void Issue8764<T>() where T : unmanaged\n
\n

Type Parameters

\n

T

\n

Issue896()

\n

Test

\n
public void Issue896()\n
\n

See Also

\n

Class1.Test<T>
\nClass1

\n

Issue9216()

\n

Calculates the determinant of a 3-dimensional matrix:

\n

\\(A = \\begin{vmatrix} a_{11} & a_{12} & a_{13} \\\\ a_{21} & a_{22} & a_{23} \\\\ a_{31} & a_{32} & a_{33} \\end{vmatrix}\\)

\n

Returns the smallest value:

\n

\\(\\left\\{\\begin{matrix}a, a<b \\\\ b, b>a\\\\ \\end{matrix} \\right.\\)

\n
public static double Issue9216()\n
\n

Returns

\n

double

\n

XmlCommentIncludeTag()

\n

This method should do something...

\n
public void XmlCommentIncludeTag()\n
\n

Remarks

\n

This is remarks.

\n", "type": "Conceptual", "source": { "remote": { @@ -27,7 +27,7 @@ "_enableSearch": true, "rawTitle": "

Class Class1

", "title": "Class Class1", - "wordCount": 332.0, + "wordCount": 333.0, "_key": "obj/md/BuildFromProject.Class1.md", "_navKey": "~/toc.yml", "_navPath": "toc.html", diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.IInheritdoc.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.IInheritdoc.html.view.verified.json index 95d866e2089..e4333b0d86e 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.IInheritdoc.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.IInheritdoc.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public interface IInheritdoc\n
\n

Methods

\n

Issue7629()

\n

This method should do something...

\n
void Issue7629()\n
\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public interface IInheritdoc\n
\n

Methods

\n

Issue7629()

\n

This method should do something...

\n
void Issue7629()\n
\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue6366.Class1-1.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue6366.Class1-1.html.view.verified.json index fded07982c9..792a838e48a 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue6366.Class1-1.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue6366.Class1-1.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public abstract class Inheritdoc.Issue6366.Class1<T>\n
\n

Type Parameters

\n

T

\n
Inheritance
\n

object ←\nInheritdoc.Issue6366.Class1

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

TestMethod1(T, int)

\n

This text inherited.

\n
public abstract T TestMethod1(T parm1, int parm2)\n
\n

Parameters

\n

parm1 T

\n

This text NOT inherited.

\n

parm2 int

\n

This text inherited.

\n

Returns

\n

T

\n

This text inherited.

\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public abstract class Inheritdoc.Issue6366.Class1<T>\n
\n

Type Parameters

\n

T

\n
Inheritance
\n

object ←\nInheritdoc.Issue6366.Class1<T>

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

TestMethod1(T, int)

\n

This text inherited.

\n
public abstract T TestMethod1(T parm1, int parm2)\n
\n

Parameters

\n

parm1 T

\n

This text NOT inherited.

\n

parm2 int

\n

This text inherited.

\n

Returns

\n

T

\n

This text inherited.

\n", "type": "Conceptual", "source": { "remote": { @@ -25,8 +25,8 @@ "_appName": "Seed", "_appTitle": "docfx seed website", "_enableSearch": true, - "rawTitle": "

Class Inheritdoc.Issue6366.Class1

", - "title": "Class Inheritdoc.Issue6366.Class1", + "rawTitle": "

Class Inheritdoc.Issue6366.Class1<T>

", + "title": "Class Inheritdoc.Issue6366.Class1", "wordCount": 56.0, "_key": "obj/md/BuildFromProject.Inheritdoc.Issue6366.Class1-1.md", "_navKey": "~/toc.yml", diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue6366.Class2.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue6366.Class2.html.view.verified.json index 2d38f7968c7..f981b862130 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue6366.Class2.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue6366.Class2.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Inheritdoc.Issue6366.Class2 : Inheritdoc.Issue6366.Class1<bool>\n
\n
Inheritance
\n

object ←\nInheritdoc.Issue6366.Class1 ←\nInheritdoc.Issue6366.Class2

\n
Inherited Members
\n

Inheritdoc.Issue6366.Class1.TestMethod1(bool, int),\nobject.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

TestMethod1(bool, int)

\n

This text inherited.

\n
public override bool TestMethod1(bool parm1, int parm2)\n
\n

Parameters

\n

parm1 bool

\n

This text NOT inherited.

\n

parm2 int

\n

This text inherited.

\n

Returns

\n

bool

\n

This text inherited.

\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Inheritdoc.Issue6366.Class2 : Inheritdoc.Issue6366.Class1<bool>\n
\n
Inheritance
\n

object ←\nInheritdoc.Issue6366.Class1<bool> ←\nInheritdoc.Issue6366.Class2

\n
Inherited Members
\n

Inheritdoc.Issue6366.Class1<bool>.TestMethod1(bool, int),\nobject.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

TestMethod1(bool, int)

\n

This text inherited.

\n
public override bool TestMethod1(bool parm1, int parm2)\n
\n

Parameters

\n

parm1 bool

\n

This text NOT inherited.

\n

parm2 int

\n

This text inherited.

\n

Returns

\n

bool

\n

This text inherited.

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue7035.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue7035.html.view.verified.json index 45b707f698c..61c0bb597b3 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue7035.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue7035.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Inheritdoc.Issue7035\n
\n
Inheritance
\n

object ←\nInheritdoc.Issue7035

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

A()

\n
public void A()\n
\n

B()

\n
public void B()\n
\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Inheritdoc.Issue7035\n
\n
Inheritance
\n

object ←\nInheritdoc.Issue7035

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

A()

\n
public void A()\n
\n

B()

\n
public void B()\n
\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue7484.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue7484.html.view.verified.json index 67cfad389bc..dc82e879783 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue7484.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue7484.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n

This is a test class to have something for DocFX to document.

\n
public class Inheritdoc.Issue7484\n
\n
Inheritance
\n

object ←\nInheritdoc.Issue7484

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Remarks

\n

We're going to talk about things now.

\n
\nSimple method to generate docs for.\n
\nA string that could have something.\n
\n

Constructors

\n

Issue7484()

\n

This is a constructor to document.

\n
public Issue7484()\n
\n

Properties

\n

DoDad

\n

A string that could have something.

\n
public string DoDad { get; }\n
\n

Property Value

\n

string

\n

Methods

\n

BoolReturningMethod(bool)

\n

Simple method to generate docs for.

\n
public bool BoolReturningMethod(bool source)\n
\n

Parameters

\n

source bool

\n

A meaningless boolean value, much like most questions in the world.

\n

Returns

\n

bool

\n

An exactly equivalently meaningless boolean value, much like most answers in the world.

\n

Remarks

\n

I'd like to take a moment to thank all of those who helped me get to\na place where I can write documentation like this.

\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n

This is a test class to have something for DocFX to document.

\n
public class Inheritdoc.Issue7484\n
\n
Inheritance
\n

object ←\nInheritdoc.Issue7484

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Remarks

\n

We're going to talk about things now.

\n
\nSimple method to generate docs for.\n
\nA string that could have something.\n
\n

Constructors

\n

Issue7484()

\n

This is a constructor to document.

\n
public Issue7484()\n
\n

Properties

\n

DoDad

\n

A string that could have something.

\n
public string DoDad { get; }\n
\n

Property Value

\n

string

\n

Methods

\n

BoolReturningMethod(bool)

\n

Simple method to generate docs for.

\n
public bool BoolReturningMethod(bool source)\n
\n

Parameters

\n

source bool

\n

A meaningless boolean value, much like most questions in the world.

\n

Returns

\n

bool

\n

An exactly equivalently meaningless boolean value, much like most answers in the world.

\n

Remarks

\n

I'd like to take a moment to thank all of those who helped me get to\na place where I can write documentation like this.

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue8101.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue8101.html.view.verified.json index 948c0a50c96..b020c80810f 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue8101.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue8101.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Inheritdoc.Issue8101\n
\n
Inheritance
\n

object ←\nInheritdoc.Issue8101

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Tween(float, float, float, Action)

\n

Create a new tween.

\n
public static object Tween(float from, float to, float duration, Action<float> onChange)\n
\n

Parameters

\n

from float

\n

The starting value.

\n

to float

\n

The end value.

\n

duration float

\n

Total tween duration in seconds.

\n

onChange Action<float>

\n

A callback that will be invoked every time the tween value changes.

\n

Returns

\n

object

\n

The newly created tween instance.

\n

Tween(int, int, float, Action)

\n

Create a new tween.

\n
public static object Tween(int from, int to, float duration, Action<int> onChange)\n
\n

Parameters

\n

from int

\n

The starting value.

\n

to int

\n

The end value.

\n

duration float

\n

Total tween duration in seconds.

\n

onChange Action<int>

\n

A callback that will be invoked every time the tween value changes.

\n

Returns

\n

object

\n

The newly created tween instance.

\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Inheritdoc.Issue8101\n
\n
Inheritance
\n

object ←\nInheritdoc.Issue8101

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Tween(float, float, float, Action<float>)

\n

Create a new tween.

\n
public static object Tween(float from, float to, float duration, Action<float> onChange)\n
\n

Parameters

\n

from float

\n

The starting value.

\n

to float

\n

The end value.

\n

duration float

\n

Total tween duration in seconds.

\n

onChange Action<float>

\n

A callback that will be invoked every time the tween value changes.

\n

Returns

\n

object

\n

The newly created tween instance.

\n

Tween(int, int, float, Action<int>)

\n

Create a new tween.

\n
public static object Tween(int from, int to, float duration, Action<int> onChange)\n
\n

Parameters

\n

from int

\n

The starting value.

\n

to int

\n

The end value.

\n

duration float

\n

Total tween duration in seconds.

\n

onChange Action<int>

\n

A callback that will be invoked every time the tween value changes.

\n

Returns

\n

object

\n

The newly created tween instance.

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue8129.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue8129.html.view.verified.json index b2174b98ad6..355bcc54538 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue8129.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.Issue8129.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public struct Inheritdoc.Issue8129\n
\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Constructors

\n

Issue8129(string)

\n
public Issue8129(string foo)\n
\n

Parameters

\n

foo string

\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public struct Inheritdoc.Issue8129\n
\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Constructors

\n

Issue8129(string)

\n
public Issue8129(string foo)\n
\n

Parameters

\n

foo string

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.html.view.verified.json index 2d4c35fb59b..9563d728918 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.Inheritdoc.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Inheritdoc : IInheritdoc, IDisposable\n
\n
Inheritance
\n

object ←\nInheritdoc

\n
Implements
\n

IInheritdoc,\nIDisposable

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Dispose()

\n

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

\n
public void Dispose()\n
\n

Issue7628()

\n

This method should do something...

\n
public void Issue7628()\n
\n

Issue7629()

\n

This method should do something...

\n
public void Issue7629()\n
\n", + "conceptual": "\n

Namespace: BuildFromProject
\nAssembly: BuildFromProject.dll

\n
public class Inheritdoc : IInheritdoc, IDisposable\n
\n
Inheritance
\n

object ←\nInheritdoc

\n
Implements
\n

IInheritdoc,\nIDisposable

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Dispose()

\n

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

\n
public void Dispose()\n
\n

Issue7628()

\n

This method should do something...

\n
public void Issue7628()\n
\n

Issue7629()

\n

This method should do something...

\n
public void Issue7629()\n
\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.html.view.verified.json index 21827012b7d..848ab83298b 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromProject.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespaces

\n

BuildFromProject.Issue8540

\n

Classes

\n

Class1

\n

Inheritdoc.Issue6366.Class1

\n

Inheritdoc.Issue6366.Class2

\n

Inheritdoc

\n

Inheritdoc.Issue6366

\n

Inheritdoc.Issue7035

\n

Inheritdoc.Issue7484

\n

This is a test class to have something for DocFX to document.

\n

Inheritdoc.Issue8101

\n

Class1.Issue8665

\n

Class1.Issue8696Attribute

\n

Class1.Issue8948

\n

Class1.Test

\n

Structs

\n

Inheritdoc.Issue8129

\n

Interfaces

\n

IInheritdoc

\n

Class1.IIssue8948

\n", + "conceptual": "\n

Namespaces

\n

BuildFromProject.Issue8540

\n

Classes

\n

Inheritdoc.Issue6366.Class1<T>

\n

Class1

\n

Inheritdoc.Issue6366.Class2

\n

Inheritdoc

\n

Inheritdoc.Issue6366

\n

Inheritdoc.Issue7035

\n

Inheritdoc.Issue7484

\n

This is a test class to have something for DocFX to document.

\n

Inheritdoc.Issue8101

\n

Class1.Issue8665

\n

Class1.Issue8696Attribute

\n

Class1.Issue8948

\n

Class1.Test<T>

\n

Structs

\n

Inheritdoc.Issue8129

\n

Interfaces

\n

IInheritdoc

\n

Class1.IIssue8948

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromVBSourceCode.BaseClass1.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromVBSourceCode.BaseClass1.html.view.verified.json index 211e788bd75..1856c4a0de7 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromVBSourceCode.BaseClass1.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromVBSourceCode.BaseClass1.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromVBSourceCode
\nThis is the BaseClass

\n
public abstract class BaseClass1\n
\n
Inheritance
\n

object ←\nBaseClass1

\n
Derived
\n

Class1

\n
Inherited Members
\n

object.Equals(object),\nobject.Equals(object, object),\nobject.Finalize(),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object, object),\nobject.ToString()

\n

Methods

\n

WithDeclarationKeyword(Class1)

\n
public abstract DateTime WithDeclarationKeyword(Class1 keyword)\n
\n

Parameters

\n

keyword Class1

\n

Returns

\n

DateTime

\n", + "conceptual": "\n

Namespace: BuildFromVBSourceCode

\n

This is the BaseClass

\n
public abstract class BaseClass1\n
\n
Inheritance
\n

object ←\nBaseClass1

\n
Derived
\n

Class1

\n
Inherited Members
\n

object.Equals(object),\nobject.Equals(object, object),\nobject.Finalize(),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object, object),\nobject.ToString()

\n

Methods

\n

WithDeclarationKeyword(Class1)

\n
public abstract DateTime WithDeclarationKeyword(Class1 keyword)\n
\n

Parameters

\n

keyword Class1

\n

Returns

\n

DateTime

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromVBSourceCode.Class1.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromVBSourceCode.Class1.html.view.verified.json index a725308be59..ac61d535be4 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromVBSourceCode.Class1.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/BuildFromVBSourceCode.Class1.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: BuildFromVBSourceCode
\nThis is summary from vb class...

\n
public class Class1 : BaseClass1\n
\n
Inheritance
\n

object ←\nBaseClass1 ←\nClass1

\n
Inherited Members
\n

BaseClass1.WithDeclarationKeyword(Class1),\nobject.Equals(object),\nobject.Equals(object, object),\nobject.Finalize(),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object, object),\nobject.ToString()

\n

Fields

\n

ValueClass

\n

This is a Value type

\n
public Class1 ValueClass\n
\n

Field Value

\n

Class1

\n

Properties

\n

Keyword

\n
[Obsolete("This member is obsolete.", true)]\npublic Class1 Keyword { get; }\n
\n

Property Value

\n

Class1

\n

Methods

\n

Value(string)

\n

This is a Function

\n
public int Value(string name)\n
\n

Parameters

\n

name string

\n

Name as the String\nvalue

\n

Returns

\n

int

\n

Returns\nAhooo

\n

WithDeclarationKeyword(Class1)

\n

What is Sub?

\n
public override DateTime WithDeclarationKeyword(Class1 keyword)\n
\n

Parameters

\n

keyword Class1

\n

Returns

\n

DateTime

\n", + "conceptual": "\n

Namespace: BuildFromVBSourceCode

\n

This is summary from vb class...

\n
public class Class1 : BaseClass1\n
\n
Inheritance
\n

object ←\nBaseClass1 ←\nClass1

\n
Inherited Members
\n

BaseClass1.WithDeclarationKeyword(Class1),\nobject.Equals(object),\nobject.Equals(object, object),\nobject.Finalize(),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object, object),\nobject.ToString()

\n

Fields

\n

ValueClass

\n

This is a Value type

\n
public Class1 ValueClass\n
\n

Field Value

\n

Class1

\n

Properties

\n

Keyword

\n
[Obsolete("This member is obsolete.", true)]\npublic Class1 Keyword { get; }\n
\n

Property Value

\n

Class1

\n

Methods

\n

Value(string)

\n

This is a Function

\n
public int Value(string name)\n
\n

Parameters

\n

name string

\n

Name as the String\nvalue

\n

Returns

\n

int

\n

Returns\nAhooo

\n

WithDeclarationKeyword(Class1)

\n

What is Sub?

\n
public override DateTime WithDeclarationKeyword(Class1 keyword)\n
\n

Parameters

\n

keyword Class1

\n

Returns

\n

DateTime

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Cat-2.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Cat-2.html.view.verified.json index 790cb598629..b5566a65f82 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Cat-2.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Cat-2.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Here's main class of this Demo.

\n

You can see mostly type of article within this class and you for more detail, please see the remarks.

\n

\n

this class is a template class. It has two Generic parameter. they are: T and K.

\n

The extension method of this class can refer to class

\n
[Serializable]\npublic class Cat<T, K> : ICat, IAnimal where T : class, new() where K : struct\n
\n

Type Parameters

\n

T

\n

This type should be class and can new instance.

\n

K

\n

This type is a struct type, class type can't be used for this parameter.

\n
Inheritance
\n

object ←\nCat<T, K>

\n
Implements
\n

ICat,\nIAnimal

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n
Extension Methods
\n

ICatExtension.Play(ICat, ContainersRefType.ColorType),\nICatExtension.Sleep(ICat, long)

\n

Examples

\n

Here's example of how to create an instance of this class. As T is limited with class and K is limited with struct.

\n
var a = new Cat(object, int)();\nint catNumber = new int();\nunsafe\n{\n    a.GetFeetLength(catNumber);\n}
\n

As you see, here we bring in pointer so we need to add unsafe keyword.

\n

Remarks

\n

Here's all the content you can see in this class.

\n

Constructors

\n

Cat()

\n

Default constructor.

\n
public Cat()\n
\n

Cat(T)

\n

Constructor with one generic parameter.

\n
public Cat(T ownType)\n
\n

Parameters

\n

ownType T

\n

This parameter type defined by class.

\n

Cat(string, out int, string, bool)

\n

It's a complex constructor. The parameter will have some attributes.

\n
public Cat(string nickName, out int age, string realName, bool isHealthy)\n
\n

Parameters

\n

nickName string

\n

it's string type.

\n

age int

\n

It's an out and ref parameter.

\n

realName string

\n

It's an out paramter.

\n

isHealthy bool

\n

It's an in parameter.

\n

Fields

\n

isHealthy

\n

Field with attribute.

\n
[ContextStatic]\n[NonSerialized]\npublic bool isHealthy\n
\n

Field Value

\n

bool

\n

Properties

\n

Age

\n

Hint cat's age.

\n
protected int Age { get; set; }\n
\n

Property Value

\n

int

\n

Name

\n

EII property.

\n
public string Name { get; }\n
\n

Property Value

\n

string

\n

this[string]

\n

This is index property of Cat. You can see that the visibility is different between get and set method.

\n
public int this[string a] { protected get; set; }\n
\n

Property Value

\n

int

\n

Methods

\n

CalculateFood(DateTime)

\n

It's a method with complex return type.

\n
public Dictionary<string, List<int>> CalculateFood(DateTime date)\n
\n

Parameters

\n

date DateTime

\n

Date time to now.

\n

Returns

\n

Dictionary<string, List<int>>

\n

It's a relationship map of different kind food.

\n

Equals(object)

\n

Override the method of Object.Equals(object obj).

\n
public override bool Equals(object obj)\n
\n

Parameters

\n

obj object

\n

Can pass any class type.

\n

Returns

\n

bool

\n

The return value tell you whehter the compare operation is successful.

\n

GetTailLength(int*, params object[])

\n

It's an unsafe method.\nAs you see, catName is a pointer, so we need to add unsafe keyword.

\n
public long GetTailLength(int* catName, params object[] parameters)\n
\n

Parameters

\n

catName int*

\n

Thie represent for cat name length.

\n

parameters object[]

\n

Optional parameters.

\n

Returns

\n

long

\n

Return cat tail's length.

\n

Jump(T, K, ref bool)

\n

This method have attribute above it.

\n
[Conditional("Debug")]\npublic void Jump(T ownType, K anotherOwnType, ref bool cheat)\n
\n

Parameters

\n

ownType T

\n

Type come from class define.

\n

anotherOwnType K

\n

Type come from class define.

\n

cheat bool

\n

Hint whether this cat has cheat mode.

\n

Exceptions

\n

ArgumentException

\n

This is an argument exception

\n

ownEat

\n

Eat event of this cat

\n
public event EventHandler ownEat\n
\n

Event Type

\n

EventHandler

\n

Operators

\n

operator +(Cat<T, K>, int)

\n

Addition operator of this class.

\n
public static int operator +(Cat<T, K> lsr, int rsr)\n
\n

Parameters

\n

lsr Cat<T, K>

\n

..

\n

rsr int

\n

~~

\n

Returns

\n

int

\n

Result with int type.

\n

explicit operator Tom(Cat<T, K>)

\n

Expilicit operator of this class.

\n

It means this cat can evolve to change to Tom. Tom and Jerry.

\n
public static explicit operator Tom(Cat<T, K> src)\n
\n

Parameters

\n

src Cat<T, K>

\n

Instance of this class.

\n

Returns

\n

Tom

\n

Advanced class type of cat.

\n

operator -(Cat<T, K>, int)

\n

Similar with operaotr +, refer to that topic.

\n
public static int operator -(Cat<T, K> lsr, int rsr)\n
\n

Parameters

\n

lsr Cat<T, K>

\n

rsr int

\n

Returns

\n

int

\n", + "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Here's main class of this Demo.

\n

You can see mostly type of article within this class and you for more detail, please see the remarks.

\n

\n

this class is a template class. It has two Generic parameter. they are: T and K.

\n

The extension method of this class can refer to class

\n
[Serializable]\npublic class Cat<T, K> : ICat, IAnimal where T : class, new() where K : struct\n
\n

Type Parameters

\n

T

\n

This type should be class and can new instance.

\n

K

\n

This type is a struct type, class type can't be used for this parameter.

\n
Inheritance
\n

object ←\nCat<T, K>

\n
Implements
\n

ICat,\nIAnimal

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n
Extension Methods
\n

ICatExtension.Play(ICat, ContainersRefType.ColorType),\nICatExtension.Sleep(ICat, long)

\n

Examples

\n

Here's example of how to create an instance of this class. As T is limited with class and K is limited with struct.

\n
var a = new Cat(object, int)();\nint catNumber = new int();\nunsafe\n{\n    a.GetFeetLength(catNumber);\n}
\n

As you see, here we bring in pointer so we need to add unsafe keyword.

\n

Remarks

\n

Here's all the content you can see in this class.

\n

Constructors

\n

Cat()

\n

Default constructor.

\n
public Cat()\n
\n

Cat(T)

\n

Constructor with one generic parameter.

\n
public Cat(T ownType)\n
\n

Parameters

\n

ownType T

\n

This parameter type defined by class.

\n

Cat(string, out int, string, bool)

\n

It's a complex constructor. The parameter will have some attributes.

\n
public Cat(string nickName, out int age, string realName, bool isHealthy)\n
\n

Parameters

\n

nickName string

\n

it's string type.

\n

age int

\n

It's an out and ref parameter.

\n

realName string

\n

It's an out paramter.

\n

isHealthy bool

\n

It's an in parameter.

\n

Fields

\n

isHealthy

\n

Field with attribute.

\n
[ContextStatic]\n[NonSerialized]\npublic bool isHealthy\n
\n

Field Value

\n

bool

\n

Properties

\n

Age

\n

Hint cat's age.

\n
protected int Age { get; set; }\n
\n

Property Value

\n

int

\n

Name

\n

EII property.

\n
public string Name { get; }\n
\n

Property Value

\n

string

\n

this[string]

\n

This is index property of Cat. You can see that the visibility is different between get and set method.

\n
public int this[string a] { protected get; set; }\n
\n

Property Value

\n

int

\n

Methods

\n

CalculateFood(DateTime)

\n

It's a method with complex return type.

\n
public Dictionary<string, List<int>> CalculateFood(DateTime date)\n
\n

Parameters

\n

date DateTime

\n

Date time to now.

\n

Returns

\n

Dictionary<string, List<int>>

\n

It's a relationship map of different kind food.

\n

Equals(object)

\n

Override the method of Object.Equals(object obj).

\n
public override bool Equals(object obj)\n
\n

Parameters

\n

obj object

\n

Can pass any class type.

\n

Returns

\n

bool

\n

The return value tell you whehter the compare operation is successful.

\n

GetTailLength(int*, params object[])

\n

It's an unsafe method.\nAs you see, catName is a pointer, so we need to add unsafe keyword.

\n
public long GetTailLength(int* catName, params object[] parameters)\n
\n

Parameters

\n

catName int*

\n

Thie represent for cat name length.

\n

parameters object[]

\n

Optional parameters.

\n

Returns

\n

long

\n

Return cat tail's length.

\n

Jump(T, K, ref bool)

\n

This method have attribute above it.

\n
[Conditional("Debug")]\npublic void Jump(T ownType, K anotherOwnType, ref bool cheat)\n
\n

Parameters

\n

ownType T

\n

Type come from class define.

\n

anotherOwnType K

\n

Type come from class define.

\n

cheat bool

\n

Hint whether this cat has cheat mode.

\n

Exceptions

\n

ArgumentException

\n

This is an argument exception

\n

ownEat

\n

Eat event of this cat

\n
public event EventHandler ownEat\n
\n

Event Type

\n

EventHandler

\n

Operators

\n

operator +(Cat<T, K>, int)

\n

Addition operator of this class.

\n
public static int operator +(Cat<T, K> lsr, int rsr)\n
\n

Parameters

\n

lsr Cat<T, K>

\n

..

\n

rsr int

\n

~~

\n

Returns

\n

int

\n

Result with int type.

\n

explicit operator Tom(Cat<T, K>)

\n

Expilicit operator of this class.

\n

It means this cat can evolve to change to Tom. Tom and Jerry.

\n
public static explicit operator Tom(Cat<T, K> src)\n
\n

Parameters

\n

src Cat<T, K>

\n

Instance of this class.

\n

Returns

\n

Tom

\n

Advanced class type of cat.

\n

operator -(Cat<T, K>, int)

\n

Similar with operaotr +, refer to that topic.

\n
public static int operator -(Cat<T, K> lsr, int rsr)\n
\n

Parameters

\n

lsr Cat<T, K>

\n

rsr int

\n

Returns

\n

int

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.CatException-1.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.CatException-1.html.view.verified.json index f9952d39f67..8b6c0cdf55c 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.CatException-1.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.CatException-1.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n
public class CatException<T> : Exception, ISerializable\n
\n

Type Parameters

\n

T

\n
Inheritance
\n

object ←\nException ←\nCatException

\n
Implements
\n

ISerializable

\n
Inherited Members
\n

Exception.GetBaseException(),\nException.GetObjectData(SerializationInfo, StreamingContext),\nException.GetType(),\nException.ToString(),\nException.Data,\nException.HelpLink,\nException.HResult,\nException.InnerException,\nException.Message,\nException.Source,\nException.StackTrace,\nException.TargetSite,\nException.SerializeObjectState,\nobject.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n", + "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n
public class CatException<T> : Exception, ISerializable\n
\n

Type Parameters

\n

T

\n
Inheritance
\n

object ←\nException ←\nCatException<T>

\n
Implements
\n

ISerializable

\n
Inherited Members
\n

Exception.GetBaseException(),\nException.GetObjectData(SerializationInfo, StreamingContext),\nException.GetType(),\nException.ToString(),\nException.Data,\nException.HelpLink,\nException.HResult,\nException.InnerException,\nException.Message,\nException.Source,\nException.StackTrace,\nException.TargetSite,\nException.SerializeObjectState,\nobject.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n", "type": "Conceptual", "source": { "remote": { @@ -25,8 +25,8 @@ "_appName": "Seed", "_appTitle": "docfx seed website", "_enableSearch": true, - "rawTitle": "

Class CatException

", - "title": "Class CatException", + "rawTitle": "

Class CatException<T>

", + "title": "Class CatException", "wordCount": 45.0, "_key": "obj/md/CatLibrary.CatException-1.md", "_navKey": "~/toc.yml", diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Complex-2.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Complex-2.html.view.verified.json index 92379abf4bf..9641d236f9a 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Complex-2.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Complex-2.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n
public class Complex<T, J>\n
\n

Type Parameters

\n

T

\n

J

\n
Inheritance
\n

object ←\nComplex<T, J>

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n", + "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n
public class Complex<T, J>\n
\n

Type Parameters

\n

T

\n

J

\n
Inheritance
\n

object ←\nComplex<T, J>

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.ContainersRefType.ColorType.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.ContainersRefType.ColorType.html.view.verified.json index be5b3191835..13a49df3f56 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.ContainersRefType.ColorType.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.ContainersRefType.ColorType.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary.Core
\nAssembly: CatLibrary.Core.dll

\n

Enumeration ColorType

\n
public enum ContainersRefType.ColorType\n
\n

Fields

\n

Red = 0

\n

red

\n

Blue = 1

\n

blue

\n

Yellow = 2

\n

yellow

\n", + "conceptual": "\n

Namespace: CatLibrary.Core
\nAssembly: CatLibrary.Core.dll

\n

Enumeration ColorType

\n
public enum ContainersRefType.ColorType\n
\n

Fields

\n

Red = 0

\n

red

\n

Blue = 1

\n

blue

\n

Yellow = 2

\n

yellow

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.ContainersRefType.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.ContainersRefType.html.view.verified.json index 0661cb65747..0527bccee9d 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.ContainersRefType.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.ContainersRefType.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary.Core
\nAssembly: CatLibrary.Core.dll

\n

Struct ContainersRefType

\n
public struct ContainersRefType\n
\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n
Extension Methods
\n

Issue231.Bar(ContainersRefType),\nIssue231.Foo(ContainersRefType)

\n

Fields

\n

ColorCount

\n

ColorCount

\n
public long ColorCount\n
\n

Field Value

\n

long

\n

Properties

\n

GetColorCount

\n

GetColorCount

\n
public long GetColorCount { get; }\n
\n

Property Value

\n

long

\n

Methods

\n

ContainersRefTypeNonRefMethod(params object[])

\n

ContainersRefTypeNonRefMethod

\narray\n
public static int ContainersRefTypeNonRefMethod(params object[] parmsArray)\n
\n

Parameters

\n

parmsArray object[]

\n

Returns

\n

int

\n

ContainersRefTypeEventHandler

\n
public event EventHandler ContainersRefTypeEventHandler\n
\n

Event Type

\n

EventHandler

\n", + "conceptual": "\n

Namespace: CatLibrary.Core
\nAssembly: CatLibrary.Core.dll

\n

Struct ContainersRefType

\n
public struct ContainersRefType\n
\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n
Extension Methods
\n

Issue231.Bar(ContainersRefType),\nIssue231.Foo(ContainersRefType)

\n

Fields

\n

ColorCount

\n

ColorCount

\n
public long ColorCount\n
\n

Field Value

\n

long

\n

Properties

\n

GetColorCount

\n

GetColorCount

\n
public long GetColorCount { get; }\n
\n

Property Value

\n

long

\n

Methods

\n

ContainersRefTypeNonRefMethod(params object[])

\n

ContainersRefTypeNonRefMethod

\narray\n
public static int ContainersRefTypeNonRefMethod(params object[] parmsArray)\n
\n

Parameters

\n

parmsArray object[]

\n

Returns

\n

int

\n

ContainersRefTypeEventHandler

\n
public event EventHandler ContainersRefTypeEventHandler\n
\n

Event Type

\n

EventHandler

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.Issue231.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.Issue231.html.view.verified.json index 5d2cee2dcea..394a222ba1c 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.Issue231.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Core.Issue231.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary.Core
\nAssembly: CatLibrary.dll, CatLibrary.Core.dll

\n
public static class Issue231\n
\n
Inheritance
\n

object ←\nIssue231

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Bar(ContainersRefType)

\n
public static void Bar(this ContainersRefType c)\n
\n

Parameters

\n

c ContainersRefType

\n

Foo(ContainersRefType)

\n
public static void Foo(this ContainersRefType c)\n
\n

Parameters

\n

c ContainersRefType

\n", + "conceptual": "\n

Namespace: CatLibrary.Core
\nAssembly: CatLibrary.dll, CatLibrary.Core.dll

\n
public static class Issue231\n
\n
Inheritance
\n

object ←\nIssue231

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Bar(ContainersRefType)

\n
public static void Bar(this ContainersRefType c)\n
\n

Parameters

\n

c ContainersRefType

\n

Foo(ContainersRefType)

\n
public static void Foo(this ContainersRefType c)\n
\n

Parameters

\n

c ContainersRefType

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.FakeDelegate-1.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.FakeDelegate-1.html.view.verified.json index 927ea7774f7..b2d46bdcafa 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.FakeDelegate-1.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.FakeDelegate-1.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Fake delegate

\n
public delegate int FakeDelegate<T>(long num, string name, params object[] scores)\n
\n

Parameters

\n

num long

\n

Fake para

\n

name string

\n

Fake para

\n

scores object[]

\n

Optional Parameter.

\n

Returns

\n

int

\n

Return a fake number to confuse you.

\n

Type Parameters

\n

T

\n

Fake para

\n", + "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Fake delegate

\n
public delegate int FakeDelegate<T>(long num, string name, params object[] scores)\n
\n

Parameters

\n

num long

\n

Fake para

\n

name string

\n

Fake para

\n

scores object[]

\n

Optional Parameter.

\n

Returns

\n

int

\n

Return a fake number to confuse you.

\n

Type Parameters

\n

T

\n

Fake para

\n", "type": "Conceptual", "source": { "remote": { @@ -25,8 +25,8 @@ "_appName": "Seed", "_appTitle": "docfx seed website", "_enableSearch": true, - "rawTitle": "

Delegate FakeDelegate

", - "title": "Delegate FakeDelegate", + "rawTitle": "

Delegate FakeDelegate<T>

", + "title": "Delegate FakeDelegate", "wordCount": 43.0, "_key": "obj/md/CatLibrary.FakeDelegate-1.md", "_navKey": "~/toc.yml", diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.IAnimal.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.IAnimal.html.view.verified.json index af1a27a8302..612baa58e3b 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.IAnimal.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.IAnimal.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

This is basic interface of all animal.

\n
public interface IAnimal\n
\n

Properties

\n

Name

\n

Name of Animal.

\n
string Name { get; }\n
\n

Property Value

\n

string

\n

this[int]

\n

Return specific number animal's name.

\n
string this[int index] { get; }\n
\n

Property Value

\n

string

\n

Methods

\n

Eat()

\n

Animal's eat method.

\n
void Eat()\n
\n

Eat(Tool)

\n

Overload method of eat. This define the animal eat by which tool.

\n
void Eat<Tool>(Tool tool) where Tool : class\n
\n

Parameters

\n

tool Tool

\n

Tool name.

\n

Type Parameters

\n

Tool

\n

It's a class type.

\n

Eat(string)

\n

Feed the animal with some food

\n
void Eat(string food)\n
\n

Parameters

\n

food string

\n

Food to eat

\n", + "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

This is basic interface of all animal.

\n
public interface IAnimal\n
\n

Properties

\n

Name

\n

Name of Animal.

\n
string Name { get; }\n
\n

Property Value

\n

string

\n

this[int]

\n

Return specific number animal's name.

\n
string this[int index] { get; }\n
\n

Property Value

\n

string

\n

Methods

\n

Eat()

\n

Animal's eat method.

\n
void Eat()\n
\n

Eat<Tool>(Tool)

\n

Overload method of eat. This define the animal eat by which tool.

\n
void Eat<Tool>(Tool tool) where Tool : class\n
\n

Parameters

\n

tool Tool

\n

Tool name.

\n

Type Parameters

\n

Tool

\n

It's a class type.

\n

Eat(string)

\n

Feed the animal with some food

\n
void Eat(string food)\n
\n

Parameters

\n

food string

\n

Food to eat

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.ICat.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.ICat.html.view.verified.json index 59104bdc6f2..55231813bf8 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.ICat.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.ICat.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Cat's interface

\n
public interface ICat : IAnimal\n
\n
Implements
\n

IAnimal

\n
Extension Methods
\n

ICatExtension.Play(ICat, ContainersRefType.ColorType),\nICatExtension.Sleep(ICat, long)

\n

eat

\n

eat event of cat. Every cat must implement this event.

\n
event EventHandler eat\n
\n

Event Type

\n

EventHandler

\n", + "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Cat's interface

\n
public interface ICat : IAnimal\n
\n
Implements
\n

IAnimal

\n
Extension Methods
\n

ICatExtension.Play(ICat, ContainersRefType.ColorType),\nICatExtension.Sleep(ICat, long)

\n

eat

\n

eat event of cat. Every cat must implement this event.

\n
event EventHandler eat\n
\n

Event Type

\n

EventHandler

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.ICatExtension.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.ICatExtension.html.view.verified.json index 49db6d0a5ac..839d5a20eb2 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.ICatExtension.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.ICatExtension.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

It's the class that contains ICat interface's extension method.

\n

This class must be public and static.

\n

Also it shouldn't be a geneic class

\n
public static class ICatExtension\n
\n
Inheritance
\n

object ←\nICatExtension

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Play(ICat, ColorType)

\n

Extension method to let cat play

\n
public static void Play(this ICat icat, ContainersRefType.ColorType toy)\n
\n

Parameters

\n

icat ICat

\n

Cat

\n

toy ContainersRefType.ColorType

\n

Something to play

\n

Sleep(ICat, long)

\n

Extension method hint that how long the cat can sleep.

\n
public static void Sleep(this ICat icat, long hours)\n
\n

Parameters

\n

icat ICat

\n

The type will be extended.

\n

hours long

\n

The length of sleep.

\n", + "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

It's the class that contains ICat interface's extension method.

\n

This class must be public and static.

\n

Also it shouldn't be a geneic class

\n
public static class ICatExtension\n
\n
Inheritance
\n

object ←\nICatExtension

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

Play(ICat, ColorType)

\n

Extension method to let cat play

\n
public static void Play(this ICat icat, ContainersRefType.ColorType toy)\n
\n

Parameters

\n

icat ICat

\n

Cat

\n

toy ContainersRefType.ColorType

\n

Something to play

\n

Sleep(ICat, long)

\n

Extension method hint that how long the cat can sleep.

\n
public static void Sleep(this ICat icat, long hours)\n
\n

Parameters

\n

icat ICat

\n

The type will be extended.

\n

hours long

\n

The length of sleep.

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.MRefDelegate-3.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.MRefDelegate-3.html.view.verified.json index 213ac3b8d75..1cc60eaef4b 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.MRefDelegate-3.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.MRefDelegate-3.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Generic delegate with many constrains.

\n
public delegate void MRefDelegate<K, T, L>(K k, T t, L l) where K : class, IComparable where T : struct where L : Tom, IEnumerable<long>\n
\n

Parameters

\n

k K

\n

Type K.

\n

t T

\n

Type T.

\n

l L

\n

Type L.

\n

Type Parameters

\n

K

\n

Generic K.

\n

T

\n

Generic T.

\n

L

\n

Generic L.

\n", + "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Generic delegate with many constrains.

\n
public delegate void MRefDelegate<K, T, L>(K k, T t, L l) where K : class, IComparable where T : struct where L : Tom, IEnumerable<long>\n
\n

Parameters

\n

k K

\n

Type K.

\n

t T

\n

Type T.

\n

l L

\n

Type L.

\n

Type Parameters

\n

K

\n

Generic K.

\n

T

\n

Generic T.

\n

L

\n

Generic L.

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.MRefNormalDelegate.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.MRefNormalDelegate.html.view.verified.json index 4636d3e3e21..0ef282e4183 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.MRefNormalDelegate.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.MRefNormalDelegate.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Delegate in the namespace

\n
public delegate void MRefNormalDelegate(List<string> pics, out string name)\n
\n

Parameters

\n

pics List<string>

\n

a name list of pictures.

\n

name string

\n

give out the needed name.

\n", + "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Delegate in the namespace

\n
public delegate void MRefNormalDelegate(List<string> pics, out string name)\n
\n

Parameters

\n

pics List<string>

\n

a name list of pictures.

\n

name string

\n

give out the needed name.

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Tom.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Tom.html.view.verified.json index 6f832c5e314..1f4f50c44cb 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Tom.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.Tom.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Tom class is only inherit from Object. Not any member inside itself.

\n
public class Tom\n
\n
Inheritance
\n

object ←\nTom

\n
Derived
\n

TomFromBaseClass

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

TomMethod(Complex<TomFromBaseClass, TomFromBaseClass>, Tuple<string, Tom>)

\n

This is a Tom Method with complex type as return

\n
public Complex<string, TomFromBaseClass> TomMethod(Complex<TomFromBaseClass, TomFromBaseClass> a, Tuple<string, Tom> b)\n
\n

Parameters

\n

a Complex<TomFromBaseClass, TomFromBaseClass>

\n

A complex input

\n

b Tuple<string, Tom>

\n

Another complex input

\n

Returns

\n

Complex<string, TomFromBaseClass>

\n

Complex

\n

Exceptions

\n

NotImplementedException

\n

This is not implemented

\n

ArgumentException

\n

This is the exception to be thrown when implemented

\n

CatException

\n

This is the exception in current documentation

\n", + "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

Tom class is only inherit from Object. Not any member inside itself.

\n
public class Tom\n
\n
Inheritance
\n

object ←\nTom

\n
Derived
\n

TomFromBaseClass

\n
Inherited Members
\n

object.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Methods

\n

TomMethod(Complex<TomFromBaseClass, TomFromBaseClass>, Tuple<string, Tom>)

\n

This is a Tom Method with complex type as return

\n
public Complex<string, TomFromBaseClass> TomMethod(Complex<TomFromBaseClass, TomFromBaseClass> a, Tuple<string, Tom> b)\n
\n

Parameters

\n

a Complex<TomFromBaseClass, TomFromBaseClass>

\n

A complex input

\n

b Tuple<string, Tom>

\n

Another complex input

\n

Returns

\n

Complex<string, TomFromBaseClass>

\n

Complex

\n

Exceptions

\n

NotImplementedException

\n

This is not implemented

\n

ArgumentException

\n

This is the exception to be thrown when implemented

\n

CatException<T>

\n

This is the exception in current documentation

\n", "type": "Conceptual", "source": { "remote": { @@ -27,7 +27,7 @@ "_enableSearch": true, "rawTitle": "

Class Tom

", "title": "Class Tom", - "wordCount": 107.0, + "wordCount": 108.0, "_key": "obj/md/CatLibrary.Tom.md", "_navKey": "~/toc.yml", "_navPath": "toc.html", diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.TomFromBaseClass.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.TomFromBaseClass.html.view.verified.json index 5a2ae7a0a03..0b8ab37b7eb 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.TomFromBaseClass.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.TomFromBaseClass.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

TomFromBaseClass inherits from @

\n
public class TomFromBaseClass : Tom\n
\n
Inheritance
\n

object ←\nTom ←\nTomFromBaseClass

\n
Inherited Members
\n

Tom.TomMethod(Complex<TomFromBaseClass, TomFromBaseClass>, Tuple<string, Tom>),\nobject.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Constructors

\n

TomFromBaseClass(int)

\n

This is a #ctor with parameter

\n
public TomFromBaseClass(int k)\n
\n

Parameters

\n

k int

\n", + "conceptual": "\n

Namespace: CatLibrary
\nAssembly: CatLibrary.dll

\n

TomFromBaseClass inherits from @

\n
public class TomFromBaseClass : Tom\n
\n
Inheritance
\n

object ←\nTom ←\nTomFromBaseClass

\n
Inherited Members
\n

Tom.TomMethod(Complex<TomFromBaseClass, TomFromBaseClass>, Tuple<string, Tom>),\nobject.Equals(object?),\nobject.Equals(object?, object?),\nobject.GetHashCode(),\nobject.GetType(),\nobject.MemberwiseClone(),\nobject.ReferenceEquals(object?, object?),\nobject.ToString()

\n

Constructors

\n

TomFromBaseClass(int)

\n

This is a #ctor with parameter

\n
public TomFromBaseClass(int k)\n
\n

Parameters

\n

k int

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.html.view.verified.json index 3cb5473fc4a..06661454e9b 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/CatLibrary.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespaces

\n

CatLibrary.Core

\n

Classes

\n

Cat<T, K>

\n

Here's main class of this Demo.

\n

You can see mostly type of article within this class and you for more detail, please see the remarks.

\n

\n

this class is a template class. It has two Generic parameter. they are: T and K.

\n

The extension method of this class can refer to class

\n

CatException

\n

Complex<T, J>

\n

ICatExtension

\n

It's the class that contains ICat interface's extension method.

\n

This class must be public and static.

\n

Also it shouldn't be a geneic class

\n

Tom

\n

Tom class is only inherit from Object. Not any member inside itself.

\n

TomFromBaseClass

\n

TomFromBaseClass inherits from @

\n

Interfaces

\n

IAnimal

\n

This is basic interface of all animal.

\n

ICat

\n

Cat's interface

\n

Delegates

\n

FakeDelegate

\n

Fake delegate

\n

MRefDelegate<K, T, L>

\n

Generic delegate with many constrains.

\n

MRefNormalDelegate

\n

Delegate in the namespace

\n", + "conceptual": "\n

Namespaces

\n

CatLibrary.Core

\n

Classes

\n

Cat<T, K>

\n

Here's main class of this Demo.

\n

You can see mostly type of article within this class and you for more detail, please see the remarks.

\n

\n

this class is a template class. It has two Generic parameter. they are: T and K.

\n

The extension method of this class can refer to class

\n

CatException<T>

\n

Complex<T, J>

\n

ICatExtension

\n

It's the class that contains ICat interface's extension method.

\n

This class must be public and static.

\n

Also it shouldn't be a geneic class

\n

Tom

\n

Tom class is only inherit from Object. Not any member inside itself.

\n

TomFromBaseClass

\n

TomFromBaseClass inherits from @

\n

Interfaces

\n

IAnimal

\n

This is basic interface of all animal.

\n

ICat

\n

Cat's interface

\n

Delegates

\n

FakeDelegate<T>

\n

Fake delegate

\n

MRefDelegate<K, T, L>

\n

Generic delegate with many constrains.

\n

MRefNormalDelegate

\n

Delegate in the namespace

\n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/MRef.Demo.Enumeration.ColorType.html.view.verified.json b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/MRef.Demo.Enumeration.ColorType.html.view.verified.json index 113ee163795..d09c89c1dd1 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/MRef.Demo.Enumeration.ColorType.html.view.verified.json +++ b/test/docfx.Snapshot.Tests/SamplesTest.Seed/md/MRef.Demo.Enumeration.ColorType.html.view.verified.json @@ -1,5 +1,5 @@ { - "conceptual": "\n

Namespace: MRef.Demo.Enumeration
\nAssembly: CatLibrary.dll

\n

Enumeration ColorType

\n
public enum ColorType\n
\n

Fields

\n

Red = 0

\n

this color is red

\n

Blue = 1

\n

blue like river

\n

Yellow = 2

\n

yellow comes from desert

\n

Remarks

\n

\nRed/Blue/Yellow can become all color you want.\n

\n
    \n

    See Also

    \n

    object

    \n", + "conceptual": "\n

    Namespace: MRef.Demo.Enumeration
    \nAssembly: CatLibrary.dll

    \n

    Enumeration ColorType

    \n
    public enum ColorType\n
    \n

    Fields

    \n

    Red = 0

    \n

    this color is red

    \n

    Blue = 1

    \n

    blue like river

    \n

    Yellow = 2

    \n

    yellow comes from desert

    \n

    Remarks

    \n

    \nRed/Blue/Yellow can become all color you want.\n

    \n
      \n

      See Also

      \n

      object

      \n", "type": "Conceptual", "source": { "remote": { diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromAssembly.Class1.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromAssembly.Class1.verified.md new file mode 100644 index 00000000000..85c732bdd9f --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromAssembly.Class1.verified.md @@ -0,0 +1,44 @@ +# Class Class1 + +Namespace: [BuildFromAssembly](BuildFromAssembly.md) +Assembly: BuildFromAssembly.dll + +This is a test class. + +```csharp +public class Class1 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Class1](BuildFromAssembly.Class1.md) + +###### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### Class1\(\) + +```csharp +public Class1() +``` + +## Methods + +### HelloWorld\(\) + +Hello World. + +```csharp +public static void HelloWorld() +``` + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromAssembly.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromAssembly.verified.md new file mode 100644 index 00000000000..479d572088c --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromAssembly.verified.md @@ -0,0 +1,8 @@ +# Namespace BuildFromAssembly + +### Classes + +[Class1](BuildFromAssembly.Class1.md) + +This is a test class. + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromCSharpSourceCode.CSharp.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromCSharpSourceCode.CSharp.verified.md new file mode 100644 index 00000000000..e4b4ea0b84c --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromCSharpSourceCode.CSharp.verified.md @@ -0,0 +1,35 @@ +# Class CSharp + +Namespace: [BuildFromCSharpSourceCode](BuildFromCSharpSourceCode.md) + +```csharp +public class CSharp +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[CSharp](BuildFromCSharpSourceCode.CSharp.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### Main\(string\[\]\) + +```csharp +public static void Main(string[] args) +``` + +#### Parameters + +`args` [string](https://learn.microsoft.com/dotnet/api/system.string)\[\] + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromCSharpSourceCode.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromCSharpSourceCode.verified.md new file mode 100644 index 00000000000..61cfc44de41 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromCSharpSourceCode.verified.md @@ -0,0 +1,6 @@ +# Namespace BuildFromCSharpSourceCode + +### Classes + +[CSharp](BuildFromCSharpSourceCode.CSharp.md) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.IIssue8948.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.IIssue8948.verified.md new file mode 100644 index 00000000000..e6b42e045d7 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.IIssue8948.verified.md @@ -0,0 +1,25 @@ +# Interface Class1.IIssue8948 + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public interface Class1.IIssue8948 +``` + +## Methods + +### DoNothing\(\) + +Does nothing with generic type T. + +```csharp +void DoNothing() +``` + +#### Type Parameters + +`T` + +A generic type. + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Issue8665.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Issue8665.verified.md new file mode 100644 index 00000000000..16320abcf2b --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Issue8665.verified.md @@ -0,0 +1,100 @@ +# Class Class1.Issue8665 + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public class Class1.Issue8665 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Class1.Issue8665](BuildFromProject.Class1.Issue8665.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Constructors + +### Issue8665\(\) + +```csharp +public Issue8665() +``` + +### Issue8665\(int\) + +```csharp +public Issue8665(int foo) +``` + +#### Parameters + +`foo` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### Issue8665\(int, char\) + +```csharp +public Issue8665(int foo, char bar) +``` + +#### Parameters + +`foo` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`bar` [char](https://learn.microsoft.com/dotnet/api/system.char) + +### Issue8665\(int, char, string\) + +```csharp +public Issue8665(int foo, char bar, string baz) +``` + +#### Parameters + +`foo` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`bar` [char](https://learn.microsoft.com/dotnet/api/system.char) + +`baz` [string](https://learn.microsoft.com/dotnet/api/system.string) + +## Properties + +### Bar + +```csharp +public char Bar { get; } +``` + +#### Property Value + +[char](https://learn.microsoft.com/dotnet/api/system.char) + +### Baz + +```csharp +public string Baz { get; } +``` + +#### Property Value + +[string](https://learn.microsoft.com/dotnet/api/system.string) + +### Foo + +```csharp +public int Foo { get; } +``` + +#### Property Value + +[int](https://learn.microsoft.com/dotnet/api/system.int32) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Issue8696Attribute.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Issue8696Attribute.verified.md new file mode 100644 index 00000000000..0632f5c4675 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Issue8696Attribute.verified.md @@ -0,0 +1,85 @@ +# Class Class1.Issue8696Attribute + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public class Class1.Issue8696Attribute : Attribute +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Attribute](https://learn.microsoft.com/dotnet/api/system.attribute) ← +[Class1.Issue8696Attribute](BuildFromProject.Class1.Issue8696Attribute.md) + +###### Inherited Members + +[Attribute.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.equals), +[Attribute.GetCustomAttribute\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttribute\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttribute\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\)), +[Attribute.GetCustomAttributes\(Assembly, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttributes\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(MemberInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\)), +[Attribute.GetCustomAttributes\(MemberInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-boolean\)), +[Attribute.GetCustomAttributes\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\)), +[Attribute.GetCustomAttributes\(Module, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttributes\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\)), +[Attribute.GetCustomAttributes\(ParameterInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.gethashcode), +[Attribute.IsDefaultAttribute\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefaultattribute), +[Attribute.IsDefined\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\)), +[Attribute.IsDefined\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.IsDefined\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.IsDefined\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.IsDefined\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\)), +[Attribute.IsDefined\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.IsDefined\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.IsDefined\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.Match\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.match), +[Attribute.TypeId](https://learn.microsoft.com/dotnet/api/system.attribute.typeid), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Constructors + +### Issue8696Attribute\(string?, int, int, string\[\]?, bool, Type?\) + +```csharp +[Class1.Issue8696("Changes the name of the server in the server list", 0, 0, null, false, null)] +public Issue8696Attribute(string? description = null, int boundsMin = 0, int boundsMax = 0, string[]? validGameModes = null, bool hasMultipleSelections = false, Type? enumType = null) +``` + +#### Parameters + +`description` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +`boundsMin` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`boundsMax` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`validGameModes` [string](https://learn.microsoft.com/dotnet/api/system.string)\[\]? + +`hasMultipleSelections` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +`enumType` [Type](https://learn.microsoft.com/dotnet/api/system.type)? + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Issue8948.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Issue8948.verified.md new file mode 100644 index 00000000000..cb89fe21be4 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Issue8948.verified.md @@ -0,0 +1,44 @@ +# Class Class1.Issue8948 + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public class Class1.Issue8948 : Class1.IIssue8948 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Class1.Issue8948](BuildFromProject.Class1.Issue8948.md) + +###### Implements + +[Class1.IIssue8948](BuildFromProject.Class1.IIssue8948.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### DoNothing\(\) + +Does nothing with generic type T. + +```csharp +public void DoNothing() +``` + +#### Type Parameters + +`T` + +A generic type. + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Test-1.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Test-1.verified.md new file mode 100644 index 00000000000..5a0484a32fe --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.Test-1.verified.md @@ -0,0 +1,28 @@ +# Class Class1.Test + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public class Class1.Test +``` + +#### Type Parameters + +`T` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Class1.Test](BuildFromProject.Class1.Test\-1.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.verified.md new file mode 100644 index 00000000000..43297f814ef --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Class1.verified.md @@ -0,0 +1,202 @@ +# Class Class1 + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public class Class1 : IClass1 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Class1](BuildFromProject.Class1.md) + +###### Implements + +IClass1 + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### Issue1651\(\) + +Pricing models are used to calculate theoretical option values +
      • 1Black Scholes
      • 2Black76
      • 3Black76Fut
      • 4Equity Tree
      • 5Variance Swap
      • 6Dividend Forecast
      + +```csharp +public void Issue1651() +``` + +### Issue1887\(\) + +IConfiguration related helper and extension routines. + +```csharp +public void Issue1887() +``` + +### Issue2623\(\) + +```csharp +public void Issue2623() +``` + +#### Examples + +```csharp +MyClass myClass = new MyClass(); + +void Update() +{ + myClass.Execute(); +} +``` + +#### Remarks + +For example: + + MyClass myClass = new MyClass(); + + void Update() + { + myClass.Execute(); + } + +### Issue2723\(\) + +```csharp +public void Issue2723() +``` + +#### Remarks + +> [!NOTE] +> This is a <note>. & " ' + +Inline ``. + +[link](https://www.github.com "title") + +```csharp +for (var i = 0; i > 10; i++) // & " ' +var range = new Range { Min = 0, Max = 10 }; +``` + +
      var range = new Range<int> { Min = 0, Max = 10 };
      + +### Issue4017\(\) + +```csharp +public void Issue4017() +``` + +#### Examples + +
      public void HookMessageDeleted(BaseSocketClient client)
      +{
      +    client.MessageDeleted += HandleMessageDelete;
      +}
      +
      +public Task HandleMessageDelete(Cacheable<IMessage, ulong> cachedMessage, ISocketMessageChannel channel)
      +{
      +    // check if the message exists in cache; if not, we cannot report what was removed
      +    if (!cachedMessage.HasValue) return;
      +    var message = cachedMessage.Value;
      +    Console.WriteLine($"A message ({message.Id}) from {message.Author} was removed from the channel {channel.Name} ({channel.Id}):"
      +        + Environment.NewLine
      +        + message.Content);
      +    return Task.CompletedTask;
      +}
      + +#### Remarks + +
      void Update()
      +{
      +    myClass.Execute();
      +}
      + +### Issue4392\(\) + +```csharp +public void Issue4392() +``` + +#### Remarks + +@"\\?\" `@"\\?\"` + +### Issue7484\(\) + +```csharp +public void Issue7484() +``` + +#### Remarks + +There's really no reason to not believe that this class can test things. +
      TermDescription
      A TermA Description
      Bee TermBee Description
      + +### Issue8764\(\) + +```csharp +public void Issue8764() where T : unmanaged +``` + +#### Type Parameters + +`T` + +### Issue896\(\) + +Test + +```csharp +public void Issue896() +``` + +#### See Also + +[Class1](BuildFromProject.Class1.md).[Test](BuildFromProject.Class1.Test\-1.md) +[Class1](BuildFromProject.Class1.md) + +### Issue9216\(\) + +Calculates the determinant of a 3-dimensional matrix: + +$$A = \begin{vmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{vmatrix}$$ + +Returns the smallest value: + +$$\left\{\begin{matrix}a, aa\\ \end{matrix} \right.$$ + +```csharp +public static double Issue9216() +``` + +#### Returns + +[double](https://learn.microsoft.com/dotnet/api/system.double) + +### XmlCommentIncludeTag\(\) + +This method should do something... + +```csharp +public void XmlCommentIncludeTag() +``` + +#### Remarks + +This is remarks. + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.IInheritdoc.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.IInheritdoc.verified.md new file mode 100644 index 00000000000..06d10f9501d --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.IInheritdoc.verified.md @@ -0,0 +1,19 @@ +# Interface IInheritdoc + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public interface IInheritdoc +``` + +## Methods + +### Issue7629\(\) + +This method should do something... + +```csharp +void Issue7629() +``` + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue6366.Class1-1.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue6366.Class1-1.verified.md new file mode 100644 index 00000000000..eb099b1a84e --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue6366.Class1-1.verified.md @@ -0,0 +1,54 @@ +# Class Inheritdoc.Issue6366.Class1 + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public abstract class Inheritdoc.Issue6366.Class1 +``` + +#### Type Parameters + +`T` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Inheritdoc.Issue6366.Class1](BuildFromProject.Inheritdoc.Issue6366.Class1\-1.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### TestMethod1\(T, int\) + +This text inherited. + +```csharp +public abstract T TestMethod1(T parm1, int parm2) +``` + +#### Parameters + +`parm1` T + +This text NOT inherited. + +`parm2` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +This text inherited. + +#### Returns + +T + +This text inherited. + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue6366.Class2.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue6366.Class2.verified.md new file mode 100644 index 00000000000..e106c06586f --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue6366.Class2.verified.md @@ -0,0 +1,52 @@ +# Class Inheritdoc.Issue6366.Class2 + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public class Inheritdoc.Issue6366.Class2 : Inheritdoc.Issue6366.Class1 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Inheritdoc.Issue6366.Class1](BuildFromProject.Inheritdoc.Issue6366.Class1\-1.md) ← +[Inheritdoc.Issue6366.Class2](BuildFromProject.Inheritdoc.Issue6366.Class2.md) + +###### Inherited Members + +[Inheritdoc.Issue6366.Class1.TestMethod1\(bool, int\)](BuildFromProject.Inheritdoc.Issue6366.Class1\-1.md\#BuildFromProject\_Inheritdoc\_Issue6366\_Class1\_1\_TestMethod1\_\_0\_System\_Int32\_), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### TestMethod1\(bool, int\) + +This text inherited. + +```csharp +public override bool TestMethod1(bool parm1, int parm2) +``` + +#### Parameters + +`parm1` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +This text NOT inherited. + +`parm2` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +This text inherited. + +#### Returns + +[bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +This text inherited. + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue6366.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue6366.verified.md new file mode 100644 index 00000000000..7d7845bccf5 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue6366.verified.md @@ -0,0 +1,24 @@ +# Class Inheritdoc.Issue6366 + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public class Inheritdoc.Issue6366 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Inheritdoc.Issue6366](BuildFromProject.Inheritdoc.Issue6366.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue7035.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue7035.verified.md new file mode 100644 index 00000000000..26b30421e5f --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue7035.verified.md @@ -0,0 +1,38 @@ +# Class Inheritdoc.Issue7035 + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public class Inheritdoc.Issue7035 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Inheritdoc.Issue7035](BuildFromProject.Inheritdoc.Issue7035.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### A\(\) + +```csharp +public void A() +``` + +### B\(\) + +```csharp +public void B() +``` + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue7484.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue7484.verified.md new file mode 100644 index 00000000000..bed9b11dc3e --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue7484.verified.md @@ -0,0 +1,86 @@ +# Class Inheritdoc.Issue7484 + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +This is a test class to have something for DocFX to document. + +```csharp +public class Inheritdoc.Issue7484 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Inheritdoc.Issue7484](BuildFromProject.Inheritdoc.Issue7484.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Remarks + +We're going to talk about things now. +
      +Simple method to generate docs for. +
      +A string that could have something. +
      + +## Constructors + +### Issue7484\(\) + +This is a constructor to document. + +```csharp +public Issue7484() +``` + +## Properties + +### DoDad + +A string that could have something. + +```csharp +public string DoDad { get; } +``` + +#### Property Value + +[string](https://learn.microsoft.com/dotnet/api/system.string) + +## Methods + +### BoolReturningMethod\(bool\) + +Simple method to generate docs for. + +```csharp +public bool BoolReturningMethod(bool source) +``` + +#### Parameters + +`source` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +A meaningless boolean value, much like most questions in the world. + +#### Returns + +[bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +An exactly equivalently meaningless boolean value, much like most answers in the world. + +#### Remarks + +I'd like to take a moment to thank all of those who helped me get to +a place where I can write documentation like this. + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue8101.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue8101.verified.md new file mode 100644 index 00000000000..daa5b06615e --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue8101.verified.md @@ -0,0 +1,90 @@ +# Class Inheritdoc.Issue8101 + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public class Inheritdoc.Issue8101 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Inheritdoc.Issue8101](BuildFromProject.Inheritdoc.Issue8101.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### Tween\(float, float, float, Action\) + +Create a new tween. + +```csharp +public static object Tween(float from, float to, float duration, Action onChange) +``` + +#### Parameters + +`from` [float](https://learn.microsoft.com/dotnet/api/system.single) + +The starting value. + +`to` [float](https://learn.microsoft.com/dotnet/api/system.single) + +The end value. + +`duration` [float](https://learn.microsoft.com/dotnet/api/system.single) + +Total tween duration in seconds. + +`onChange` [Action](https://learn.microsoft.com/dotnet/api/system.action\-1)<[float](https://learn.microsoft.com/dotnet/api/system.single)\> + +A callback that will be invoked every time the tween value changes. + +#### Returns + +[object](https://learn.microsoft.com/dotnet/api/system.object) + +The newly created tween instance. + +### Tween\(int, int, float, Action\) + +Create a new tween. + +```csharp +public static object Tween(int from, int to, float duration, Action onChange) +``` + +#### Parameters + +`from` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +The starting value. + +`to` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +The end value. + +`duration` [float](https://learn.microsoft.com/dotnet/api/system.single) + +Total tween duration in seconds. + +`onChange` [Action](https://learn.microsoft.com/dotnet/api/system.action\-1)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\> + +A callback that will be invoked every time the tween value changes. + +#### Returns + +[object](https://learn.microsoft.com/dotnet/api/system.object) + +The newly created tween instance. + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue8129.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue8129.verified.md new file mode 100644 index 00000000000..60c15be505e --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.Issue8129.verified.md @@ -0,0 +1,30 @@ +# Struct Inheritdoc.Issue8129 + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public struct Inheritdoc.Issue8129 +``` + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Constructors + +### Issue8129\(string\) + +```csharp +public Issue8129(string foo) +``` + +#### Parameters + +`foo` [string](https://learn.microsoft.com/dotnet/api/system.string) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.verified.md new file mode 100644 index 00000000000..885789ae020 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Inheritdoc.verified.md @@ -0,0 +1,55 @@ +# Class Inheritdoc + +Namespace: [BuildFromProject](BuildFromProject.md) +Assembly: BuildFromProject.dll + +```csharp +public class Inheritdoc : IInheritdoc, IDisposable +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Inheritdoc](BuildFromProject.Inheritdoc.md) + +###### Implements + +[IInheritdoc](BuildFromProject.IInheritdoc.md), +[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### Dispose\(\) + +Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + +```csharp +public void Dispose() +``` + +### Issue7628\(\) + +This method should do something... + +```csharp +public void Issue7628() +``` + +### Issue7629\(\) + +This method should do something... + +```csharp +public void Issue7629() +``` + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.A.A.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.A.A.verified.md new file mode 100644 index 00000000000..dd2aed7cf69 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.A.A.verified.md @@ -0,0 +1,24 @@ +# Class A + +Namespace: [BuildFromProject.Issue8540.A](BuildFromProject.Issue8540.A.md) +Assembly: BuildFromProject.dll + +```csharp +public class A +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[A](BuildFromProject.Issue8540.A.A.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.A.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.A.verified.md new file mode 100644 index 00000000000..2631a9836b8 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.A.verified.md @@ -0,0 +1,6 @@ +# Namespace BuildFromProject.Issue8540.A + +### Classes + +[A](BuildFromProject.Issue8540.A.A.md) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.B.B.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.B.B.verified.md new file mode 100644 index 00000000000..d3d78bdcea0 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.B.B.verified.md @@ -0,0 +1,24 @@ +# Class B + +Namespace: [BuildFromProject.Issue8540.B](BuildFromProject.Issue8540.B.md) +Assembly: BuildFromProject.dll + +```csharp +public class B +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[B](BuildFromProject.Issue8540.B.B.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.B.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.B.verified.md new file mode 100644 index 00000000000..32af83dd3a3 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.B.verified.md @@ -0,0 +1,6 @@ +# Namespace BuildFromProject.Issue8540.B + +### Classes + +[B](BuildFromProject.Issue8540.B.B.md) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.verified.md new file mode 100644 index 00000000000..c2d031df469 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.Issue8540.verified.md @@ -0,0 +1,8 @@ +# Namespace BuildFromProject.Issue8540 + +### Namespaces + +[BuildFromProject.Issue8540.A](BuildFromProject.Issue8540.A.md) + +[BuildFromProject.Issue8540.B](BuildFromProject.Issue8540.B.md) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.verified.md new file mode 100644 index 00000000000..784ebcdd466 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromProject.verified.md @@ -0,0 +1,44 @@ +# Namespace BuildFromProject + +### Namespaces + +[BuildFromProject.Issue8540](BuildFromProject.Issue8540.md) + +### Classes + +[Inheritdoc.Issue6366.Class1](BuildFromProject.Inheritdoc.Issue6366.Class1\-1.md) + +[Class1](BuildFromProject.Class1.md) + +[Inheritdoc.Issue6366.Class2](BuildFromProject.Inheritdoc.Issue6366.Class2.md) + +[Inheritdoc](BuildFromProject.Inheritdoc.md) + +[Inheritdoc.Issue6366](BuildFromProject.Inheritdoc.Issue6366.md) + +[Inheritdoc.Issue7035](BuildFromProject.Inheritdoc.Issue7035.md) + +[Inheritdoc.Issue7484](BuildFromProject.Inheritdoc.Issue7484.md) + +This is a test class to have something for DocFX to document. + +[Inheritdoc.Issue8101](BuildFromProject.Inheritdoc.Issue8101.md) + +[Class1.Issue8665](BuildFromProject.Class1.Issue8665.md) + +[Class1.Issue8696Attribute](BuildFromProject.Class1.Issue8696Attribute.md) + +[Class1.Issue8948](BuildFromProject.Class1.Issue8948.md) + +[Class1.Test](BuildFromProject.Class1.Test\-1.md) + +### Structs + +[Inheritdoc.Issue8129](BuildFromProject.Inheritdoc.Issue8129.md) + +### Interfaces + +[IInheritdoc](BuildFromProject.IInheritdoc.md) + +[Class1.IIssue8948](BuildFromProject.Class1.IIssue8948.md) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromVBSourceCode.BaseClass1.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromVBSourceCode.BaseClass1.verified.md new file mode 100644 index 00000000000..02e2b0f39e4 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromVBSourceCode.BaseClass1.verified.md @@ -0,0 +1,46 @@ +# Class BaseClass1 + +Namespace: [BuildFromVBSourceCode](BuildFromVBSourceCode.md) + +This is the BaseClass + +```csharp +public abstract class BaseClass1 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[BaseClass1](BuildFromVBSourceCode.BaseClass1.md) + +###### Derived + +[Class1](BuildFromVBSourceCode.Class1.md) + +###### Inherited Members + +[object.Equals\(object\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object, object\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.Finalize\(\)](https://learn.microsoft.com/dotnet/api/system.object.finalize), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object, object\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### WithDeclarationKeyword\(Class1\) + +```csharp +public abstract DateTime WithDeclarationKeyword(Class1 keyword) +``` + +#### Parameters + +`keyword` [Class1](BuildFromVBSourceCode.Class1.md) + +#### Returns + +[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromVBSourceCode.Class1.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromVBSourceCode.Class1.verified.md new file mode 100644 index 00000000000..80cc2fa42e0 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromVBSourceCode.Class1.verified.md @@ -0,0 +1,95 @@ +# Class Class1 + +Namespace: [BuildFromVBSourceCode](BuildFromVBSourceCode.md) + +This is summary from vb class... + +```csharp +public class Class1 : BaseClass1 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[BaseClass1](BuildFromVBSourceCode.BaseClass1.md) ← +[Class1](BuildFromVBSourceCode.Class1.md) + +###### Inherited Members + +[BaseClass1.WithDeclarationKeyword\(Class1\)](BuildFromVBSourceCode.BaseClass1.md\#BuildFromVBSourceCode\_BaseClass1\_WithDeclarationKeyword\_BuildFromVBSourceCode\_Class1\_), +[object.Equals\(object\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object, object\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.Finalize\(\)](https://learn.microsoft.com/dotnet/api/system.object.finalize), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object, object\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Fields + +### ValueClass + +This is a *Value* type + +```csharp +public Class1 ValueClass +``` + +#### Field Value + +[Class1](BuildFromVBSourceCode.Class1.md) + +## Properties + +### Keyword + +```csharp +[Obsolete("This member is obsolete.", true)] +public Class1 Keyword { get; } +``` + +#### Property Value + +[Class1](BuildFromVBSourceCode.Class1.md) + +## Methods + +### Value\(string\) + +This is a *Function* + +```csharp +public int Value(string name) +``` + +#### Parameters + +`name` [string](https://learn.microsoft.com/dotnet/api/system.string) + +Name as the **String** + value + +#### Returns + +[int](https://learn.microsoft.com/dotnet/api/system.int32) + +**Returns** + Ahooo + +### WithDeclarationKeyword\(Class1\) + +What is **Sub**? + +```csharp +public override DateTime WithDeclarationKeyword(Class1 keyword) +``` + +#### Parameters + +`keyword` [Class1](BuildFromVBSourceCode.Class1.md) + +#### Returns + +[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromVBSourceCode.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromVBSourceCode.verified.md new file mode 100644 index 00000000000..e0e599d9f66 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/BuildFromVBSourceCode.verified.md @@ -0,0 +1,12 @@ +# Namespace BuildFromVBSourceCode + +### Classes + +[BaseClass1](BuildFromVBSourceCode.BaseClass1.md) + +This is the BaseClass + +[Class1](BuildFromVBSourceCode.Class1.md) + +This is summary from vb class... + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Cat-2.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Cat-2.verified.md new file mode 100644 index 00000000000..1b3d98a5d5d --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Cat-2.verified.md @@ -0,0 +1,343 @@ +# Class Cat + +Namespace: [CatLibrary](CatLibrary.md) +Assembly: CatLibrary.dll + +

      Here's main class of this Demo.

      +

      You can see mostly type of article within this class and you for more detail, please see the remarks.

      +

      +

      this class is a template class. It has two Generic parameter. they are: T and K.

      +

      The extension method of this class can refer to class

      + +```csharp +[Serializable] +public class Cat : ICat, IAnimal where T : class, new() where K : struct +``` + +#### Type Parameters + +`T` + +This type should be class and can new instance. + +`K` + +This type is a struct type, class type can't be used for this parameter. + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Cat](CatLibrary.Cat\-2.md) + +###### Implements + +[ICat](CatLibrary.ICat.md), +[IAnimal](CatLibrary.IAnimal.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +###### Extension Methods + +[ICatExtension.Play\(ICat, ContainersRefType.ColorType\)](CatLibrary.ICatExtension.md\#CatLibrary\_ICatExtension\_Play\_CatLibrary\_ICat\_CatLibrary\_Core\_ContainersRefType\_ColorType\_), +[ICatExtension.Sleep\(ICat, long\)](CatLibrary.ICatExtension.md\#CatLibrary\_ICatExtension\_Sleep\_CatLibrary\_ICat\_System\_Int64\_) + +## Examples + +

      Here's example of how to create an instance of this class. As T is limited with class and K is limited with struct.

      +
      var a = new Cat(object, int)();
      +int catNumber = new int();
      +unsafe
      +{
      +    a.GetFeetLength(catNumber);
      +}
      +

      As you see, here we bring in pointer so we need to add unsafe keyword.

      + +## Remarks + +

      Here's all the content you can see in this class.

      + +## Constructors + +### Cat\(\) + +Default constructor. + +```csharp +public Cat() +``` + +### Cat\(T\) + +Constructor with one generic parameter. + +```csharp +public Cat(T ownType) +``` + +#### Parameters + +`ownType` T + +This parameter type defined by class. + +### Cat\(string, out int, string, bool\) + +It's a complex constructor. The parameter will have some attributes. + +```csharp +public Cat(string nickName, out int age, string realName, bool isHealthy) +``` + +#### Parameters + +`nickName` [string](https://learn.microsoft.com/dotnet/api/system.string) + +it's string type. + +`age` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +It's an out and ref parameter. + +`realName` [string](https://learn.microsoft.com/dotnet/api/system.string) + +It's an out paramter. + +`isHealthy` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +It's an in parameter. + +## Fields + +### isHealthy + +Field with attribute. + +```csharp +[ContextStatic] +[NonSerialized] +public bool isHealthy +``` + +#### Field Value + +[bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +## Properties + +### Age + +Hint cat's age. + +```csharp +protected int Age { get; set; } +``` + +#### Property Value + +[int](https://learn.microsoft.com/dotnet/api/system.int32) + +### Name + +EII property. + +```csharp +public string Name { get; } +``` + +#### Property Value + +[string](https://learn.microsoft.com/dotnet/api/system.string) + +### this\[string\] + +This is index property of Cat. You can see that the visibility is different between get and set method. + +```csharp +public int this[string a] { protected get; set; } +``` + +#### Property Value + +[int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Methods + +### CalculateFood\(DateTime\) + +It's a method with complex return type. + +```csharp +public Dictionary> CalculateFood(DateTime date) +``` + +#### Parameters + +`date` [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) + +Date time to now. + +#### Returns + +[Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\>\> + +It's a relationship map of different kind food. + +### Equals\(object\) + +Override the method of Object.Equals(object obj). + +```csharp +public override bool Equals(object obj) +``` + +#### Parameters + +`obj` [object](https://learn.microsoft.com/dotnet/api/system.object) + +Can pass any class type. + +#### Returns + +[bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +The return value tell you whehter the compare operation is successful. + +### GetTailLength\(int\*, params object\[\]\) + +It's an unsafe method. +As you see, catName is a pointer, so we need to add unsafe keyword. + +```csharp +public long GetTailLength(int* catName, params object[] parameters) +``` + +#### Parameters + +`catName` [int](https://learn.microsoft.com/dotnet/api/system.int32)\* + +Thie represent for cat name length. + +`parameters` [object](https://learn.microsoft.com/dotnet/api/system.object)\[\] + +Optional parameters. + +#### Returns + +[long](https://learn.microsoft.com/dotnet/api/system.int64) + +Return cat tail's length. + +### Jump\(T, K, ref bool\) + +This method have attribute above it. + +```csharp +[Conditional("Debug")] +public void Jump(T ownType, K anotherOwnType, ref bool cheat) +``` + +#### Parameters + +`ownType` T + +Type come from class define. + +`anotherOwnType` K + +Type come from class define. + +`cheat` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +Hint whether this cat has cheat mode. + +#### Exceptions + +[ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) + +This is an argument exception + +### ownEat + +Eat event of this cat + +```csharp +public event EventHandler ownEat +``` + +#### Event Type + +[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler) + +## Operators + +### operator \+\(Cat, int\) + +Addition operator of this class. + +```csharp +public static int operator +(Cat lsr, int rsr) +``` + +#### Parameters + +`lsr` [Cat](CatLibrary.Cat\-2.md) + +.. + +`rsr` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +~~ + +#### Returns + +[int](https://learn.microsoft.com/dotnet/api/system.int32) + +Result with int type. + +### explicit operator Tom\(Cat\) + +Expilicit operator of this class. +

      It means this cat can evolve to change to Tom. Tom and Jerry.

      + +```csharp +public static explicit operator Tom(Cat src) +``` + +#### Parameters + +`src` [Cat](CatLibrary.Cat\-2.md) + +Instance of this class. + +#### Returns + +[Tom](CatLibrary.Tom.md) + +Advanced class type of cat. + +### operator \-\(Cat, int\) + +Similar with operaotr +, refer to that topic. + +```csharp +public static int operator -(Cat lsr, int rsr) +``` + +#### Parameters + +`lsr` [Cat](CatLibrary.Cat\-2.md) + +`rsr` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Returns + +[int](https://learn.microsoft.com/dotnet/api/system.int32) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.CatException-1.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.CatException-1.verified.md new file mode 100644 index 00000000000..acd5d2e5c81 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.CatException-1.verified.md @@ -0,0 +1,46 @@ +# Class CatException + +Namespace: [CatLibrary](CatLibrary.md) +Assembly: CatLibrary.dll + +```csharp +public class CatException : Exception, ISerializable +``` + +#### Type Parameters + +`T` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Exception](https://learn.microsoft.com/dotnet/api/system.exception) ← +[CatException](CatLibrary.CatException\-1.md) + +###### Implements + +[ISerializable](https://learn.microsoft.com/dotnet/api/system.runtime.serialization.iserializable) + +###### Inherited Members + +[Exception.GetBaseException\(\)](https://learn.microsoft.com/dotnet/api/system.exception.getbaseexception), +[Exception.GetObjectData\(SerializationInfo, StreamingContext\)](https://learn.microsoft.com/dotnet/api/system.exception.getobjectdata), +[Exception.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.exception.gettype), +[Exception.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.exception.tostring), +[Exception.Data](https://learn.microsoft.com/dotnet/api/system.exception.data), +[Exception.HelpLink](https://learn.microsoft.com/dotnet/api/system.exception.helplink), +[Exception.HResult](https://learn.microsoft.com/dotnet/api/system.exception.hresult), +[Exception.InnerException](https://learn.microsoft.com/dotnet/api/system.exception.innerexception), +[Exception.Message](https://learn.microsoft.com/dotnet/api/system.exception.message), +[Exception.Source](https://learn.microsoft.com/dotnet/api/system.exception.source), +[Exception.StackTrace](https://learn.microsoft.com/dotnet/api/system.exception.stacktrace), +[Exception.TargetSite](https://learn.microsoft.com/dotnet/api/system.exception.targetsite), +[Exception.SerializeObjectState](https://learn.microsoft.com/dotnet/api/system.exception.serializeobjectstate), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Complex-2.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Complex-2.verified.md new file mode 100644 index 00000000000..af965fad182 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Complex-2.verified.md @@ -0,0 +1,30 @@ +# Class Complex + +Namespace: [CatLibrary](CatLibrary.md) +Assembly: CatLibrary.dll + +```csharp +public class Complex +``` + +#### Type Parameters + +`T` + +`J` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Complex](CatLibrary.Complex\-2.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ColorType.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ColorType.verified.md new file mode 100644 index 00000000000..719c9796f6d --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ColorType.verified.md @@ -0,0 +1,25 @@ +# Enum ContainersRefType.ColorType + +Namespace: [CatLibrary.Core](CatLibrary.Core.md) +Assembly: CatLibrary.Core.dll + +Enumeration ColorType + +```csharp +public enum ContainersRefType.ColorType +``` + +## Fields + +`Red = 0` + +red + +`Blue = 1` + +blue + +`Yellow = 2` + +yellow + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ContainersRefTypeChild.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ContainersRefTypeChild.verified.md new file mode 100644 index 00000000000..cc9cba725c1 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ContainersRefTypeChild.verified.md @@ -0,0 +1,24 @@ +# Class ContainersRefType.ContainersRefTypeChild + +Namespace: [CatLibrary.Core](CatLibrary.Core.md) +Assembly: CatLibrary.Core.dll + +```csharp +public class ContainersRefType.ContainersRefTypeChild +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[ContainersRefType.ContainersRefTypeChild](CatLibrary.Core.ContainersRefType.ContainersRefTypeChild.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ContainersRefTypeChildInterface.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ContainersRefTypeChildInterface.verified.md new file mode 100644 index 00000000000..8e06dbdf553 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ContainersRefTypeChildInterface.verified.md @@ -0,0 +1,9 @@ +# Interface ContainersRefType.ContainersRefTypeChildInterface + +Namespace: [CatLibrary.Core](CatLibrary.Core.md) +Assembly: CatLibrary.Core.dll + +```csharp +public interface ContainersRefType.ContainersRefTypeChildInterface +``` + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ContainersRefTypeDelegate.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ContainersRefTypeDelegate.verified.md new file mode 100644 index 00000000000..768ed241aa1 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.ContainersRefTypeDelegate.verified.md @@ -0,0 +1,11 @@ +# Delegate ContainersRefType.ContainersRefTypeDelegate + +Namespace: [CatLibrary.Core](CatLibrary.Core.md) +Assembly: CatLibrary.Core.dll + +Delegate ContainersRefTypeDelegate + +```csharp +public delegate void ContainersRefType.ContainersRefTypeDelegate() +``` + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.verified.md new file mode 100644 index 00000000000..bff4928b69d --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ContainersRefType.verified.md @@ -0,0 +1,82 @@ +# Struct ContainersRefType + +Namespace: [CatLibrary.Core](CatLibrary.Core.md) +Assembly: CatLibrary.Core.dll + +Struct ContainersRefType + +```csharp +public struct ContainersRefType +``` + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +###### Extension Methods + +[Issue231.Bar\(ContainersRefType\)](CatLibrary.Core.Issue231.md\#CatLibrary\_Core\_Issue231\_Bar\_CatLibrary\_Core\_ContainersRefType\_), +[Issue231.Foo\(ContainersRefType\)](CatLibrary.Core.Issue231.md\#CatLibrary\_Core\_Issue231\_Foo\_CatLibrary\_Core\_ContainersRefType\_) + +## Fields + +### ColorCount + +ColorCount + +```csharp +public long ColorCount +``` + +#### Field Value + +[long](https://learn.microsoft.com/dotnet/api/system.int64) + +## Properties + +### GetColorCount + +GetColorCount + +```csharp +public long GetColorCount { get; } +``` + +#### Property Value + +[long](https://learn.microsoft.com/dotnet/api/system.int64) + +## Methods + +### ContainersRefTypeNonRefMethod\(params object\[\]\) + +ContainersRefTypeNonRefMethod +array + +```csharp +public static int ContainersRefTypeNonRefMethod(params object[] parmsArray) +``` + +#### Parameters + +`parmsArray` [object](https://learn.microsoft.com/dotnet/api/system.object)\[\] + +#### Returns + +[int](https://learn.microsoft.com/dotnet/api/system.int32) + +### ContainersRefTypeEventHandler + +```csharp +public event EventHandler ContainersRefTypeEventHandler +``` + +#### Event Type + +[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ExplicitLayoutClass.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ExplicitLayoutClass.verified.md new file mode 100644 index 00000000000..7eaad93b65b --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.ExplicitLayoutClass.verified.md @@ -0,0 +1,24 @@ +# Class ExplicitLayoutClass + +Namespace: [CatLibrary.Core](CatLibrary.Core.md) +Assembly: CatLibrary.Core.dll + +```csharp +public class ExplicitLayoutClass +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[ExplicitLayoutClass](CatLibrary.Core.ExplicitLayoutClass.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.Issue231.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.Issue231.verified.md new file mode 100644 index 00000000000..f5f1feb2aa9 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.Issue231.verified.md @@ -0,0 +1,46 @@ +# Class Issue231 + +Namespace: [CatLibrary.Core](CatLibrary.Core.md) +Assembly: CatLibrary.dll, CatLibrary.Core.dll + +```csharp +public static class Issue231 +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Issue231](CatLibrary.Core.Issue231.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### Bar\(ContainersRefType\) + +```csharp +public static void Bar(this ContainersRefType c) +``` + +#### Parameters + +`c` [ContainersRefType](CatLibrary.Core.ContainersRefType.md) + +### Foo\(ContainersRefType\) + +```csharp +public static void Foo(this ContainersRefType c) +``` + +#### Parameters + +`c` [ContainersRefType](CatLibrary.Core.ContainersRefType.md) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.verified.md new file mode 100644 index 00000000000..7e9b34342de --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Core.verified.md @@ -0,0 +1,34 @@ +# Namespace CatLibrary.Core + +### Classes + +[ContainersRefType.ContainersRefTypeChild](CatLibrary.Core.ContainersRefType.ContainersRefTypeChild.md) + +[ExplicitLayoutClass](CatLibrary.Core.ExplicitLayoutClass.md) + +[Issue231](CatLibrary.Core.Issue231.md) + +[Issue231](CatLibrary.Core.Issue231.md) + +### Structs + +[ContainersRefType](CatLibrary.Core.ContainersRefType.md) + +Struct ContainersRefType + +### Interfaces + +[ContainersRefType.ContainersRefTypeChildInterface](CatLibrary.Core.ContainersRefType.ContainersRefTypeChildInterface.md) + +### Enums + +[ContainersRefType.ColorType](CatLibrary.Core.ContainersRefType.ColorType.md) + +Enumeration ColorType + +### Delegates + +[ContainersRefType.ContainersRefTypeDelegate](CatLibrary.Core.ContainersRefType.ContainersRefTypeDelegate.md) + +Delegate ContainersRefTypeDelegate + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.FakeDelegate-1.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.FakeDelegate-1.verified.md new file mode 100644 index 00000000000..0c889530516 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.FakeDelegate-1.verified.md @@ -0,0 +1,37 @@ +# Delegate FakeDelegate + +Namespace: [CatLibrary](CatLibrary.md) +Assembly: CatLibrary.dll + +Fake delegate + +```csharp +public delegate int FakeDelegate(long num, string name, params object[] scores) +``` + +#### Parameters + +`num` [long](https://learn.microsoft.com/dotnet/api/system.int64) + +Fake para + +`name` [string](https://learn.microsoft.com/dotnet/api/system.string) + +Fake para + +`scores` [object](https://learn.microsoft.com/dotnet/api/system.object)\[\] + +Optional Parameter. + +#### Returns + +[int](https://learn.microsoft.com/dotnet/api/system.int32) + +Return a fake number to confuse you. + +#### Type Parameters + +`T` + +Fake para + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.IAnimal.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.IAnimal.verified.md new file mode 100644 index 00000000000..9ec948b4171 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.IAnimal.verified.md @@ -0,0 +1,81 @@ +# Interface IAnimal + +Namespace: [CatLibrary](CatLibrary.md) +Assembly: CatLibrary.dll + +This is basic interface of all animal. + +```csharp +public interface IAnimal +``` + +## Properties + +### Name + +Name of Animal. + +```csharp +string Name { get; } +``` + +#### Property Value + +[string](https://learn.microsoft.com/dotnet/api/system.string) + +### this\[int\] + +Return specific number animal's name. + +```csharp +string this[int index] { get; } +``` + +#### Property Value + +[string](https://learn.microsoft.com/dotnet/api/system.string) + +## Methods + +### Eat\(\) + +Animal's eat method. + +```csharp +void Eat() +``` + +### Eat\(Tool\) + +Overload method of eat. This define the animal eat by which tool. + +```csharp +void Eat(Tool tool) where Tool : class +``` + +#### Parameters + +`tool` Tool + +Tool name. + +#### Type Parameters + +`Tool` + +It's a class type. + +### Eat\(string\) + +Feed the animal with some food + +```csharp +void Eat(string food) +``` + +#### Parameters + +`food` [string](https://learn.microsoft.com/dotnet/api/system.string) + +Food to eat + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.ICat.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.ICat.verified.md new file mode 100644 index 00000000000..2ba0055291b --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.ICat.verified.md @@ -0,0 +1,32 @@ +# Interface ICat + +Namespace: [CatLibrary](CatLibrary.md) +Assembly: CatLibrary.dll + +Cat's interface + +```csharp +public interface ICat : IAnimal +``` + +###### Implements + +[IAnimal](CatLibrary.IAnimal.md) + +###### Extension Methods + +[ICatExtension.Play\(ICat, ContainersRefType.ColorType\)](CatLibrary.ICatExtension.md\#CatLibrary\_ICatExtension\_Play\_CatLibrary\_ICat\_CatLibrary\_Core\_ContainersRefType\_ColorType\_), +[ICatExtension.Sleep\(ICat, long\)](CatLibrary.ICatExtension.md\#CatLibrary\_ICatExtension\_Sleep\_CatLibrary\_ICat\_System\_Int64\_) + +### eat + +eat event of cat. Every cat must implement this event. + +```csharp +event EventHandler eat +``` + +#### Event Type + +[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.ICatExtension.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.ICatExtension.verified.md new file mode 100644 index 00000000000..ad1fa2dcf17 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.ICatExtension.verified.md @@ -0,0 +1,66 @@ +# Class ICatExtension + +Namespace: [CatLibrary](CatLibrary.md) +Assembly: CatLibrary.dll + +It's the class that contains ICat interface's extension method. +

      This class must be public and static.

      +

      Also it shouldn't be a geneic class

      + +```csharp +public static class ICatExtension +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[ICatExtension](CatLibrary.ICatExtension.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### Play\(ICat, ColorType\) + +Extension method to let cat play + +```csharp +public static void Play(this ICat icat, ContainersRefType.ColorType toy) +``` + +#### Parameters + +`icat` [ICat](CatLibrary.ICat.md) + +Cat + +`toy` [ContainersRefType](CatLibrary.Core.ContainersRefType.md).[ColorType](CatLibrary.Core.ContainersRefType.ColorType.md) + +Something to play + +### Sleep\(ICat, long\) + +Extension method hint that how long the cat can sleep. + +```csharp +public static void Sleep(this ICat icat, long hours) +``` + +#### Parameters + +`icat` [ICat](CatLibrary.ICat.md) + +The type will be extended. + +`hours` [long](https://learn.microsoft.com/dotnet/api/system.int64) + +The length of sleep. + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.MRefDelegate-3.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.MRefDelegate-3.verified.md new file mode 100644 index 00000000000..53536c7a98e --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.MRefDelegate-3.verified.md @@ -0,0 +1,39 @@ +# Delegate MRefDelegate + +Namespace: [CatLibrary](CatLibrary.md) +Assembly: CatLibrary.dll + +Generic delegate with many constrains. + +```csharp +public delegate void MRefDelegate(K k, T t, L l) where K : class, IComparable where T : struct where L : Tom, IEnumerable +``` + +#### Parameters + +`k` K + +Type K. + +`t` T + +Type T. + +`l` L + +Type L. + +#### Type Parameters + +`K` + +Generic K. + +`T` + +Generic T. + +`L` + +Generic L. + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.MRefNormalDelegate.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.MRefNormalDelegate.verified.md new file mode 100644 index 00000000000..a45a243853e --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.MRefNormalDelegate.verified.md @@ -0,0 +1,21 @@ +# Delegate MRefNormalDelegate + +Namespace: [CatLibrary](CatLibrary.md) +Assembly: CatLibrary.dll + +Delegate in the namespace + +```csharp +public delegate void MRefNormalDelegate(List pics, out string name) +``` + +#### Parameters + +`pics` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\> + +a name list of pictures. + +`name` [string](https://learn.microsoft.com/dotnet/api/system.string) + +give out the needed name. + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Tom.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Tom.verified.md new file mode 100644 index 00000000000..4246224ecdb --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.Tom.verified.md @@ -0,0 +1,70 @@ +# Class Tom + +Namespace: [CatLibrary](CatLibrary.md) +Assembly: CatLibrary.dll + +Tom class is only inherit from Object. Not any member inside itself. + +```csharp +public class Tom +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Tom](CatLibrary.Tom.md) + +###### Derived + +[TomFromBaseClass](CatLibrary.TomFromBaseClass.md) + +###### Inherited Members + +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Methods + +### TomMethod\(Complex, Tuple\) + +This is a Tom Method with complex type as return + +```csharp +public Complex TomMethod(Complex a, Tuple b) +``` + +#### Parameters + +`a` [Complex](CatLibrary.Complex\-2.md)<[TomFromBaseClass](CatLibrary.TomFromBaseClass.md), [TomFromBaseClass](CatLibrary.TomFromBaseClass.md)\> + +A complex input + +`b` [Tuple](https://learn.microsoft.com/dotnet/api/system.tuple\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [Tom](CatLibrary.Tom.md)\> + +Another complex input + +#### Returns + +[Complex](CatLibrary.Complex\-2.md)<[string](https://learn.microsoft.com/dotnet/api/system.string), [TomFromBaseClass](CatLibrary.TomFromBaseClass.md)\> + +Complex @CatLibrary.TomFromBaseClass + +#### Exceptions + +[NotImplementedException](https://learn.microsoft.com/dotnet/api/system.notimplementedexception) + +This is not implemented + +[ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) + +This is the exception to be thrown when implemented + +[CatException](CatLibrary.CatException\-1.md) + +This is the exception in current documentation + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.TomFromBaseClass.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.TomFromBaseClass.verified.md new file mode 100644 index 00000000000..101c3c03db6 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.TomFromBaseClass.verified.md @@ -0,0 +1,42 @@ +# Class TomFromBaseClass + +Namespace: [CatLibrary](CatLibrary.md) +Assembly: CatLibrary.dll + +*TomFromBaseClass* inherits from @ + +```csharp +public class TomFromBaseClass : Tom +``` + +###### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Tom](CatLibrary.Tom.md) ← +[TomFromBaseClass](CatLibrary.TomFromBaseClass.md) + +###### Inherited Members + +[Tom.TomMethod\(Complex, Tuple\)](CatLibrary.Tom.md\#CatLibrary\_Tom\_TomMethod\_CatLibrary\_Complex\_CatLibrary\_TomFromBaseClass\_CatLibrary\_TomFromBaseClass\_\_System\_Tuple\_System\_String\_CatLibrary\_Tom\_\_), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring) + +## Constructors + +### TomFromBaseClass\(int\) + +This is a #ctor with parameter + +```csharp +public TomFromBaseClass(int k) +``` + +#### Parameters + +`k` [int](https://learn.microsoft.com/dotnet/api/system.int32) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.verified.md new file mode 100644 index 00000000000..eddb2725587 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/CatLibrary.verified.md @@ -0,0 +1,58 @@ +# Namespace CatLibrary + +### Namespaces + +[CatLibrary.Core](CatLibrary.Core.md) + +### Classes + +[Cat](CatLibrary.Cat\-2.md) + +

      Here's main class of this Demo.

      +

      You can see mostly type of article within this class and you for more detail, please see the remarks.

      +

      +

      this class is a template class. It has two Generic parameter. they are: T and K.

      +

      The extension method of this class can refer to class

      + +[CatException](CatLibrary.CatException\-1.md) + +[Complex](CatLibrary.Complex\-2.md) + +[ICatExtension](CatLibrary.ICatExtension.md) + +It's the class that contains ICat interface's extension method. +

      This class must be public and static.

      +

      Also it shouldn't be a geneic class

      + +[Tom](CatLibrary.Tom.md) + +Tom class is only inherit from Object. Not any member inside itself. + +[TomFromBaseClass](CatLibrary.TomFromBaseClass.md) + +*TomFromBaseClass* inherits from @ + +### Interfaces + +[IAnimal](CatLibrary.IAnimal.md) + +This is basic interface of all animal. + +[ICat](CatLibrary.ICat.md) + +Cat's interface + +### Delegates + +[FakeDelegate](CatLibrary.FakeDelegate\-1.md) + +Fake delegate + +[MRefDelegate](CatLibrary.MRefDelegate\-3.md) + +Generic delegate with many constrains. + +[MRefNormalDelegate](CatLibrary.MRefNormalDelegate.md) + +Delegate in the namespace + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.Demo.Enumeration.ColorType.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.Demo.Enumeration.ColorType.verified.md new file mode 100644 index 00000000000..010fa37fa46 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.Demo.Enumeration.ColorType.verified.md @@ -0,0 +1,36 @@ +# Enum ColorType + +Namespace: [MRef.Demo.Enumeration](MRef.Demo.Enumeration.md) +Assembly: CatLibrary.dll + +Enumeration ColorType + +```csharp +public enum ColorType +``` + +## Fields + +`Red = 0` + +this color is red + +`Blue = 1` + +blue like river + +`Yellow = 2` + +yellow comes from desert + +## Remarks + +

      +Red/Blue/Yellow can become all color you want. +

      +
        + +## See Also + +[object](https://learn.microsoft.com/dotnet/api/system.object) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.Demo.Enumeration.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.Demo.Enumeration.verified.md new file mode 100644 index 00000000000..a17d40d8174 --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.Demo.Enumeration.verified.md @@ -0,0 +1,8 @@ +# Namespace MRef.Demo.Enumeration + +### Enums + +[ColorType](MRef.Demo.Enumeration.ColorType.md) + +Enumeration ColorType + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.Demo.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.Demo.verified.md new file mode 100644 index 00000000000..3e8758b82ca --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.Demo.verified.md @@ -0,0 +1,6 @@ +# Namespace MRef.Demo + +### Namespaces + +[MRef.Demo.Enumeration](MRef.Demo.Enumeration.md) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.verified.md b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.verified.md new file mode 100644 index 00000000000..85bdca79d8c --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/MRef.verified.md @@ -0,0 +1,6 @@ +# Namespace MRef + +### Namespaces + +[MRef.Demo](MRef.Demo.md) + diff --git a/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/toc.verified.yml b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/toc.verified.yml new file mode 100644 index 00000000000..f0cb2d9385f --- /dev/null +++ b/test/docfx.Snapshot.Tests/SamplesTest.SeedMarkdown/toc.verified.yml @@ -0,0 +1,134 @@ +### YamlMime:TableOfContent +- name: BuildFromAssembly + href: BuildFromAssembly.md + items: + - name: Classes + - name: Class1 + href: BuildFromAssembly.Class1.md +- name: BuildFromCSharpSourceCode + href: BuildFromCSharpSourceCode.md + items: + - name: Classes + - name: CSharp + href: BuildFromCSharpSourceCode.CSharp.md +- name: BuildFromProject + href: BuildFromProject.md + items: + - name: Issue8540 + href: BuildFromProject.Issue8540.md + items: + - name: A + href: BuildFromProject.Issue8540.A.md + items: + - name: Classes + - name: A + href: BuildFromProject.Issue8540.A.A.md + - name: B + href: BuildFromProject.Issue8540.B.md + items: + - name: Classes + - name: B + href: BuildFromProject.Issue8540.B.B.md + - name: Classes + - name: Class1 + href: BuildFromProject.Class1.md + - name: Class1.Issue8665 + href: BuildFromProject.Class1.Issue8665.md + - name: Class1.Issue8696Attribute + href: BuildFromProject.Class1.Issue8696Attribute.md + - name: Class1.Issue8948 + href: BuildFromProject.Class1.Issue8948.md + - name: Class1.Test + href: BuildFromProject.Class1.Test-1.md + - name: Inheritdoc + href: BuildFromProject.Inheritdoc.md + - name: Inheritdoc.Issue6366 + href: BuildFromProject.Inheritdoc.Issue6366.md + - name: Inheritdoc.Issue6366.Class1 + href: BuildFromProject.Inheritdoc.Issue6366.Class1-1.md + - name: Inheritdoc.Issue6366.Class2 + href: BuildFromProject.Inheritdoc.Issue6366.Class2.md + - name: Inheritdoc.Issue7035 + href: BuildFromProject.Inheritdoc.Issue7035.md + - name: Inheritdoc.Issue7484 + href: BuildFromProject.Inheritdoc.Issue7484.md + - name: Inheritdoc.Issue8101 + href: BuildFromProject.Inheritdoc.Issue8101.md + - name: Structs + - name: Inheritdoc.Issue8129 + href: BuildFromProject.Inheritdoc.Issue8129.md + - name: Interfaces + - name: Class1.IIssue8948 + href: BuildFromProject.Class1.IIssue8948.md + - name: IInheritdoc + href: BuildFromProject.IInheritdoc.md +- name: BuildFromVBSourceCode + href: BuildFromVBSourceCode.md + items: + - name: Classes + - name: BaseClass1 + href: BuildFromVBSourceCode.BaseClass1.md + - name: Class1 + href: BuildFromVBSourceCode.Class1.md +- name: CatLibrary + href: CatLibrary.md + items: + - name: Core + href: CatLibrary.Core.md + items: + - name: Classes + - name: ContainersRefType.ContainersRefTypeChild + href: CatLibrary.Core.ContainersRefType.ContainersRefTypeChild.md + - name: ExplicitLayoutClass + href: CatLibrary.Core.ExplicitLayoutClass.md + - name: Issue231 + href: CatLibrary.Core.Issue231.md + - name: Structs + - name: ContainersRefType + href: CatLibrary.Core.ContainersRefType.md + - name: Interfaces + - name: ContainersRefType.ContainersRefTypeChildInterface + href: CatLibrary.Core.ContainersRefType.ContainersRefTypeChildInterface.md + - name: Enums + - name: ContainersRefType.ColorType + href: CatLibrary.Core.ContainersRefType.ColorType.md + - name: Delegates + - name: ContainersRefType.ContainersRefTypeDelegate + href: CatLibrary.Core.ContainersRefType.ContainersRefTypeDelegate.md + - name: Classes + - name: Cat + href: CatLibrary.Cat-2.md + - name: CatException + href: CatLibrary.CatException-1.md + - name: Complex + href: CatLibrary.Complex-2.md + - name: ICatExtension + href: CatLibrary.ICatExtension.md + - name: Tom + href: CatLibrary.Tom.md + - name: TomFromBaseClass + href: CatLibrary.TomFromBaseClass.md + - name: Interfaces + - name: IAnimal + href: CatLibrary.IAnimal.md + - name: ICat + href: CatLibrary.ICat.md + - name: Delegates + - name: FakeDelegate + href: CatLibrary.FakeDelegate-1.md + - name: MRefDelegate + href: CatLibrary.MRefDelegate-3.md + - name: MRefNormalDelegate + href: CatLibrary.MRefNormalDelegate.md +- name: MRef + href: MRef.md + items: + - name: Demo + href: MRef.Demo.md + items: + - name: Enumeration + href: MRef.Demo.Enumeration.md + items: + - name: Enums + - name: ColorType + href: MRef.Demo.Enumeration.ColorType.md diff --git a/test/docfx.Snapshot.Tests/SamplesTest.cs b/test/docfx.Snapshot.Tests/SamplesTest.cs index ce43694ee69..180ff58a670 100644 --- a/test/docfx.Snapshot.Tests/SamplesTest.cs +++ b/test/docfx.Snapshot.Tests/SamplesTest.cs @@ -180,6 +180,18 @@ static string NormalizeHtml(string html) } } + [Fact] + public async Task SeedMarkdown() + { + var samplePath = $"{s_samplesDir}/seed"; + var outputPath = nameof(SeedMarkdown); + Clean(samplePath); + + Program.Main(new[] { "metadata", $"{samplePath}/docfx.json", "--outputFormat", "markdown", "--output", outputPath }); + + await VerifyDirectory(outputPath, IncludeFile, fileScrubber: ScrubFile).AutoVerify(includeBuildServer: false); + } + [SnapshotFact] public async Task CSharp() {