示例#1
0
 private void CompileDirectoriesRecursive(MingeParser parser, string [] directories, string root_dir, bool top)
 {
     foreach (string directory in directories)
     {
         CompileFiles(parser, top ? directory : root_dir, Directory.GetFiles(directory));
         CompileDirectoriesRecursive(parser, Directory.GetDirectories(directory), top ? directory : root_dir, false);
     }
 }
示例#2
0
        // Compiles all the templates that are found in the template directories
        public void CompileTemplates()
        {
            MingeParser p = new MingeParser(Environment, Application);

            CompileDirectoriesRecursive(p, Environment.TemplateDirectories, String.Empty, true);

            Application.Save();
        }
示例#3
0
        // Compiles all the templates that are found in the template directories
        public void CompileTemplates()
        {
            MingeParser p = new MingeParser (Environment, Application);

            CompileDirectoriesRecursive (p, Environment.TemplateDirectories, String.Empty, true);

            Application.Save ();
        }
示例#4
0
 private void CompileFiles(MingeParser parser, string root_dir, string [] files)
 {
     foreach (string file in files)
     {
         if (!Environment.AllowedExtensions.Contains(Path.GetExtension(file)))
         {
             continue;
         }
         ParsePage(file.Substring(root_dir.Length + 1));
     }
 }
示例#5
0
        internal Page ParsePage(string path)
        {
            MingeParser p = new MingeParser (Environment, Application);
            string full_path = FindFullPath (path);

            if (full_path == null)
                throw new Exception (String.Format ("Template not found: {0}", path));

            Page page = null;
            if (pages.TryGetValue (full_path, out page)) {
                return page;
            }

            using (TextReader tr = new StreamReader (File.OpenRead (full_path))) {
                page = p.ParsePage (path, tr);
            }

            pages.Add (full_path, page);
            return page;
        }
示例#6
0
        internal Page ParsePage(string path)
        {
            MingeParser p         = new MingeParser(Environment, Application);
            string      full_path = FindFullPath(path);

            if (full_path == null)
            {
                throw new Exception(String.Format("Template not found: {0}", path));
            }

            Page page = null;

            if (pages.TryGetValue(full_path, out page))
            {
                return(page);
            }

            using (TextReader tr = new StreamReader(File.OpenRead(full_path))) {
                page = p.ParsePage(path, tr);
            }

            pages.Add(full_path, page);
            return(page);
        }
示例#7
0
 private void CompileFiles(MingeParser parser, string root_dir, string [] files)
 {
     foreach (string file in files) {
         if (!Environment.AllowedExtensions.Contains (Path.GetExtension (file)))
             continue;
         ParsePage (file.Substring (root_dir.Length + 1));
     }
 }
示例#8
0
 private void CompileDirectoriesRecursive(MingeParser parser, string [] directories, string root_dir, bool top)
 {
     foreach (string directory in directories) {
         CompileFiles (parser, top ? directory : root_dir, Directory.GetFiles (directory));
         CompileDirectoriesRecursive (parser, Directory.GetDirectories (directory), top ? directory : root_dir, false);
     }
 }