[
  {
    "path": "Controllers/Home/Index.bat",
    "content": "@echo off\r\ncall ..\\..\\Views\\Shared\\_header DoD Congratulations\r\ncall ..\\..\\h\\h1 Congratulations\r\necho [p]You've put [strong]DOS on DOPE[/strong][/p]\r\necho.\r\necho [p]Available controllers...[/p]\r\necho [blockquote]\r\necho [ul]   \r\npushd %cd%\r\ncd ..\r\n   FOR /F \"delims=~\" %%A IN (' DIR /B/a:d') DO (\r\n      echo [li][a href='%%A/']%%A[/a][/li]\r\n   )\r\necho [/ul]\r\necho [/blockquote]\r\necho [p]To Add a controller, navigate to:[/p]\r\necho [blockquote][pre]%cd%] [/pre][/blockquote]\r\npopd\r\n\r\necho [p]and type:[/p]\r\n\r\necho [blockquote][pre]Dope Controller [em]ControllerName[/em][/pre][/blockquote]\r\necho.\r\necho [p]To change this default controller, edit:[/p]\r\necho [blockquote][pre]\"%cd%\\Index.bat\"[/pre][/blockquote]\r\n\r\necho [p]To create new actions, add batchfiles to this folder, e.g. [/p]\r\necho [blockquote][pre]%cd%]Copy con About.bat\r\necho echo [[p]]Hello world![[/p]]\r\necho [[ctrl-Z]][/pre][/blockquote]\r\n\r\n\r\n"
  },
  {
    "path": "Controllers/_actionMissing.bat",
    "content": "@echo off\r\ncall ..\\Views\\Shared\\_header Action Missing\r\ncall ..\\h\\h1 Action Missing\r\necho [p]Controller = %1[/p]\r\necho [p]Action = %2[/p]\r\necho [p]Parameters = %*[/p]\r\necho [p]Available Actions to GET for this controller...[p]\r\necho [blockquote][pre]\r\necho [OL]\r\n   FOR /F \"delims=~\" %%A IN (' DIR %1\\*.bat /B/a:-d') DO (\r\n       echo [A href='%%~nA']%%~nA[/A]\r\n   )\r\necho [/OL]\r\necho [/blockquote][/pre]\r\n\r\necho [p]Available Actions to POST for this controller...[p]\r\necho [blockquote][pre]\r\necho [OL]\r\n   FOR /F \"delims=~\" %%A IN (' DIR %1\\*.cmd /B/a:-d') DO (\r\n       echo [A href='%%~nA']%%~nA[/A]\r\n   )\r\necho [/OL]\r\necho [/blockquote][/pre]\r\n\r\nexit 44"
  },
  {
    "path": "Controllers/_controllerMissing.bat",
    "content": "@echo off\r\ncall ..\\Views\\Shared\\_header Controller Missing\r\ncall ..\\h\\h1 Controller Missing\r\necho [p]Controller = %1[/p]\r\necho [p]Action = %2[/p]\r\necho [p]Parameters = %*[/p]\r\necho [p]Available controllers...[/p]\r\necho [blockquote][pre]\r\necho [OL]\r\n   FOR /F \"delims=~\" %%A IN (' DIR /B/a:d') DO (\r\n       echo [A href='%%A/']%%A[/A]\r\n   )\r\necho [/OL]\r\necho [/blockquote][/pre]\r\n\r\nexit 44"
  },
  {
    "path": "Default.aspx",
    "content": "﻿<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"Default.aspx.cs\" Inherits=\"DosOnDope._Default\" %>\r\n\r\n<%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a \"/\" request to the server. --%>\r\n"
  },
  {
    "path": "Default.aspx.cs",
    "content": "﻿using System.Web;\r\nusing System.Web.Mvc;\r\nusing System.Web.UI;\r\n\r\nnamespace DosOnDope\r\n{\r\n    public partial class _Default : Page\r\n    {\r\n        public void Page_Load(object sender, System.EventArgs e)\r\n        {\r\n            HttpContext.Current.RewritePath(Request.ApplicationPath, false);\r\n            IHttpHandler httpHandler = new MvcHttpHandler();\r\n            httpHandler.ProcessRequest(HttpContext.Current);\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "DosOnDope.csproj",
    "content": "﻿<Project ToolsVersion=\"3.5\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <ProductVersion>9.0.21022</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <ProjectGuid>{80FA3DFC-363C-4B35-AAA5-0FD3C17B8ECB}</ProjectGuid>\r\n    <ProjectTypeGuids>{603c0e0b-db56-11dc-be95-000d561079b0};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r\n    <OutputType>Library</OutputType>\r\n    <AppDesignerFolder>Properties</AppDesignerFolder>\r\n    <RootNamespace>DosOnDope</RootNamespace>\r\n    <AssemblyName>DosOnDope</AssemblyName>\r\n    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r\n    <MvcBuildViews>false</MvcBuildViews>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\</OutputPath>\r\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>pdbonly</DebugType>\r\n    <Optimize>true</Optimize>\r\n    <OutputPath>bin\\</OutputPath>\r\n    <DefineConstants>TRACE</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Core\">\r\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\r\n    </Reference>\r\n    <Reference Include=\"System.Web.Abstractions\">\r\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\r\n    </Reference>\r\n    <Reference Include=\"System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL\" />\r\n    <Reference Include=\"System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL\">\r\n      <SpecificVersion>False</SpecificVersion>\r\n      <HintPath>..\\..\\..\\..\\Program Files\\Microsoft ASP.NET\\ASP.NET MVC RC\\Assemblies\\System.Web.Routing.dll</HintPath>\r\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\r\n    </Reference>\r\n    <Reference Include=\"System.Web\" />\r\n    <Reference Include=\"System.Web.Services\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"Default.aspx.cs\">\r\n      <DependentUpon>Default.aspx</DependentUpon>\r\n      <SubType>ASPXCodeBehind</SubType>\r\n    </Compile>\r\n    <Compile Include=\"Global.asax.cs\">\r\n      <DependentUpon>Global.asax</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Content Include=\"Content\\Logo.png\" />\r\n    <Content Include=\"Default.aspx\" />\r\n    <Content Include=\"favicon.ico\" />\r\n    <Content Include=\"Global.asax\" />\r\n    <Content Include=\"Web.config\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"Controllers\\Blog\\add.bat\" />\r\n    <None Include=\"Controllers\\Blog\\add.cmd\" />\r\n    <None Include=\"Controllers\\Blog\\Index.bat\" />\r\n    <None Include=\"Controllers\\Blog\\view.bat\" />\r\n    <Content Include=\"Content\\li.png\" />\r\n    <Content Include=\"Controllers\\Home\\Index.bat\" />\r\n    <Content Include=\"Controllers\\_actionMissing.bat\" />\r\n    <Content Include=\"Controllers\\_controllerMissing.bat\" />\r\n    <Content Include=\"dope.bat\" />\r\n    <Content Include=\"h\\a.bat\" />\r\n    <Content Include=\"h\\h1.bat\" />\r\n    <Content Include=\"h\\h2.bat\" />\r\n    <Content Include=\"h\\h3.bat\" />\r\n    <Content Include=\"h\\p.bat\" />\r\n    <None Include=\"Models\\Posts.csv\" />\r\n    <Content Include=\"Models\\split.vbs\" />\r\n    <Content Include=\"Views\\Shared\\_header.bat\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Folder Include=\"Views\\Home\\\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\r\n  <Import Project=\"$(MSBuildExtensionsPath)\\Microsoft\\VisualStudio\\v9.0\\WebApplications\\Microsoft.WebApplication.targets\" />\r\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r\n       Other similar extension points exist, see Microsoft.Common.targets.\r\n  <Target Name=\"BeforeBuild\">\r\n  </Target> -->\r\n  <Target Name=\"AfterBuild\" Condition=\"'$(MvcBuildViews)'=='true'\">\r\n    <AspNetCompiler VirtualPath=\"temp\" PhysicalPath=\"$(ProjectDir)\\..\\$(ProjectName)\" />\r\n  </Target>\r\n  <ProjectExtensions>\r\n    <VisualStudio>\r\n      <FlavorProperties GUID=\"{349c5851-65df-11da-9384-00065b846f21}\">\r\n        <WebProjectProperties>\r\n          <UseIIS>False</UseIIS>\r\n          <AutoAssignPort>True</AutoAssignPort>\r\n          <DevelopmentServerPort>11835</DevelopmentServerPort>\r\n          <DevelopmentServerVPath>/</DevelopmentServerVPath>\r\n          <IISUrl>\r\n          </IISUrl>\r\n          <NTLMAuthentication>False</NTLMAuthentication>\r\n          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>\r\n        </WebProjectProperties>\r\n      </FlavorProperties>\r\n    </VisualStudio>\r\n  </ProjectExtensions>\r\n</Project>"
  },
  {
    "path": "Global.asax",
    "content": "﻿<%@ Application Codebehind=\"Global.asax.cs\" Inherits=\"DosOnDope.MvcApplication\" Language=\"C#\" %>\r\n"
  },
  {
    "path": "Global.asax.cs",
    "content": "﻿using System;\r\nusing System.Diagnostics;\r\nusing System.IO;\r\nusing System.Web;\r\nusing System.Web.Mvc;\r\nusing System.Web.Routing;\r\n\r\nnamespace DosOnDope\r\n{\r\n    public class MvcApplication : System.Web.HttpApplication\r\n    {\r\n        public static void RegisterRoutes(RouteCollection routes)\r\n        {\r\n            routes.IgnoreRoute(\"{resource}.axd/{*pathInfo}\");\r\n            routes.IgnoreRoute(\"favicon.ico\");\r\n            routes.IgnoreRoute(\"Content/{*pathInfo}\");\r\n\r\n            routes.Add(new Route(\"{controller}/{action}/{*id}\", new DosOnDopeRouteHandler())\r\n            {\r\n                Defaults = new RouteValueDictionary(new\r\n                {\r\n                    controller = \"Home\",\r\n                    action = \"Index\",\r\n                    id = \"\"\r\n                })\r\n            });\r\n        }\r\n\r\n        protected void Application_Start()\r\n        {\r\n            RegisterRoutes(RouteTable.Routes);\r\n        }\r\n    }\r\n\r\n    public class DosOnDopeRouteHandler : IRouteHandler\r\n    {\r\n        public IHttpHandler GetHttpHandler(RequestContext requestContext)\r\n        {\r\n            return new DosOnDopeHttpHandler(requestContext);\r\n        }\r\n    }\r\n\r\n    public class DosOnDopeHttpHandler : IHttpHandler\r\n    {\r\n        public RequestContext requestContext { get; set; }\r\n        public DosOnDopeHttpHandler(RequestContext requestContext)\r\n        {\r\n            this.requestContext = requestContext;\r\n        }\r\n        \r\n        public bool IsReusable {get { return false; } }\r\n\r\n        public void ProcessRequest(HttpContext context)\r\n        {\r\n            var controller = this.requestContext.RouteData.Values[\"controller\"] as string;\r\n            var action = this.requestContext.RouteData.Values[\"action\"] as string;\r\n            string[] args = { this.requestContext.RouteData.Values[\"id\"] as string };\r\n            int httpStatus;\r\n            if (context.Request.RequestType == \"POST\")\r\n            {\r\n                var result = Execute(controller, action, context.Request.Form.ToString().Split('&'), out httpStatus, true);\r\n                if (httpStatus == 301)\r\n                    context.Response.Redirect(result.Trim(\"\\r\\n\".ToCharArray()));\r\n                else\r\n                    context.Response.Write(result);                \r\n            }\r\n            else\r\n            {\r\n                context.Response.Write(Execute(controller, action, args, out httpStatus, false ));      \r\n            }\r\n            context.Response.StatusCode = httpStatus;\r\n        }\r\n\r\n        public string Execute(string controllerName, string actionName, string[] newArgs, out int httpStatus, bool isPost)\r\n        {\r\n            var controllerPath = Path.Combine(requestContext.HttpContext.Server.MapPath(\"~/Controllers\"), controllerName);\r\n\r\n            if (!Directory.Exists(controllerPath))\r\n            {\r\n                return ControllerNotFound(controllerName, actionName, newArgs, out httpStatus, isPost);\r\n            }\r\n\r\n            var actionFileName = Path.Combine(controllerPath, actionName + \".bat\");\r\n\r\n            if (!File.Exists(actionFileName))\r\n            {\r\n                return ActionNotFound(controllerName, actionName, newArgs, out httpStatus, isPost);\r\n            }\r\n            \r\n            return Execute(controllerPath, actionName, Join(\" \", newArgs), out httpStatus, isPost);\r\n        }\r\n\r\n        private string Execute(string path, string file, string args, out int httpStatus, bool isPost)\r\n        {\r\n            var errorLevel = 50;\r\n            var result = string.Empty;\r\n\r\n            using (var proc = new Process())\r\n            {\r\n                proc.EnableRaisingEvents = false;\r\n\r\n                proc.StartInfo.FileName = Path.Combine(path, file + (isPost? \".cmd\" : \".bat\"));\r\n                if (args != null)\r\n                {\r\n                    proc.StartInfo.Arguments = args;\r\n                }\r\n                proc.StartInfo.WorkingDirectory = path;\r\n                proc.StartInfo.UseShellExecute = false;\r\n                proc.StartInfo.CreateNoWindow = true;// false;\r\n                proc.StartInfo.RedirectStandardOutput = true;\r\n                proc.Start();\r\n                string output = proc.StandardOutput.ReadToEnd();\r\n                result = Dope(output);\r\n                proc.WaitForExit();\r\n                errorLevel = proc.ExitCode;\r\n            }\r\n            httpStatus = ConvertErrorlevelToHttpStatus(errorLevel);\r\n            return result;\r\n        }\r\n\r\n        private string ActionNotFound(string controllerName, string actionName, string[] newArgs, out int httpStatus, bool isPost)\r\n        {\r\n            var controllerPath = Path.Combine(requestContext.HttpContext.Server.MapPath(\"~/Controllers\"), controllerName);\r\n\r\n            if (!File.Exists(Path.Combine(controllerPath, \"_actionMissing\" + \".bat\")))\r\n            {\r\n                controllerPath = requestContext.HttpContext.Server.MapPath(\"~/Controllers\");\r\n            }\r\n\r\n            return Execute(controllerPath, \"_ActionMissing\", controllerName + \" \" + actionName + \" \" + Join(\" \", newArgs), out httpStatus, false);\r\n        }\r\n\r\n        private string ControllerNotFound(string controllerName, string actionName, string[] newArgs, out int httpStatus, bool isPost)\r\n        {\r\n            var controllerPath = requestContext.HttpContext.Server.MapPath(\"~/Controllers\");\r\n            return Execute(controllerPath, \"_ControllerMissing\", controllerName + \" \" + actionName + \" \" + Join(\" \", newArgs), out httpStatus, false);\r\n        }\r\n\r\n\r\n        private int ConvertErrorlevelToHttpStatus(int errorLevel)\r\n        {\r\n            if (errorLevel == 0) return 200;\r\n            return ((errorLevel / 10) * 100) + (errorLevel % 10);\r\n        }\r\n\r\n\r\n        private string Join(string separator, params string[] strings)\r\n        {\r\n            if (strings == null) return string.Empty;\r\n            return string.Join(separator, strings);\r\n        }\r\n\r\n        /// <summary>\r\n        /// Dopes the input.\r\n        /// i.e:\r\n        ///   Turns square brackets into angle brackets\r\n        ///   Turns pluses into spaces.\r\n        ///   Escapes angle brackets\r\n        ///   Turns escaped square brackets into regular square brackets\r\n        ///   Turns url encoded CR/LF into spaces\r\n        /// </summary>\r\n        /// <param name=\"undoped\">The undoped.</param>\r\n        /// <returns></returns>\r\n        private string Dope(string undoped)\r\n        {\r\n            if (undoped.IndexOf(\"[[\") >= 0 || undoped.IndexOf(\"]]\") >= 0)\r\n            {\r\n                var gOpen = Guid.NewGuid().ToString();\r\n                var gClose = Guid.NewGuid().ToString();\r\n                undoped = undoped.Replace(\"[[\", gOpen).Replace(\"]]\", gClose);\r\n                undoped = Dope(undoped);\r\n                return undoped.Replace(gOpen, \"[\").Replace(gClose, \"]\");\r\n            }\r\n            return undoped.Replace(\"<\",\"&lt\").Replace(\">\",\"&gt;\").Replace(\"[\", \"<\").Replace(\"]\", \">\").Replace(\"+\",\" \").Replace(\"%0d\",\" \").Replace(\"%0a\",\" \");\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2010-2024 secretGeek\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "Models/split.vbs",
    "content": "Set objFS = CreateObject(\"Scripting.FileSystemObject\") \r\nSet objArgs = WScript.Arguments \r\nstr1 = objArgs(0) \r\ns=Split(str1,\"`\") \r\nFor i=LBound(s) To UBound(s) \r\n    WScript.Echo s(i) \r\n    ' WScript.Echo s(9) ' get the 10th element \r\nNext "
  },
  {
    "path": "Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\r\nusing System.Runtime.InteropServices;\r\n\r\n// General Information about an assembly is controlled through the following \r\n// set of mad attributes. Change these attribute values to modify the information\r\n// associated with an assembly. If. You. Dare.\r\n[assembly: AssemblyTitle(\"DosOnDope\")]\r\n[assembly: AssemblyDescription(\"Built with DosOnDope\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assembly: AssemblyCompany(\"secretGeek\")]\r\n[assembly: AssemblyProduct(\"DosOnDope\")]\r\n[assembly: AssemblyCopyright(\"Copyright © Leon Bambrick 2010\")]\r\n[assembly: AssemblyTrademark(\"DosOnDope\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// COM is for old people.\r\n[assembly: ComVisible(false)]\r\n\r\n// This is my GUID. Mess with it: and I will hurt your face.\r\n[assembly: Guid(\"667ff6b2-8224-45e2-b13d-0d02685520a3\")]\r\n\r\n// Version information for an assembly consists of the following five values:\r\n//\r\n//      Major Version\r\n//      Minor Version \r\n//      Guild Number\r\n//      Karma points\r\n//      Revision\r\n//\r\n// You can specify all the values or you can default the Revision and Build Numbers \r\n// by using the '*' wild-card. Are you wild? I'm not wild. I program.\r\n[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]"
  },
  {
    "path": "README.md",
    "content": "# DOS on DOPE\n\n![logo](docs/Dos_on_Dope_Logo.png)\n\n\n*The last MVC Web framework you'll ever need*\n\nWhen you've done everything you can with [Ruby On Rails](http://rubyonrails.org/)\n\nWhen you've reached the limits of *Haskell on a Horse* and *Cobol on Cogs*...\n\nIt's time to meet _the MVC Web Framework to end all MVC Web frameworks._\n\n## DOS on DOPE is the modern MVC framework built on the awesome power of batch files.\n\nAll of the controllers in DoD are batch files.\n\nAll of the views are batch files.\n\nThe model is based on batch files. The helper functions are... you guessed it! Beautiful batch files!\n\n(Okay, I'm no purist. There's a few lines of C# for url routing and batch file execution. Everything else is either a .bat or a .cmd file. With a liberal helping of .csv mixed in.)\n\n# [Getting Started](docs/GettingStarted.md)\n\n_See how to build a site in just seconds!_\n\n## [How Does It Work?](docs/HowDoesItWork.md)\n\n_Look behind the curtain to see how the magic is made_\n\n### [Introduction at secretGeek](http://secretgeek.net/dod_intro)\n\n\n![you've put dos on dope](docs/Home_dod_congrats.png)\n\n"
  },
  {
    "path": "Views/Shared/_header.bat",
    "content": "@echo off\r\necho [html]\r\necho [head]\r\necho [style]body{background-color:#000;color:#C0C0C0;font-family:\"fixed sys\",\"Lucida console\",monospace}input,textarea{background-color:#222;color:#FFF}h1,h2,h3,h4{font-size:medium}h1{color:white}strong{font-size:medium;color:yellow}pre{font-family:\"fixed sys\",\"Lucida console\"}em{font-style:normal;color:#808080}ul{list-style-image: url(Content/li.png);}a{text-decoration:none;color:008080}[/style]\r\n\r\nIF x\"%*\"==x\"\"  \tGOTO DEFAULT\r\n\r\necho [title]%*[/title]\r\n\r\ngoto END\r\n\r\n:DEFAULT\r\necho [title]DosOnDope[/title]\r\ngoto END\r\n\r\n:END\r\necho [/head]\r\necho [body]\r\necho [img src='Content/Logo.png' style='float:right' /]"
  },
  {
    "path": "Web.config",
    "content": "<?xml version=\"1.0\"?>\r\n<!-- \r\n    Note: As an alternative to hand editing this file you can use the \r\n    web admin tool to configure settings for your application. Use\r\n    the Website->Asp.Net Configuration option in Visual Studio.\r\n    A full list of settings and comments can be found in \r\n    machine.config.comments usually located in \r\n    \\Windows\\Microsoft.Net\\Framework\\v2.x\\Config \r\n-->\r\n<configuration>\r\n\t<configSections>\r\n\t\t<sectionGroup name=\"system.web.extensions\" type=\"System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\">\r\n\t\t\t<sectionGroup name=\"scripting\" type=\"System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\">\r\n\t\t\t\t<section name=\"scriptResourceHandler\" type=\"System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\" requirePermission=\"false\" allowDefinition=\"MachineToApplication\"/>\r\n\t\t\t\t<sectionGroup name=\"webServices\" type=\"System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\">\r\n\t\t\t\t\t<section name=\"jsonSerialization\" type=\"System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\" requirePermission=\"false\" allowDefinition=\"Everywhere\"/>\r\n\t\t\t\t\t<section name=\"profileService\" type=\"System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\" requirePermission=\"false\" allowDefinition=\"MachineToApplication\"/>\r\n\t\t\t\t\t<section name=\"authenticationService\" type=\"System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\" requirePermission=\"false\" allowDefinition=\"MachineToApplication\"/>\r\n\t\t\t\t\t<section name=\"roleService\" type=\"System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\" requirePermission=\"false\" allowDefinition=\"MachineToApplication\"/>\r\n\t\t\t\t</sectionGroup>\r\n\t\t\t</sectionGroup>\r\n\t\t</sectionGroup>\r\n\t</configSections>\r\n\t<appSettings/>\r\n\t<connectionStrings>\r\n\t\t<add name=\"ApplicationServices\" connectionString=\"data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true\" providerName=\"System.Data.SqlClient\"/>\r\n\t</connectionStrings>\r\n\t<system.web>\r\n\t\t<!-- \r\n            Set compilation debug=\"true\" to insert debugging \r\n            symbols into the compiled page. Because this \r\n            affects performance, set this value to true only \r\n            during development.\r\n    -->\r\n\t\t<compilation debug=\"true\">\r\n\t\t\t<assemblies>\r\n\t\t\t\t<add assembly=\"System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089\"/>\r\n\t\t\t\t<add assembly=\"System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t\t<add assembly=\"System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t\t<add assembly=\"System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t\t<add assembly=\"System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t\t<add assembly=\"System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089\"/>\r\n\t\t\t\t<add assembly=\"System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089\"/>\r\n\t\t\t\t<add assembly=\"System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089\"/>\r\n\t\t\t</assemblies>\r\n\t\t</compilation>\r\n\t\t<!--\r\n            The <authentication> section enables configuration \r\n            of the security authentication mode used by \r\n            ASP.NET to identify an incoming user. \r\n    -->\r\n\t\t<authentication mode=\"Forms\">\r\n\t\t\t<forms loginUrl=\"~/Account/Login\"/>\r\n\t\t</authentication>\r\n\t\t<membership>\r\n\t\t\t<providers>\r\n\t\t\t\t<clear/>\r\n\t\t\t\t<add name=\"AspNetSqlMembershipProvider\" type=\"System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" connectionStringName=\"ApplicationServices\" enablePasswordRetrieval=\"false\" enablePasswordReset=\"true\" requiresQuestionAndAnswer=\"false\" requiresUniqueEmail=\"false\" passwordFormat=\"Hashed\" maxInvalidPasswordAttempts=\"5\" minRequiredPasswordLength=\"6\" minRequiredNonalphanumericCharacters=\"0\" passwordAttemptWindow=\"10\" passwordStrengthRegularExpression=\"\" applicationName=\"/\"/>\r\n\t\t\t</providers>\r\n\t\t</membership>\r\n\t\t<profile>\r\n\t\t\t<providers>\r\n\t\t\t\t<clear/>\r\n\t\t\t\t<add name=\"AspNetSqlProfileProvider\" type=\"System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" connectionStringName=\"ApplicationServices\" applicationName=\"/\"/>\r\n\t\t\t</providers>\r\n\t\t</profile>\r\n\t\t<roleManager enabled=\"false\">\r\n\t\t\t<providers>\r\n\t\t\t\t<clear/>\r\n\t\t\t\t<add connectionStringName=\"ApplicationServices\" applicationName=\"/\" name=\"AspNetSqlRoleProvider\" type=\"System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"/>\r\n\t\t\t\t<add applicationName=\"/\" name=\"AspNetWindowsTokenRoleProvider\" type=\"System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"/>\r\n\t\t\t</providers>\r\n\t\t</roleManager>\r\n\t\t<!--\r\n            The <customErrors> section enables configuration \r\n            of what to do if/when an unhandled error occurs \r\n            during the execution of a request. Specifically, \r\n            it enables developers to configure html error pages \r\n            to be displayed in place of a error stack trace.\r\n\r\n        <customErrors mode=\"RemoteOnly\" defaultRedirect=\"GenericErrorPage.htm\">\r\n            <error statusCode=\"403\" redirect=\"NoAccess.htm\" />\r\n            <error statusCode=\"404\" redirect=\"FileNotFound.htm\" />\r\n        </customErrors>\r\n    -->\r\n\t\t<pages>\r\n\t\t\t<controls>\r\n\t\t\t\t<add tagPrefix=\"asp\" namespace=\"System.Web.UI\" assembly=\"System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t\t<add tagPrefix=\"asp\" namespace=\"System.Web.UI.WebControls\" assembly=\"System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t</controls>\r\n\t\t\t<namespaces>\r\n\t\t\t\t<add namespace=\"System.Web.Mvc\"/>\r\n\t\t\t\t<add namespace=\"System.Web.Mvc.Ajax\"/>\r\n\t\t\t\t<add namespace=\"System.Web.Mvc.Html\"/>\r\n\t\t\t\t<add namespace=\"System.Web.Routing\"/>\r\n\t\t\t\t<add namespace=\"System.Linq\"/>\r\n\t\t\t\t<add namespace=\"System.Collections.Generic\"/>\r\n\t\t\t</namespaces>\r\n\t\t</pages>\r\n\t\t<httpHandlers>\r\n\t\t\t<remove verb=\"*\" path=\"*.asmx\"/>\r\n\t\t\t<add verb=\"*\" path=\"*.asmx\" validate=\"false\" type=\"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t<add verb=\"*\" path=\"*_AppService.axd\" validate=\"false\" type=\"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t<add verb=\"GET,HEAD\" path=\"ScriptResource.axd\" type=\"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\" validate=\"false\"/>\r\n\t\t\t<add verb=\"*\" path=\"*.mvc\" validate=\"false\" type=\"System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t</httpHandlers>\r\n\t\t<httpModules>\r\n\t\t\t<add name=\"ScriptModule\" type=\"System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t<add name=\"UrlRoutingModule\" type=\"System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t</httpModules>\r\n\t</system.web>\r\n\t<system.codedom>\r\n\t\t<compilers>\r\n\t\t\t<compiler language=\"c#;cs;csharp\" extension=\".cs\" warningLevel=\"4\" type=\"Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\r\n\t\t\t\t<providerOption name=\"CompilerVersion\" value=\"v3.5\"/>\r\n\t\t\t\t<providerOption name=\"WarnAsError\" value=\"false\"/>\r\n\t\t\t</compiler>\r\n\t\t\t<compiler language=\"vb;vbs;visualbasic;vbscript\" extension=\".vb\" warningLevel=\"4\" type=\"Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\">\r\n\t\t\t\t<providerOption name=\"CompilerVersion\" value=\"v3.5\"/>\r\n\t\t\t\t<providerOption name=\"OptionInfer\" value=\"true\"/>\r\n\t\t\t\t<providerOption name=\"WarnAsError\" value=\"false\"/>\r\n\t\t\t</compiler>\r\n\t\t</compilers>\r\n\t</system.codedom>\r\n\t<system.web.extensions/>\r\n\t<!-- \r\n        The system.webServer section is required for running ASP.NET AJAX under Internet\r\n        Information Services 7.0.  It is not necessary for previous version of IIS.\r\n  -->\r\n\t<system.webServer>\r\n\t\t<validation validateIntegratedModeConfiguration=\"false\"/>\r\n\t\t<modules runAllManagedModulesForAllRequests=\"true\">\r\n\t\t\t<remove name=\"ScriptModule\"/>\r\n\t\t\t<remove name=\"UrlRoutingModule\"/>\r\n\t\t\t<add name=\"ScriptModule\" preCondition=\"managedHandler\" type=\"System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t<add name=\"UrlRoutingModule\" type=\"System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t</modules>\r\n\t\t<handlers>\r\n\t\t\t<remove name=\"WebServiceHandlerFactory-Integrated\"/>\r\n\t\t\t<remove name=\"ScriptHandlerFactory\"/>\r\n\t\t\t<remove name=\"ScriptHandlerFactoryAppServices\"/>\r\n\t\t\t<remove name=\"ScriptResource\"/>\r\n\t\t\t<remove name=\"MvcHttpHandler\"/>\r\n\t\t\t<remove name=\"UrlRoutingHandler\"/>\r\n\t\t\t<add name=\"ScriptHandlerFactory\" verb=\"*\" path=\"*.asmx\" preCondition=\"integratedMode\" type=\"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t<add name=\"ScriptHandlerFactoryAppServices\" verb=\"*\" path=\"*_AppService.axd\" preCondition=\"integratedMode\" type=\"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t<add name=\"ScriptResource\" preCondition=\"integratedMode\" verb=\"GET,HEAD\" path=\"ScriptResource.axd\" type=\"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t<add name=\"MvcHttpHandler\" preCondition=\"integratedMode\" verb=\"*\" path=\"*.mvc\" type=\"System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\r\n\t\t\t<add name=\"UrlRoutingHandler\" preCondition=\"integratedMode\" verb=\"*\" path=\"UrlRouting.axd\" type=\"System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"/>\r\n\t\t</handlers>\r\n\t</system.webServer>\r\n</configuration>\r\n"
  },
  {
    "path": "docs/GettingStarted.md",
    "content": "# Getting started\n\nTo get started open a `cmd` window.\nIf you're not familiar with a `cmd` window, you soon will be. ;-)\n\nMake sure `dope.bat` file is in your `PATH`.\nIf you're not familiar with your `PATH`, you soon will be.  Wait a second. Read this 'Quick tip,'\n\n\n## QuickTip: Adding dope to your path\nIf `dope.bat` is in the folder `C:\\DoD` then type this:\n\n    PATH=%PATH%;c:\\DoD;\n\n`dope` will then be in your path.\n\n\n# Create a web application\n\nOkay. Moving on. \nFirst step, navigate to a folder where you want to create your web application.\ne.g.\n\n    C:\\>cd Temp\n    C:\\Temp>\n\nTemp is a great place to do all your work. It implies the kind of permanence that a Dos On Dope project deserves. \n\n**To create a site called `Blog` we use the \n`dope` command. It's as simple as this:**\n\n\n    C:\\Temp>dope site Blog\n\nTime for another quick tip:\n\n## QuickTip: Help from the Command Line\n\nIssue the `dope` command (i.e. call `dope.bat`) without any parameters, to get help. \n\nFor help with a particular command, try `dope help _commandname_`,\ne.g.\n\n    dope help site\n\n\n# Wrestling with IIS\n\nIIS is a little hard to control from the console, so you'll need to open IIS manager and register your site manually. Read the sidebar about how to do that.\n\n*(If we were using apache, tomcat or webrick we'd be able to do this from the command-line with ease.  If I took this project more seriously, I would have written a custom DOS-based web-server. But then I guess I would've been an even more depraved individual, so for now we're stuck with IIS.)*\n\n \n## QuickTip: Registering Manually with IIS\n\nAdd a virtual directory under the `Default Web Site`\nThen right click and 'convert to application'\nBrowse to the newly created application. \n\n\n# Did that work??\n\nLet's check in a browser that our new site is built.\n\n![congrats](GettingStarted_dod_congrats.png)\n\nOops. It worked. We're up and running.\n\n# Exploring our new app\n\nIt's generated the complete skeleton of the application. Here's what we see in the console:\n\n![blog](GettingStarted_dope_site_blog_.png)\n\nLet's see what's been created for us. We now have these folders:\n\n\n    C:\\temp\\blog>dir /s/a:d/b\n    C:\\temp\\blog\\Content\n    C:\\temp\\blog\\Controllers\n    C:\\temp\\blog\\h\n    C:\\temp\\blog\\Models\n    C:\\temp\\blog\\Scripts\n    C:\\temp\\blog\\Views\n    C:\\temp\\blog\\Controllers\\Home\n    C:\\temp\\blog\\Views\\Shared\n\nAnd these files:\n\n    C:\\temp\\blog>dir /s/a:-d/b\n    C:\\temp\\blog\\Default.aspx\n    C:\\temp\\blog\\favicon.ico\n    C:\\temp\\blog\\Global.asax\n    C:\\temp\\blog\\web.config\n    C:\\temp\\blog\\Content\\Site.css\n    C:\\temp\\blog\\Content\\li.png\n    C:\\temp\\blog\\Content\\Logo.png\n    C:\\temp\\blog\\Controllers\\_actionMissing.bat\n    C:\\temp\\blog\\Controllers\\_controllerMissing.bat\n    C:\\temp\\blog\\Controllers\\Home\\Index.bat\n    C:\\temp\\blog\\h\\a.bat\n    C:\\temp\\blog\\h\\h1.bat\n    C:\\temp\\blog\\h\\h2.bat\n    C:\\temp\\blog\\h\\h3.bat\n    C:\\temp\\blog\\h\\p.bat\n    C:\\temp\\blog\\Models\\split.vbs\n    C:\\temp\\blog\\Views\\Shared\\_header.bat\n\nAll the files you need for a modern MVC application. Built on batch files.\n\nWe have our site, and it shows the starting application. Let's create a new controller action, and see that it renders as expected..\n\n![action](GettingStarted_about_action.png)\n\n\n# Making it betterer\n\nIn this case, our batch file is basically a series of echo statements that write html to the screen. Instead of angle brackets we use square brackets. (This is because DOS uses angle brackets for re-direction.)\n\nWe can do a little better than that. \n\nWe can apply a theme by including a 'partial' view, called `_header.bat.`\n\nAnd we can use helper methods to create clean markup.\n\n![improved](GettingStarted_about_improved.png)\n\n\nNow, let's create a location for holding our data.\n\nIn DoD we embrace the NoSQL movement and jump straight to the data-store of the future: a CSV file.\n\n    C:\\temp>CD Blog\\Models\n    C:\\temp\\Blog\\Models>copy con Posts.csv\n    ID`Title`Article\n    ^Z\n\n\n`Posts.csv` is both the model that describes our data, and the store which will contain the data itself.\n\n(We use back-ticks rather than commas, so that there's no need to qualify our data with double-quotes. Back-ticks can never ever appear in real data in the wild, so this is perfectly safe forever.)\n\nNow we can generate actions for administering our Posts. This is similar to the 'scaffolding' feature of Ruby On Rails.\n\n    C:\\temp\\blog\\Models>dope gen Post\n    Generating actions for MODEL Post in Controller Home...\n\n\nNow, if we look in the Home controller we see four batch files that have been created.\n\n    C:\\temp\\blog\\Controllers\\Home>dir /b\n    add.bat\n    add.cmd\n    Index.bat\n    view.bat\n\nNotice there is an `add.bat` as well as an `add.cmd`. What's the difference? \n\n# The secret behind DoD... shhh... don't tell anyone.....\n\n**In DosOnDope, `GET` verbs are handled by Batch files (.bat), while `POST` verbs are handled by `.cmd` files.**\n\nLet's see what they look like. We browse to see the add action:\n\n![home add](GettingStarted_dod_home_add.png)\n\nThe generator has created a nice page for us, with a name and textbox for every field, so we can create new posts.\n\nWe enter some details...\n\n![home adding](GettingStarted_dod_home_adding.png)\n\n...click submit and see what happens.\n\n\n![home index](GettingStarted_dod_home_index.png)\n\nWe're back at the index page. But now it's a list of all the articles. There's only one for now. \n\nLet's see what it looks like if we've added another article:\n\n![home index](GettingStarted_dod_home_index_2.png)\n\nBehind the scenes when we pressed 'submit' the Http-Post was handled by `add.cmd` which unpacked the form variables and added the details to the file Posts.csv\n\n    C:\\temp\\blog\\Models>type Posts.csv\n    ID`Title`Article\n    1`Hello Brazil!`Yes, yes, hello indeed!\n    2`Let's add a second for good measure`Oh yeah\n\nThat's about it. We've demonstrated all the components you need to make wonderful apps. \n\nBest of luck. I hope dope is good to you.\n\nNow you might want to read about [How does it work?](HowDoesItWork.md)\n\nAre you look for David? David is not here currently. Man.\n\nMaybe go and read some of the stuff at [secretGeek](http://secretGeek.net)\n\n\n"
  },
  {
    "path": "docs/HowDoesItWork.md",
    "content": "# How does it work? \n## How *does* it work!?\n## HOW does IT work!?\n## (how can it work?)\n\nIn DosOnDope all URLs are constructed like this:\n\n`http://YourSite.com/Controller/Action/*id`\n\nWhere:\n\n * `\"Controller\"` is the name of a **folder** in the Controllers folder.\n * `\"Action\"` is the name of a **batch file** in the relevant controller folder.\n * `\"*id\"` is an optional set of **parameters** passed to the batch file.\n\n(Turning a URL into a batch file call is performed by a custom C# router, `DosOnDopeRouteHandler` which hands off to the http handler `DosOnDopeHttpHandler`)\n\nIf the subfolder \"`Controller`\" in the `Controllers` folder is not found, `_controllerMissing.bat` is called.\n\nThis is the default `_controllerMissing` batch file included in every DosOnDope application. It sits in the `Controllers` folder. It returns a web page telling you what controllers are available, and you will usually customize it to suit your own purposes.\n\nIf there is no batch file matching the name of the `action` that was called, then the `_actionMissing` batch file is executed.\n\nThis is the default `_actionMissing` batch file included in every DosOnDope application. It returns a web page telling you what actions are available for the controller you requested. You are free to customize it however you wish.\n\n* If the request is a `GET` method, the handler looks for a `.bat` batch file.\n* If the request is a `POST` method, the handler looks for a `.cmd` batch file. \n\nSo for example a `GET` request to `http://YourSite.com/Blog/Add` would cause the handler to execute a batch file located at\n\n\tC:\\Temp\\YourSite\\Controllers\\Blog\\Add.bat\n\nA `POST` to `http://YourSite.com/Blog/Add` would cause the handler to execute a batch file located at:\n\n\tC:\\Temp\\YourSite\\Controllers\\Blog\\Add.cmd\n\nA `GET` to `http://YourSite.com/Blog/View/Yes` would cause the handler to execute a batch file `View.bat` with the parameter \"Yes\"\n\n\tC:\\Temp\\YourSite\\Controllers\\Blog\\View.bat Yes\n\nSo, inside the `View.bat` script, you could say:\n\n\t@echo [p]Hello! You said %1.[/p]\nWhich would be converted into:\n\n\t<p>Hello! You said Yes.</p>\n\nAnd be rendered by a browser as:\n\n> Hello! You said Yes.\n\n(By the way, echoing user input from a URL to the screen is a very safe and wise thing to do. Do that any chance you can.)\n\nWhy not read about [Getting started](GettingStarted.md)\n\nDave's not here currently. Man. etc.\n\nMaybe read the original blog post about this nonsense at [secretGeek: dos on dope](http://secretgeek.net/dod_intro)\n\n"
  },
  {
    "path": "dope.bat",
    "content": "@echo off\r\n\r\nSET LOCN=\"%~dp0\"\r\n\r\nif x'%2'==x'/?' goto COMMAND_HELP\r\nif x'%2'==x'?'goto COMMAND_HELP\r\nif x'%2'==x'-?'goto COMMAND_HELP\r\nif x'%2'==x'--?'goto COMMAND_HELP\r\n\r\nif x'%1'==x'' goto UNKNOWN\r\nif '%1'=='site' goto SITE\r\nif '%1'=='controller' goto CONTROLLER\r\nif '%1'=='gen' goto GEN\r\nif '%1'=='help' goto HELP\r\nif '%1'=='?' goto HELP\r\nif '%1'=='/?' goto HELP\r\nif '%1'=='-?' goto HELP\r\nif '%1'=='--?' goto HELP\r\nif '%1'=='SITE' goto SITE\r\nif '%1'=='CONTROLLER' goto CONTROLLER\r\nif '%1'=='GEN' goto GEN\r\nif '%1'=='HELP' goto HELP\r\nif '%1'=='Help' goto HELP\r\n\r\ngoto UNKNOWN\r\n\r\n:COMMAND_HELP\r\nif '%1'=='site' goto HELP_SITE\r\nif '%1'=='controller' goto HELP_CONTROLLER\r\nif '%1'=='model' goto HELP_MODEL\r\nif '%1'=='gen' goto HELP_GEN\r\nif '%1'=='help' goto HELP\r\nif '%1'=='SITE' goto HELP_SITE\r\nif '%1'=='CONTROLLER' goto HELP_CONTROLLER\r\nif '%1'=='MODEL' goto HELP_MODEL\r\nif '%1'=='GEN' goto HELP_GEN\r\nif '%1'=='HELP' goto HELP\r\n\r\nECHO Unknown command %1\r\nGOTO HELP\r\n\r\n:HELP_SITE\r\n\r\necho dope SITE [[name]] \r\necho   will create a SITE named 'name'\r\necho   in the current folder.\r\necho e.g:\r\necho dope SITE Blog\r\necho   will create a site named 'Blog'\r\necho.\r\necho The site will, by default, include\r\necho sufficient files (styles, helpers etc)\r\necho to get you started.\r\necho.\r\necho A good next step is to create a controller\r\necho using the 'dope CONTROLLER' command\r\n\r\ngoto EXIT\r\n:HELP_CONTROLLER\r\n\r\necho dope CONTROLLER [[name]] \r\necho   Create a CONTROLLER named 'name'\r\necho   in the SITE\\Controllers\\ folder\r\necho e.g.\r\necho dope CONTROLLER About\r\necho   Creates a controller folder named 'About'\r\necho   in the current site's 'Controllers' folder\r\necho   containing a default action, 'Index.bat'\r\necho   To navigate to the new action goto\r\necho     http://YourSite/About/\r\necho   or \r\necho     http://YourSite/About/Index\r\necho.\r\necho To create more actions, navigate into\r\necho the newly created folder and create more\r\necho batch files. No wiring required.\r\ngoto EXIT\r\n:HELP_GEN\r\n\r\necho dope GEN [[name]] [[controller]]\r\necho   Generate actions for the model named 'name'\r\necho   (singular) in the controller specified.\r\necho.\r\necho (The controller name is optional. If no \r\necho controller is specified, the default \r\necho controller, 'home', will be used.)\r\necho.\r\necho Before generating the actions, you need\r\necho to create the model file.\r\ngoto HELP_MODEL\r\n\r\n\r\ngoto EXIT\r\n\r\n:HELP_MODEL\r\necho.\r\necho A model file is a CSV file in the models\r\necho folder. The first line of the file is a \r\necho lists of fields, separated with backtick `\r\necho characters, e.g. Emails.csv might contain:\r\necho ID`FirstName`LastName`Age`Email\r\necho. \r\necho The file name is plural.\r\n\r\ngoto EXIT\r\n:SITE\r\necho Creating SITE... %2\r\nif not exist %2 MD %2\r\necho ...Created Content folder (for CSS and images)\r\nif not exist %2\\Content MD %2\\Content\r\necho ...Created Controllers folder (for Controllers)\r\nif not exist %2\\Controllers MD %2\\Controllers\r\necho ...Created Controllers\\Home folder (Default Controller)\r\nif not exist %2\\Controllers\\Home MD %2\\Controllers\\Home\r\necho ...Created h folder (for html helpers)\r\nif not exist %2\\h MD %2\\h\r\necho ...Created Models folder (for Models)\r\nif not exist %2\\Models MD %2\\Models\r\necho ...Created Scripts folder (for javascript)\r\nif not exist %2\\Scripts MD %2\\Scripts\r\necho ...Created Views folder (for views)\r\nif not exist %2\\Views MD %2\\Views\r\necho ...Created Views\\Shared folder (for Shared views)\r\nif not exist %2\\Views\\Shared MD %2\\Views\\Shared\r\necho ...Created bin folder \r\nif not exist %2\\bin MD %2\\bin\r\n\r\necho ...adding Web.config\r\nCopy %LOCN%Web.config %2%\\web.config\r\n\r\necho ...adding Default.aspx\r\nCopy %LOCN%Default.aspx %2%\\Default.aspx\r\n\r\necho ...adding Global.asax\r\nCopy %LOCN%Global.asax %2%\\Global.asax\r\n\r\necho ...adding logo and favicon\r\nCopy %LOCN%Content\\logo.png %2%\\Content\\logo.png\r\nCopy %LOCN%Content\\li.png %2%\\Content\\li.png\r\nCopy %LOCN%favicon.ico %2%\\favicon.ico\r\n\r\necho ...adding partial for header \r\nCopy %LOCN%Views\\Shared\\_header.bat %2%\\Views\\Shared\\_header.bat\r\n\r\necho ...adding handlers for 'action missing' and 'controller missing'\r\nCopy %LOCN%Controllers\\_actionMissing.bat %2%\\Controllers\\_actionMissing.bat\r\nCopy %LOCN%Controllers\\_controllerMissing.bat %2%\\Controllers\\_controllerMissing.bat\r\n\r\necho ...adding default action (Index)\r\nCopy %LOCN%Controllers\\Home\\Index.bat %2%\\Controllers\\Home\\Index.bat\r\n\r\necho ...adding binaries\r\nCopy %LOCN%bin\\*.dll %2%\\bin\\\r\n\r\n\r\necho ...adding html helper functions\r\nCopy %LOCN%h\\*.bat %2%\\h\\\r\n\r\necho Registering http://localhost/%2 with webserver\r\n\r\necho SITE created.\r\n\r\ngoto EXIT\r\n\r\n:CONTROLLER\r\n\r\nREM First determine our location... tricky!\r\n\r\npushd %cd%\r\n\r\nif NOT EXIST ..\\Controllers goto NOT_IN_CONTROLLERS\r\nif NOT EXIST ..\\Models goto NOT_IN_CONTROLLERS\r\nif NOT EXIST ..\\Views goto NOT_IN_CONTROLLERS\r\n\r\ncd ..\\Controllers\r\n\r\ngoto Make_Controller\r\n\r\n:NOT_IN_CONTROLLERS\r\n\r\nif EXIST Controllers goto IN_ROOT\r\nif EXIST Models goto IN_ROOT\r\nif EXIST Views goto IN_ROOT\r\n\r\nECHO This command must be run from the root\r\nECHO of your website, or from the Controllers\r\nECHO folder. \r\npopd \r\ngoto :EOF\r\n\r\ngoto Make_Controller\r\n\r\n:IN_ROOT\r\n\r\ncd Controllers\r\ngoto Make_Controller\r\n\r\n:Make_Controller\r\n\r\necho Creating CONTROLLER %2...\r\nIF NOT EXIST %2 md %2\r\n\r\necho Creating default action (index.bat)...\r\n\r\nCopy %LOCN%\\Controllers\\Home\\Index.bat %2%\\Index.bat\r\n\r\npopd\r\n\r\ngoto EXIT\r\n\r\n:GEN\r\n\r\n\r\nSET controller=%3\r\nif x%3==x SET controller=Home\r\n\r\n\r\necho Generating actions for MODEL %2 in Controller %controller%...\r\n\r\nREM First determine our location... tricky!\r\n\r\npushd %cd%\r\n\r\nif NOT EXIST ..\\..\\Controllers goto KeepLooking\r\nif NOT EXIST ..\\..\\Models goto KeepLooking\r\nif NOT EXIST ..\\..\\Views goto KeepLooking\r\n\r\ncd ..\\..\\Models\r\n\r\ngoto Gen_Model\r\n\r\n:KeepLooking\r\n\r\nif NOT EXIST ..\\Controllers goto NOT_IN_MODELS\r\nif NOT EXIST ..\\Models goto NOT_IN_MODELS\r\nif NOT EXIST ..\\Views goto NOT_IN_MODELS\r\n\r\ncd ..\\Models\r\n\r\ngoto Gen_Model\r\n\r\n:NOT_IN_MODELS\r\n\r\nif EXIST Controllers goto IN_ROOT2\r\nif EXIST Models goto IN_ROOT2\r\nif EXIST Views goto IN_ROOT2\r\n\r\nECHO This command must be run from the root\r\nECHO of your website, or from the Models\r\nECHO or Controllers folder\r\n\r\npopd \r\n\r\ngoto :EOF\r\n\r\ngoto Gen_Model\r\n\r\n:IN_ROOT2\r\n\r\ncd Models\r\n\r\ngoto Gen_Model\r\n\r\n:Gen_Model\r\n\r\nFOR /F \"eol=; tokens=1,* delims=`\" %%A in (%2s.csv)  DO (\r\n  (SET FIELDS=%%B)\r\n  GOTO DETAILS\r\n)\r\n\r\n:DETAILS\r\n\r\ncscript /nologo split.vbs %FIELDS% > \"%2s.fields\"\r\n\r\necho @echo off > ..\\Controllers\\%controller%\\add.bat\r\necho call ..\\..\\Views\\Shared\\_header New %2 >> ..\\Controllers\\%controller%\\add.bat\r\necho call ..\\..\\h\\h1 New %2 >> ..\\Controllers\\%controller%\\add.bat\r\necho echo [form method='POST' action='add'] >> ..\\Controllers\\%controller%\\add.bat\r\necho echo [input type='hidden' id='title' name='ID' value='%2'][/input] >> ..\\Controllers\\%controller%\\add.bat\r\n\r\nSET /A ID=1\r\nSET outy=\"..\"\r\nfor /F %%C in (%2s.fields) do (\r\n  echo echo %%C >> ..\\Controllers\\%controller%\\add.bat\r\n  echo echo [br /] >> ..\\Controllers\\%controller%\\add.bat\r\n  echo echo [input type='textbox' id='%%C' name='%%C' value='%2' style='width:350px'][/input] >> ..\\Controllers\\%controller%\\add.bat\r\n  echo echo [br /] >> ..\\Controllers\\%controller%\\add.bat\r\n  SET /A ID=%ID+1\r\n  (SET outy=%outy%+\"\"+%ID%)\r\n)\r\n\r\necho echo [input type='submit' value='submit' /] >> ..\\Controllers\\%controller%\\add.bat\r\necho echo [/form] >> ..\\Controllers\\%controller%\\add.bat\r\necho echo [hr /] >> ..\\Controllers\\%controller%\\add.bat\r\necho echo [a href='index']back[/a] >> ..\\Controllers\\%controller%\\add.bat\r\n\r\necho @echo off > ..\\Controllers\\%controller%\\add.cmd\r\necho REM Determine the next ID value... >> ..\\Controllers\\%controller%\\add.cmd \r\necho SET /A ID=1 >> ..\\Controllers\\%controller%\\add.cmd \r\necho FOR /F \"eol=; tokens=1,2,3,* skip=1 delims=`\" %%%%i in (..\\..\\Models\\Posts.csv) do ( >> ..\\Controllers\\%controller%\\add.cmd \r\necho   (SET /A ID=%%ID+1) >> ..\\Controllers\\%controller%\\add.cmd \r\necho ) >> ..\\Controllers\\%controller%\\add.cmd \r\n\r\nset rst=%%ID%%\r\nSET /A UPPER=(%ID%-1)*2+1\r\n\r\nfor /L %%i in (3,2,%UPPER%) do call :Loop2 %%i \r\n\r\ngoto :EchoResults\r\n:Loop2\r\nSet RST=%RST%`%%~%1\r\ngoto :EOF\r\n\r\n:EchoResults\r\necho ECHO %RST% ^>^> ..\\..\\Models\\%2s.csv >> ..\\Controllers\\%controller%\\add.cmd\r\necho ECHO View/%%ID%% >> ..\\Controllers\\%controller%\\add.cmd \r\necho EXIT 31 >> ..\\Controllers\\%controller%\\add.cmd \r\n\r\necho @echo off > ..\\Controllers\\%controller%\\view.bat\r\necho IF x\"%%1\"==x\"\" GOTO EMPTY >> ..\\Controllers\\%controller%\\view.bat\r\necho FOR /F \"eol=; tokens=1-20 skip=1 delims=`\" %%%%1 in (..\\..\\Models\\%2s.csv) do ( >> ..\\Controllers\\%controller%\\view.bat\r\necho   IF %%%%1==%%1 ( >> ..\\Controllers\\%controller%\\view.bat\r\necho     call ..\\..\\Views\\Shared\\_header %%%%2 >> ..\\Controllers\\%controller%\\view.bat\r\necho     call ..\\..\\h\\h1 %%%%2 >> ..\\Controllers\\%controller%\\view.bat\r\nfor /L %%i in (3,1,%ID%) do (\r\necho     ECHO [p]%%%%%%i[/p] >> ..\\Controllers\\%controller%\\view.bat \r\n)\r\n\r\necho  ) >> ..\\Controllers\\%controller%\\view.bat\r\necho ) >> ..\\Controllers\\%controller%\\view.bat\r\necho GOTO EXIT >> ..\\Controllers\\%controller%\\view.bat\r\necho :EMPTY >> ..\\Controllers\\%controller%\\view.bat\r\necho     call ..\\..\\Views\\Shared\\_header Invalid ID >> ..\\Controllers\\%controller%\\view.bat\r\necho     call ..\\..\\h\\h1 Invalid ID >> ..\\Controllers\\%controller%\\view.bat\r\necho GOTO EXIT >> ..\\Controllers\\%controller%\\view.bat\r\necho :EXIT >> ..\\Controllers\\%controller%\\view.bat\r\necho ECHO [a href='/%controller%/index']back...[/a] >> ..\\Controllers\\%controller%\\view.bat\r\n\r\necho @echo off > ..\\Controllers\\%controller%\\index.bat\r\necho call ..\\..\\Views\\Shared\\_header %controller% %2s >> ..\\Controllers\\%controller%\\index.bat\r\necho call ..\\..\\h\\h1 %controller% %2s >> ..\\Controllers\\%controller%\\index.bat\r\necho echo [blink][em]Built with DOS on Dope[/em][/blink] >> ..\\Controllers\\%controller%\\index.bat\r\necho FOR /F \"eol=; tokens=1-20 skip=1 delims=`\" %%%%1 in (..\\..\\Models\\%2s.csv) do ( >> ..\\Controllers\\%controller%\\index.bat\r\n\r\necho   call ..\\..\\h\\h1 %%%%2 >> ..\\Controllers\\%controller%\\index.bat\r\nfor /L %%i in (3,1,%ID%) do (\r\necho   ECHO [p]%%%%%%i[/p] >> ..\\Controllers\\%controller%\\index.bat \r\n)\r\necho   ECHO [a href='view/%%%%1']more...[/a] >> ..\\Controllers\\%controller%\\index.bat\r\necho   ECHO [hr /] >> ..\\Controllers\\%controller%\\index.bat\r\necho ) >> ..\\Controllers\\%controller%\\index.bat\r\necho echo. >> ..\\Controllers\\%controller%\\index.bat\r\necho echo [a href='add']Add[/a] >> ..\\Controllers\\%controller%\\index.bat\r\n\r\npopd \r\n\r\ngoto EXIT\r\n\r\n:HELP\r\n\r\n\r\nif '%2'=='site' goto HELP_SITE\r\nif '%2'=='controller' goto HELP_CONTROLLER\r\nif '%2'=='model' goto HELP_MODEL\r\nif '%2'=='gen' goto HELP_GEN\r\n\r\necho.\r\necho *******************\r\necho *** DOS ON DOPE ***\r\necho *** The MVC web ***\r\necho *** frame  work ***\r\necho *** built    on ***\r\necho *** batch files ***\r\necho *******************\r\necho.\r\necho Commands are:\r\necho   dope SITE [[name]] -- to create a SITE named 'name'\r\necho   dope CONTROLLER [[name]] -- to create a CONTROLLER named 'name'\r\necho   dope GEN [[name]] -- to generate controllers and action for a model named 'name' (singular)\r\necho   dope HELP [[command]] -- to request HELP on 'command'\r\n\r\necho ** Always keep Dope in your Path. **\r\n\r\ngoto exit\r\n\r\n:UNKNOWN\r\n\r\necho ERROR: Unknown command. %1\r\nGOTO HELP\r\n\r\ngoto EXIT\r\n\r\n:EXIT"
  },
  {
    "path": "h/ToLower.cmd",
    "content": "@echo off\r\nFOR %%B IN (\"%~1\") DO (\r\n    FOR /F \"delims=~\" %%A IN ('ECHO %%B^> ~%%B ^& DIR /L /B ~%%B') DO (\r\n        SET LoCaseText=%%A\r\n        DEL /Q ~%%B\r\n    )\r\n)\r\nECHO %LoCaseText%"
  },
  {
    "path": "h/a.bat",
    "content": "@echo off\r\necho [a href='%~1']%~2[/a]\r\n"
  },
  {
    "path": "h/h1.bat",
    "content": "@echo off\r\necho [h1]%*[/h1]\r\n"
  },
  {
    "path": "h/h2.bat",
    "content": "@echo off\r\necho [h2]%*[/h2]\r\n"
  },
  {
    "path": "h/h3.bat",
    "content": "@echo off\r\necho [h3]%*[/h3]\r\n"
  },
  {
    "path": "h/p.bat",
    "content": "@echo off\r\necho [p]%*[/p]\r\n"
  }
]