protected DocumentationPage CompileDocumentationPage(FolderItem page, string directory,
                                                             string documentationVersion, List <DocumentationMapping> mappings,
                                                             string sourceDocumentationVersion = null)
        {
            var path = Path.Combine(directory,
                                    page.Name + FileExtensionHelper.GetLanguageFileExtension(page.Language) +
                                    Constants.MarkdownFileExtension);

            var fileInfo = new FileInfo(path);

            if (fileInfo.Exists == false)
            {
                throw new FileNotFoundException($"Documentation file '{path}' not found.");
            }

            var compilationParams = new CompilationUtils.Parameters
            {
                File = fileInfo,
                Page = page,
                DocumentationVersion       = documentationVersion,
                SourceDocumentationVersion = sourceDocumentationVersion ?? documentationVersion,
                Mappings = mappings
            };

            return(_documentCompiler.Compile(compilationParams));
        }
        public void Test()
        {
            var compiler  = new DocumentCompiler();
            var compiled  = compiler.Compile("SimpleFormulas.xlsx");
            var evaluator = new SyntaxEvaluator(compiled, new CustomFunctionProvider());

            var b2 = evaluator.GetCell <int>(new Cell("a2"));
        }
 /// <summary>
 /// 将文档结构编译成一个方法,文档结构可以由此方法复原
 /// </summary>
 /// <param name="document">要编译的文档</param>
 /// <returns>复原文档的方法</returns>
 public static Func <IHtmlDomProvider, IHtmlDocument> Compile(this IHtmlDocument document)
 {
     return(DocumentCompiler.Compile(document));
 }