Esempio n. 1
0
        public void PrepareDictionaries()
        {
            // Load plugin into lexer if we have plugin
            string jsonPluginContent;
            string pluginDir  = mediator.Config.StyleDirectoryPath;
            string pluginPath = IOTools.CombinePath(pluginDir, mediator.currentLanguage.Language);

            pluginPath = IOTools.ChangeExtension(pluginPath, Lexer.EXT);
            if (IOTools.ReadAllText(pluginPath, out jsonPluginContent))
            {
                lexer.LoadPlugin(jsonPluginContent);
            }
            // Load dictionaries
            foreach (string path in dictPathes)
            {
                Log.Logger.Debug(string.Format("Analyzing with: {0}", path));
                string content;
                if (IOTools.ReadAllText(path, out content))
                {
                    lexer.LoadDictionary(content);
                }
            }
            // Expand dictionary
            lexer.ExpandDictionary();
        }
Esempio n. 2
0
        public void LoadStyle()
        {
            // Load CSS file
            string cssContent;
            string cssDir  = mediator.Config.StyleDirectoryPath;
            string cssPath = IOTools.CombinePath(cssDir, mediator.currentLanguage.Language);

            cssPath = IOTools.ChangeExtension(cssPath, HTMLPrinter.STYLEEXT);
            if (IOTools.ReadAllText(cssPath, out cssContent))
            {
                printer.LoadCSS(cssContent);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Provides path to an output file created for a given fileName
        /// of the current project.
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public string GetOutPath(string fileName)
        {
            string outName = IOTools.ChangeExtension(fileName, HTMLPrinter.EXT);

            return(IOTools.CombinePath(mediator.Config.ProjectOutPath, outName));
        }