GetPathToDocumentationPagesDirectory() public method

public GetPathToDocumentationPagesDirectory ( string documentationVersion ) : string
documentationVersion string
return string
Esempio n. 1
0
        public IEnumerable <DocumentationPage> Compile(DirectoryInfo directoryInfo)
        {
            var directoryName        = directoryInfo.Name;
            var documentationVersion = directoryName;

            Debug.Assert(Directory.Exists(_options.GetPathToDocumentationPagesDirectory(documentationVersion)));

            return(CompileDocumentationDirectory(_options.GetPathToDocumentationPagesDirectory(documentationVersion), documentationVersion));
        }
Esempio n. 2
0
        private string ExtractKey(FileInfo file, FolderItem page, string documentationVersion)
        {
            var pathToDocumentationPagesDirectory = _options.GetPathToDocumentationPagesDirectory(documentationVersion);
            var key = file.FullName.Substring(pathToDocumentationPagesDirectory.Length, file.FullName.Length - pathToDocumentationPagesDirectory.Length);

            key = key.Substring(0, key.Length - file.Extension.Length);
            key = key.Replace(@"\", @"/");
            key = key.StartsWith(@"/") ? key.Substring(1) : key;

            var extension = FileExtensionHelper.GetLanguageFileExtension(page.Language);

            if (string.IsNullOrEmpty(extension) == false)
            {
                key = key.Substring(0, key.Length - extension.Length);
            }

            return(key);
        }