Exemplo n.º 1
0
        public Config LoadConfig()
        {
            if(string.IsNullOrWhiteSpace(_input.StartFolder))
            {
                Console.WriteLine("[ERROR] Nothing to do, no start folder specified");
                return null;
            }

            var configFile = Path.Combine(_input.StartFolder, "docnet.json");
            if(!File.Exists(configFile))
            {
                Console.WriteLine("[ERROR] {0} not found.", configFile);
                return null;
            }

            var config = new Config();
            if(!config.Load(configFile))
            {
                Console.WriteLine("Errors occurred, can't continue!");
                return null;
            }
            if(config.Pages.IndexElement == null)
            {
                Console.WriteLine("[ERROR] Root __index not found. The root navigationlevel is required to have an __index element");
                return null;
            }
            return config;
        }
Exemplo n.º 2
0
 public int DoWork()
 {
     _loadedConfig = LoadConfig();
     if(_loadedConfig == null)
     {
         return 1;
     }
     GeneratePages();
     return 0;
 }