public DocumentationParser(ParserOptions options, IProvideGitFileInformation repoAnalyzer)
        {
            _options = options;

            var parser = new Markdown
                             {
                                 AutoHeadingIDs = true,
                                 ExtraMode = true,
                                 NoFollowLinks = false,
                                 SafeMode = false,
                                 HtmlClassTitledImages = "figure text-center",
                                 UrlRootLocation = options.RootUrl
                             };

            var documentCompiler = new DocumentCompiler(parser, options, repoAnalyzer);
            _directoryCompiler = new DirectoryCompiler(documentCompiler, options);
        }
Example #2
0
 public ArticleDirectoryCompiler(ArticleCompiler articleCompiler, ParserOptions options)
 {
     _articleCompiler = articleCompiler;
     _options = options;
 }
Example #3
0
 public DirectoryCompiler(DocumentCompiler documentCompiler, ParserOptions options)
 {
     _documentCompiler = documentCompiler;
     _options = options;
 }
Example #4
0
 public DocumentCompiler(Markdown parser, ParserOptions options, IProvideGitFileInformation repoAnalyzer)
     : base(parser, options, repoAnalyzer)
 {
 }
 public DocumentationValidator(ParserOptions options, Language currentLanguage)
 {
     _options = options;
     _currentLanguage = currentLanguage;
 }
 public DocumentationValidator(ParserOptions options, Language currentLanguage)
 {
     _options         = options;
     _currentLanguage = currentLanguage;
 }
Example #7
0
        public virtual ActionResult ValidateMappings(string language, string version, bool all)
        {
            var query = DocumentSession
                .Query<DocumentationPage>()
                .Take(int.MaxValue);

            if (all == false)
            {
                query = query.Where(x => x.Version == CurrentVersion);

                Language parsedLanguage;

                if (Enum.TryParse(language, true, out parsedLanguage))
                {
                    query = query.Where(x => x.Language == parsedLanguage || x.Language == Language.All);
                }
            }

            var pages = query.ToList();

            var options = new ParserOptions
            {
                PathToDocumentationDirectory = GetDocumentationDirectory(),
                RootUrl = string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, Url.Content("~")) + "article/" + CurrentVersion + "/" + CurrentLanguage + "/",
                ImagesUrl = GetImagesUrl()
            };

            var results = new DocumentationValidator(options, CurrentLanguage)
                .ValidateMappings(pages)
                .ToList();

            return View(MVC.Docs.Views.ValidateMappings, results);
        }
Example #8
0
 public ArticleDirectoryCompiler(ArticleCompiler articleCompiler, ParserOptions options)
 {
     _articleCompiler = articleCompiler;
     _options         = options;
 }
Example #9
0
        public virtual ActionResult Validate(string language, string version, bool all)
        {
            if (DebugHelper.IsDebug() == false)
                return RedirectToAction(MVC.Docs.ActionNames.Index, MVC.Docs.Name);

            var query = DocumentSession
                .Query<DocumentationPage>()
                .Take(1024);

            if (all == false)
                query = query.Where(x => x.Version == CurrentVersion);

            var pages = query.ToList();

            var options = new ParserOptions
                        {
                            PathToDocumentationDirectory = GetDocumentationDirectory(),
                            RootUrl = string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, Url.Content("~")) + "article/" + CurrentVersion + "/" + CurrentLanguage + "/",
                            ImagesUrl = GetImagesUrl()
                        };

            var results = new DocumentationValidator(options, CurrentLanguage)
                .ValidateLinks(pages)
                .ToList();

            return View(MVC.Docs.Views.Validate, results);
        }
Example #10
0
 public DocumentationDirectoryCompiler(DocumentCompiler documentCompiler, ParserOptions options)
 {
     _documentCompiler = documentCompiler;
     _options          = options;
 }
Example #11
0
 public ArticleParser(ParserOptions options, IProvideGitFileInformation repoAnalyzer)
     : base(options)
 {
     var articleCompiler = new ArticleCompiler(Parser, options, repoAnalyzer);
     _directoryCompiler = new ArticleDirectoryCompiler(articleCompiler, options);
 }
Example #12
0
 public DocumentCompiler(Markdown parser, ParserOptions options, IProvideGitFileInformation repoAnalyzer)
 {
     _parser       = parser;
     _options      = options;
     _repoAnalyzer = repoAnalyzer;
 }
Example #13
0
 public DocumentCompiler(Markdown parser, ParserOptions options, IProvideGitFileInformation repoAnalyzer)
 {
     _parser = parser;
     _options = options;
     _repoAnalyzer = repoAnalyzer;
 }