コード例 #1
0
        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));
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
 /// <summary>
 /// 将文档结构编译成一个方法,文档结构可以由此方法复原
 /// </summary>
 /// <param name="document">要编译的文档</param>
 /// <returns>复原文档的方法</returns>
 public static Func <IHtmlDomProvider, IHtmlDocument> Compile(this IHtmlDocument document)
 {
     return(DocumentCompiler.Compile(document));
 }