Beispiel #1
0
        public string CompileForHtml(Form form, string text, HelpComponents helpComponents,
                                     TopicCompilerSettingsInterface topicCompilerSettings)
        {
            TopicCompiler topicCompiler = new TopicCompiler(form, helpComponents, _preprocessedTopic, topicCompilerSettings);

            return(topicCompiler.CompileForHtml(text));
        }
Beispiel #2
0
        public static string CompileForTitle(string filename)
        {
            try
            {
                string text = File.ReadAllText(filename);

                string startTag = TopicCompiler.MakeTag(TopicCompiler.TagTitle, true);
                string endTag   = TopicCompiler.MakeTag(TopicCompiler.TagTitle, false);

                int startTagPos = text.IndexOf(startTag);
                int endTagPos   = text.IndexOf(endTag);

                if (startTagPos >= 0 && endTagPos > startTagPos)
                {
                    int titlePos = startTagPos + startTag.Length;
                    return(text.Substring(titlePos, endTagPos - titlePos));
                }
            }

            catch (Exception)  // ignore errors
            {
            }

            return(null);
        }
Beispiel #3
0
        public string CompileForHtml(CSPro.Logic.Colorizer colorizer, string text,
                                     HelpComponents helpComponents, TopicCompilerSettingsInterface topicCompilerSettings)
        {
            TopicCompiler topicCompiler = new TopicCompiler(colorizer, helpComponents, _preprocessedTopic, topicCompilerSettings);

            return(topicCompiler.CompileForHtml(text));
        }
        private void DisplayTopic(Preprocessor.TopicPreprocessor preprocessedTopic, string topicText = null)
        {
            TopicCompiler topicCompiler = new TopicCompiler(_helpComponents, preprocessedTopic, _topicCompilerSettings);

            if (topicText == null)
            {
                topicText = File.ReadAllText(preprocessedTopic.Filename);
            }

            string html = topicCompiler.CompileForHtml(topicText);

            webBrowser.DocumentText = html;

            _lastDisplayedPreprocessedTopic = preprocessedTopic;
            labelTopicFilename.Text         = Path.GetFileName(_lastDisplayedPreprocessedTopic.Filename);
        }
Beispiel #5
0
 public string CompileForHtml(string[] lines,HelpComponents helpComponents,TopicCompilerSettingsInterface topicCompilerSettings)
 {
     TopicCompiler topicCompiler = new TopicCompiler(helpComponents,_preprocessedTopic,topicCompilerSettings);
     return topicCompiler.CompileForHtml(lines);
 }