Exemplo n.º 1
0
    public Task Simple()
    {
        var finder   = new IncludeFinder();
        var includes = finder.ReadIncludes("IncludeFinder");

        return(Verifier.Verify(includes));
    }
Exemplo n.º 2
0
    void Basic()
    {
        #region markdownProcessingSimple

        var directory = @"C:\path";

        // extract snippets from files
        var snippetExtractor = new DirectorySnippetExtractor();
        var snippets         = snippetExtractor.ReadSnippets(directory);

        // extract includes from files
        var includeFinder = new IncludeFinder();
        var includes      = includeFinder.ReadIncludes(directory);

        // Merge with some markdown text
        var markdownProcessor = new MarkdownProcessor(
            convention: DocumentConvention.SourceTransform,
            snippets: snippets.Lookup,
            includes: includes,
            appendSnippets: SimpleSnippetMarkdownHandling.Append,
            snippetSourceFiles: new List <string>(),
            tocLevel: 2,
            writeHeader: true,
            rootDirectory: directory,
            validateContent: true);

        var path = @"C:\path\inputMarkdownFile.md";
        using var reader = File.OpenText(path);
        using var writer = File.CreateText(@"C:\path\outputMarkdownFile.md");
        var result = markdownProcessor.Apply(reader, writer, path);
        // snippets that the markdown file expected but did not exist in the input snippets
        var missingSnippets = result.MissingSnippets;

        // snippets that the markdown file used
        var usedSnippets = result.UsedSnippets;

        #endregion
    }
Exemplo n.º 3
0
        /// <summary>
        /// Get the list of includes from the file specified by inFilePath.
        /// </summary>
        /// <param name="inFilePath"></param>
        /// <returns></returns>
        private List <Include> GetIncludesFromFile(string inFilePath)
        {
            IncludeFinder include_finder = new IncludeFinder(mConfig.IncludePaths);

            return(include_finder.GetIncludes(inFilePath));
        }
Exemplo n.º 4
0
 internal TypeMapper(IncludeFinder includeFinder, ISet <string> includes)
 {
     this._includes      = includes;
     this._includeFinder = includeFinder;
 }