GetFilePath() public method

public GetFilePath ( string key ) : string
key string
return string
コード例 #1
0
        public string ResolveSourceRelativePath(string originPath, string currentFileOutputPath)
        {
            if (string.IsNullOrEmpty(originPath) || !PathUtility.IsRelativePath(originPath))
            {
                return(originPath);
            }

            var origin = (RelativePath)originPath;

            if (origin == null)
            {
                return(originPath);
            }

            var destPath = _context.GetFilePath(origin.GetPathFromWorkingFolder().ToString());

            if (destPath != null)
            {
                return(((RelativePath)destPath - ((RelativePath)currentFileOutputPath).GetPathFromWorkingFolder()).ToString());
            }
            else
            {
                Logger.LogWarning($"Can't find output file for {originPath}");
                return(originPath);
            }
        }
コード例 #2
0
 private static List <HomepageInfo> GetHomepages(DocumentBuildContext context)
 {
     return((from s in context.GetTocInfo()
             where !string.IsNullOrEmpty(s.Homepage)
             select new HomepageInfo
     {
         Homepage = RelativePath.GetPathWithoutWorkingFolderChar(s.Homepage),
         TocPath = RelativePath.GetPathWithoutWorkingFolderChar(context.GetFilePath(s.TocFileKey))
     }).ToList());
 }
コード例 #3
0
        /// <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 = ((RelativePath)context.GetFilePath(UriUtility.GetNonFragment(xref.Href))).RemoveWorkingFolder() + UriUtility.GetFragment(xref.Href)
            }).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);
        }
コード例 #4
0
 private static List<HomepageInfo> GetHomepages(DocumentBuildContext context)
 {
     return context.GetTocInfo()
         .Where(s => !string.IsNullOrEmpty(s.Homepage))
         .Select(s => new HomepageInfo
         {
             Homepage = RelativePath.GetPathWithoutWorkingFolderChar(s.Homepage),
             TocPath = RelativePath.GetPathWithoutWorkingFolderChar(context.GetFilePath(s.TocFileKey))
         }).ToList();
 }
コード例 #5
0
 private static List <HomepageInfo> GetHomepages(DocumentBuildContext context)
 {
     return(context.GetTocInfo()
            .Where(s => !string.IsNullOrEmpty(s.Homepage))
            .Select(s => new HomepageInfo
     {
         Homepage = TypeForwardedToRelativePath.GetPathWithoutWorkingFolderChar(s.Homepage),
         TocPath = TypeForwardedToRelativePath.GetPathWithoutWorkingFolderChar(context.GetFilePath(s.TocFileKey))
     }).ToList());
 }