Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Version 1.0

  • Loading branch information...
commit cb52252211fd0ab89581a2e6836c323f896334ec 1 parent 133551e
@benburwell authored
View
8 .htaccess
@@ -0,0 +1,8 @@
+# MDEngine URL rewriter
+RewriteEngine On
+RewriteRule ^\~style\.css$ theme/style.css [L]
+RewriteRule ^\~media/(.+)$ media/$1 [L]
+RewriteRule ^([A-Za-z0-9-_]+)?$ engine/controller.php?qs=$1
+RewriteRule ^([A-Za-z0-9-_]+)/markdown$ content/$1.md
+
+ErrorDocument 404 /wiki/engine/controller.php?qs=404
View
12 content/Home.md
@@ -1,4 +1,10 @@
-Welcome to MDWiki
-=================
+Home Sweet Home
+===============
-This is the home page. By default, anyone can edit this page (just click the edit button above). If you would like to restrict access, simply log in to the [Admin Area](~/ "Admin Area") to adjust your settings (or edit the file ./engine/settings.php).
+This is the home page of your new site! To start adding content, just create [markdown][md] files in the /content/ directory.
+
+You can also edit the /theme/ to customize navigation and CSS.
+
+Enjoy!
+
+[md]: http://daringfireball.net/projects/markdown/
View
10 content/home.md
@@ -0,0 +1,10 @@
+Home Sweet Home
+===============
+
+This is the home page of your new site! To start adding content, just create [markdown][md] files in the /content/ directory.
+
+You can also edit the /theme/ to customize navigation and CSS.
+
+Enjoy!
+
+[md]: http://daringfireball.net/projects/markdown/
View
70 engine/controller.php
@@ -0,0 +1,70 @@
+<?php
+
+/*
+
+ Markdown Controller
+ --------------------
+
+ @file controller.php
+ @version 1.0.0
+ @date 2012-04-19 20:15:59 -0400 (Thu, 19 Apr 2012)
+ @author Ben Burwell <bburwell1@gmail.com>
+
+ Copyright (c) 2012 Ben Burwell <http://www.benburwell.com/>
+
+*/
+
+// change this to whatever you want your site to be called
+define('SITE', 'MdEngine');
+
+// links to pages?
+define('SHOW_LINKS', true);
+
+// bring in markdown engine
+require_once('md/markdown.php');
+
+// hide PHP
+header('Server: ');
+header('X-Powered-By: ');
+
+// do not alter these!
+define('WEBROOT', substr($_SERVER['PHP_SELF'], 0, -22)); // chop off /engine/controller.php (22 chars)
+define('FILEROOT', substr(__FILE__, 0, -22)); // chop off /engine/controller.php (22 chars)
+
+// get page name
+$page = ($_GET['qs'] != '' && $_GET['qs'] != '')? strtolower($_GET['qs']) : 'home';
+define('MD_FILE', FILEROOT.'/content/'.$page.'.md');
+
+$title = ucwords(str_replace('_', '', $page));
+
+// display content
+if (!file_exists(MD_FILE) || $_GET['qs'] == '404') {
+
+ // handle 404
+ $html = Markdown(file_get_contents(FILEROOT.'/theme/404.md'));
+
+ // set 404 status
+ header('HTTP/'.$_SERVER['HTTP_VERSION'].' 404 Not Found');
+
+} else {
+
+ // parse file
+ $html = Markdown(file_get_contents(MD_FILE));
+
+}
+
+// display header
+require_once(FILEROOT.'/theme/header.php');
+
+echo $html;
+
+// display footer
+require_once(FILEROOT.'/theme/footer.php');
+
+//echo WEBROOT;
+//echo FILEROOT;
+//echo MD_FILE;
+
+exit();
+
+?>
View
0  engine/create.php
No changes.
View
0  engine/delete.php
No changes.
View
0  engine/settings.php
No changes.
View
0  engine/update.php
No changes.
View
0  engine/view.php
No changes.
View
9 index.htm
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Error</title>
+ </head>
+ <body>
+ <h3>Error</h3>
+ <p>You should not be seeing this page. You might not be using Apache, or perhaps your server doesn&rsquo;t support <code>mod_rewrite</code>.</p>
+ </body>
+</html>
View
0  index.php
No changes.
View
0  themes/default/update.php → media/empty
File renamed without changes
View
6 theme/404.md
@@ -0,0 +1,6 @@
+Not Found
+=========
+
+The page you requested does not exist. You could return [home](./), or, if you&rsquo;d like, email the webmaster about this issue.
+
+Have a pleasant day!
View
10 theme/footer.php
@@ -0,0 +1,10 @@
+<?php
+
+$mdurl = (substr($_SERVER['REQUEST_URI'], -1, 1) == '/')? 'home/markdown' : $_SERVER['REQUEST_URI'].'/markdown'; ?>
+ </article>
+ <footer>
+ Copyright &copy; <?php echo date('Y'); ?> &bull; <a href="<?php echo $mdurl; ?>">View Markdown</a><br />
+ Powered by <a href="http://benburwell.com/lab/markdown.php">MdEngine</a>
+ </footer>
+ </body>
+</html>
View
11 theme/header.php
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title><?php echo $title.' - '.SITE; ?></title>
+ <link rel="stylesheet" type="text/css" href="~style.css" />
+ </head>
+ <body>
+ <header>
+ <h1><a href="<?php echo WEBROOT; ?>"><?php echo SITE; ?></a></h1>
+ </header>
+ <article>
View
87 theme/style.css
@@ -0,0 +1,87 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+
+html {
+ background-color: #002b36;
+ color: #839496;
+ font-family: "Helvetica", sans-serif;
+}
+
+a {
+ color: #93a1a1;
+}
+
+a:hover {
+ text-decoration: none;
+}
+
+header, article, footer {
+ width: 288pt;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+header {
+ margin-bottom: 24pt;
+ margin-top: 12pt;
+}
+
+header h1 a {
+ color: #b58900;
+ font-weight: 200;
+ text-decoration: none;
+ font-size: 20pt;
+ text-transform: uppercase;
+ letter-spacing: 2pt;
+}
+
+article {
+ font-size: 10pt;
+ line-height: 12pt;
+}
+
+article p {
+ text-indent: 1em;
+ text-align: justify;
+}
+
+article h1 {
+ font-size: 15pt;
+ margin-bottom: 9pt;
+ margin-top: 12pt;
+ text-transform: uppercase;
+ letter-spacing: 2pt;
+ line-height: 15pt;
+}
+
+article h2 {
+ margin-top: 12pt;
+ margin-bottom: 12pt;
+ font-size: 12pt;
+ line-height: 12pt;
+}
+
+article h3, article h4, article h5, article h6 {
+ margin-top: 14pt;
+ margin-bottom: 12pt;
+ font-size: 10pt;
+ line-height: 10pt;
+}
+
+article ul {
+ padding-left: 2em;
+ list-style-type: square;
+ margin-top: 12pt;
+ margin-bottom: 12pt;
+}
+
+footer {
+ border-top: 1px solid #839496;
+ margin-top: 12pt;
+ margin-bottom: 24pt;
+ padding-top: 12pt;
+ font-size: 8pt;
+ line-height: 12pt;
+}
View
0  themes/default/create.php
No changes.
View
0  themes/default/delete.php
No changes.
View
0  themes/default/footer.php
No changes.
View
0  themes/default/header.php
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.