/// <summary>
 /// Read from paths.
 /// </summary>
 /// <param name="paths">The paths to extract <see cref="Snippet"/>s from.</param>
 /// <param name="maxWidth">Controls the maximum character width for snippets. Must be positive.</param>
 public static IEnumerable <Snippet> Read(IEnumerable <string> paths, int maxWidth = int.MaxValue)
 {
     Guard.AgainstNull(paths, nameof(paths));
     return(paths
            .Where(x => SnippetFileExclusions.CanContainCommentsExtension(Path.GetExtension(x).Substring(1)))
            .SelectMany(path => Read(path, maxWidth)));
 }
Exemplo n.º 2
0
        static bool IncludeFile(string path)
        {
            var fileName = Path.GetFileName(path);

            if (fileName.StartsWith("."))
            {
                return(false);
            }

            var extension = Path.GetExtension(fileName);

            if (extension == string.Empty)
            {
                return(false);
            }

            if (SnippetFileExclusions.ShouldExcludeExtension(extension.Substring(1)))
            {
                return(false);
            }

            return(true);
        }