コード例 #1
0
            public ProcessedDocumentCacheElement(string path, Preprocessor preprocessor, ProcessedDocumentCache cache)
            {
                this.path = path;
                this.preprocessor = preprocessor;
                this.cache = cache;

                Reload();
                
                watcher = new FileWatcher(path);
                watcher.Changed += (sender, args) => Reload();
            }
コード例 #2
0
ファイル: Markdown.cs プロジェクト: didixp/Ark-Dev-Kit
        /// <summary>
        /// Create a new Markdown instance and set the options from the MarkdownOptions object.
        /// </summary>
        public Markdown(MarkdownOptions options)
        {
            _autoHyperlink = options.AutoHyperlink;
            _autoNewlines = options.AutoNewlines;
            _emptyElementSuffix = options.EmptyElementSuffix;
            _encodeProblemUrlCharacters = options.EncodeProblemUrlCharacters;
            _linkEmails = options.LinkEmails;
            _strictBoldItalic = options.StrictBoldItalic;

            Preprocessor = new Preprocessor.Preprocessor(this);
        }
コード例 #3
0
ファイル: Markdown.cs プロジェクト: didixp/Ark-Dev-Kit
        /// <summary>
        /// Create a new Markdown instance and optionally load options from a configuration
        /// file. There they should be stored in the appSettings section, available options are:
        /// 
        ///     Markdown.StrictBoldItalic (true/false)
        ///     Markdown.EmptyElementSuffix (">" or " />" without the quotes)
        ///     Markdown.LinkEmails (true/false)
        ///     Markdown.AutoNewLines (true/false)
        ///     Markdown.AutoHyperlink (true/false)
        ///     Markdown.EncodeProblemUrlCharacters (true/false) 
        ///     
        /// </summary>
        public Markdown(bool loadOptionsFromConfigFile)
        {
            JustReadVariableDefinitionsRun = false;

            Preprocessor = new Preprocessor.Preprocessor(this);

            if (!loadOptionsFromConfigFile) return;

            var settings = ConfigurationManager.AppSettings;
            foreach (string key in settings.Keys)
            {
                switch (key)
                {
                    case "Markdown.AutoHyperlink":
                        _autoHyperlink = Convert.ToBoolean(settings[key]);
                        break;
                    case "Markdown.AutoNewlines":
                        _autoNewlines = Convert.ToBoolean(settings[key]);
                        break;
                    case "Markdown.EmptyElementSuffix":
                        _emptyElementSuffix = settings[key];
                        break;
                    case "Markdown.EncodeProblemUrlCharacters":
                        _encodeProblemUrlCharacters = Convert.ToBoolean(settings[key]);
                        break;
                    case "Markdown.LinkEmails":
                        _linkEmails = Convert.ToBoolean(settings[key]);
                        break;
                    case "Markdown.StrictBoldItalic":
                        _strictBoldItalic = Convert.ToBoolean(settings[key]);
                        break;
                }
            }
        }
コード例 #4
0
 public string ParseVariablesDefinition(string text, string relPath, TransformationData data, PreprocessedTextLocationMap map)
 {
     return(Preprocessor.Replace(VariableDefinitionPattern, text, everyMatch => ParseVariableDefinition(everyMatch, relPath, data), map));
 }