/// <summary> /// Export xref map file. /// </summary> private static string ExportXRefMap(DocumentBuildParameters parameters, DocumentBuildContext context) { Logger.LogVerbose("Exporting xref map..."); var xrefMap = new XRefMap(); xrefMap.References = (from xref in context.XRefSpecMap.Values.AsParallel().WithDegreeOfParallelism(parameters.MaxParallelism) select new XRefSpec(xref) { Href = context.UpdateHref(xref.Href, RelativePath.WorkingFolder) }).ToList(); xrefMap.Sort(); string xrefMapFileNameWithVersion = GetXrefMapFileNameWithGroup(parameters); YamlUtility.Serialize( Path.GetFullPath(Environment.ExpandEnvironmentVariables(Path.Combine(parameters.OutputBaseDir, xrefMapFileNameWithVersion))), xrefMap, YamlMime.XRefMap); Logger.LogInfo("XRef map exported."); return(xrefMapFileNameWithVersion); }
/// <summary> /// Export xref map file. /// </summary> private static string ExportXRefMap(DocumentBuildParameters parameters, DocumentBuildContext context) { Logger.LogVerbose("Exporting xref map..."); var xrefMap = new XRefMap(); xrefMap.References = (from xref in context.XRefSpecMap.Values.AsParallel().WithDegreeOfParallelism(parameters.MaxParallelism) select new XRefSpec(xref) { Href = context.UpdateHref(xref.Href, RelativePath.WorkingFolder) }).ToList(); xrefMap.Sort(); string xrefMapFileNameWithVersion = string.IsNullOrEmpty(parameters.VersionName) ? XRefMapFileName : parameters.VersionName + "." + XRefMapFileName; YamlUtility.Serialize( xrefMapFileNameWithVersion, xrefMap, YamlMime.XRefMap); Logger.LogInfo("XRef map exported."); return(xrefMapFileNameWithVersion); }