Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public ArticleDirectoryCompiler(ArticleCompiler articleCompiler, ParserOptions options)
 {
     _articleCompiler = articleCompiler;
     _options = options;
 }
Ejemplo n.º 3
0
 public DirectoryCompiler(DocumentCompiler documentCompiler, ParserOptions options)
 {
     _documentCompiler = documentCompiler;
     _options = options;
 }
Ejemplo n.º 4
0
 public DocumentCompiler(Markdown parser, ParserOptions options, IProvideGitFileInformation repoAnalyzer)
     : base(parser, options, repoAnalyzer)
 {
 }
Ejemplo n.º 5
0
 public DocumentationValidator(ParserOptions options, Language currentLanguage)
 {
     _options = options;
     _currentLanguage = currentLanguage;
 }
Ejemplo n.º 6
0
 public DocumentationValidator(ParserOptions options, Language currentLanguage)
 {
     _options         = options;
     _currentLanguage = currentLanguage;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 8
0
 public ArticleDirectoryCompiler(ArticleCompiler articleCompiler, ParserOptions options)
 {
     _articleCompiler = articleCompiler;
     _options         = options;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 10
0
 public DocumentationDirectoryCompiler(DocumentCompiler documentCompiler, ParserOptions options)
 {
     _documentCompiler = documentCompiler;
     _options          = options;
 }
Ejemplo n.º 11
0
 public ArticleParser(ParserOptions options, IProvideGitFileInformation repoAnalyzer)
     : base(options)
 {
     var articleCompiler = new ArticleCompiler(Parser, options, repoAnalyzer);
     _directoryCompiler = new ArticleDirectoryCompiler(articleCompiler, options);
 }
Ejemplo n.º 12
0
 public DocumentCompiler(Markdown parser, ParserOptions options, IProvideGitFileInformation repoAnalyzer)
 {
     _parser       = parser;
     _options      = options;
     _repoAnalyzer = repoAnalyzer;
 }
Ejemplo n.º 13
0
 public DocumentCompiler(Markdown parser, ParserOptions options, IProvideGitFileInformation repoAnalyzer)
 {
     _parser = parser;
     _options = options;
     _repoAnalyzer = repoAnalyzer;
 }