├── custom ├── header.php ├── head.php └── footer.php ├── style.css ├── index.php ├── README.md ├── .htaccess └── markdown.php /custom/header.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /custom/head.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /custom/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #444; 3 | font: 16px Georgia, serif; 4 | margin: 1em auto; 5 | max-width: 36em; 6 | line-height: 1.5; 7 | } 8 | 9 | em, strong { color: black; } 10 | 11 | h1, h2, h3, h4, th { 12 | font-family: Calibri, sans-serif; 13 | margin: 0; 14 | color: #4d8cbf; 15 | } 16 | 17 | h1 { font-size: 2.0em; line-height: 3; } 18 | h2 { font-size: 1.5em; line-height: 2; } 19 | h3 { font-size: 1.0em; line-height: 3; } 20 | 21 | img { border: 0; } 22 | 23 | pre, 24 | code, 25 | .pre { 26 | color: #080; 27 | } 28 | 29 | pre, .pre { 30 | margin: 1.5em; 31 | padding-left: 1em; 32 | border-left: 1px solid #ccc; 33 | } 34 | 35 | a, 36 | a code { 37 | color: #216093; 38 | } 39 | 40 | table { 41 | border-collapse: collapse; 42 | border: 0; 43 | border-bottom: 1px solid #ccc; 44 | margin-bottom: 1.5em; 45 | } 46 | 47 | th { 48 | text-align: left; 49 | border-bottom: 1px solid #ccc; 50 | } 51 | 52 | td { 53 | border: 0; 54 | padding: 0.2em 0.5em 0.2em 0; 55 | } 56 | 57 | tr:nth-child(even) { 58 | background-color: #f3f3ff; 59 | } 60 | 61 | p { 62 | margin: 0; 63 | margin-bottom: 1.5em; 64 | } 65 | 66 | td, th { 67 | text-align: right; 68 | } 69 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 17 | <?php echo $path ?> 18 | 19 | 25 | 26 |
27 | Error

Could not fetch $path

"; 39 | } else { 40 | echo Markdown($content); 41 | } 42 | 43 | # Include any custom scripts or styles you want to create here. 44 | @include "custom/footer.php"; 45 | 46 | ?> 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Markdress 2 | ========= 3 | 4 | Markdress lets you serve Markdown files as a website. 5 | 6 | This used to be hosted at but not since Dec 2012. 7 | (To render a Markdown file at , you would have visited 8 | ) 9 | 10 | Clone this repo and run it behind PHP on Apache. 11 | If this folder is at `/markdress/`, then `/markdress/goo.gl/zTG1q` 12 | will automatically load http://goo.gl/zTG1q 13 | 14 | Sample usage: 15 | 16 |
17 | 21 | 22 |
23 | 24 | Alternatives 25 | ------------ 26 | - [DropPages.com](http://droppages.com/) lets you share Dropbox files as web pages. 27 | - [Pancake.io](http://pancake.io/) lets you share Dropbox files as web pages. 28 | - [Calepin.co](http://calepin.co/) lets you blog using Dropbox. 29 | - [Markdrop](http://www.markdrop.com/) lets you preview Markdown on the browser. 30 | 31 | So why Markdress? To test throwaway pages without creating accounts. 32 | 33 | Feel free to use it. But there's no guarantee the site will remain forever. 34 | 35 | FAQ 36 | --- 37 | *Can I use my own hosted version of Markdress?* 38 | 39 | Yes. Download from . 40 | 41 | *Can I use Markdress with GitHub, Bitbucket, etc?* 42 | 43 | Only if they have a http:// address (not https://). But these sites already 44 | render text markup as HTML in their Wikis. So why bother? 45 | 46 | *Does Markdress cache the URL?* 47 | 48 | Not yet. 49 | 50 | *Whom do I pass on feedback to?* 51 | 52 | [Anand](http://www.s-anand.net/). If you have a feature suggestion, 53 | [fork](https://github.com/sanand0/markdress/fork) the repository and submit 54 | your pull request. 55 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- 2 | # Send all URLs to index.php?path=... 3 | # ---------------------------------------------------------------------- 4 | 5 | # For example, /dl.dropbox.com/u/123/abc.md 6 | # will be redirected to index.php?path=dl.dropbox.com/u/123/abc.md 7 | 8 | # This assumes that the script is placed in the root folder of the site. 9 | # Change RewriteBase to whatever the site needs to point to 10 | 11 | 12 | # Change this to the path you've installed this file 13 | RewriteBase / 14 | 15 | # If requested file doesn't exist, assume it's a Markdown path to display 16 | RewriteCond %{REQUEST_FILENAME} !-f 17 | RewriteCond %{REQUEST_FILENAME} !-d 18 | RewriteRule ^(.*)$ index.php?path=$1 [L] 19 | 20 | 21 | # ---------------------------------------------------------------------- 22 | # The rest of the file is directly from 23 | # https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess 24 | # ---------------------------------------------------------------------- 25 | 26 | # Apache configuration file 27 | # httpd.apache.org/docs/2.2/mod/quickreference.html 28 | 29 | # Note .htaccess files are an overhead, this logic should be in your Apache config if possible 30 | # httpd.apache.org/docs/2.2/howto/htaccess.html 31 | 32 | # Techniques in here adapted from all over, including: 33 | # Kroc Camen: camendesign.com/.htaccess 34 | # perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ 35 | # Sample .htaccess file of CMS MODx: modxcms.com 36 | 37 | 38 | ### 39 | ### If you run a webserver other than Apache, consider: 40 | ### github.com/paulirish/html5-boilerplate-server-configs 41 | ### 42 | 43 | 44 | 45 | # ---------------------------------------------------------------------- 46 | # Better website experience for IE users 47 | # ---------------------------------------------------------------------- 48 | 49 | # Force the latest IE version, in various cases when it may fall back to IE7 mode 50 | # github.com/rails/rails/commit/123eb25#commitcomment-118920 51 | # Use ChromeFrame if it's installed for a better experience for the poor IE folk 52 | 53 | 54 | Header set X-UA-Compatible "IE=Edge,chrome=1" 55 | # mod_headers can't match by content-type, but we don't want to send this header on *everything*... 56 | 57 | Header unset X-UA-Compatible 58 | 59 | 60 | 61 | 62 | # ---------------------------------------------------------------------- 63 | # Cross-domain AJAX requests 64 | # ---------------------------------------------------------------------- 65 | 66 | # Serve cross-domain ajax requests, disabled. 67 | # enable-cors.org 68 | # code.google.com/p/html5security/wiki/CrossOriginRequestSecurity 69 | 70 | # 71 | # Header set Access-Control-Allow-Origin "*" 72 | # 73 | 74 | 75 | 76 | # ---------------------------------------------------------------------- 77 | # Webfont access 78 | # ---------------------------------------------------------------------- 79 | 80 | # Allow access from all domains for webfonts. 81 | # Alternatively you could only whitelist your 82 | # subdomains like "subdomain.example.com". 83 | 84 | 85 | 86 | Header set Access-Control-Allow-Origin "*" 87 | 88 | 89 | 90 | 91 | 92 | # ---------------------------------------------------------------------- 93 | # Proper MIME type for all files 94 | # ---------------------------------------------------------------------- 95 | 96 | 97 | # JavaScript 98 | # Normalize to standard type (it's sniffed in IE anyways) 99 | # tools.ietf.org/html/rfc4329#section-7.2 100 | AddType application/javascript js 101 | 102 | # Audio 103 | AddType audio/ogg oga ogg 104 | AddType audio/mp4 m4a 105 | 106 | # Video 107 | AddType video/ogg ogv 108 | AddType video/mp4 mp4 m4v 109 | AddType video/webm webm 110 | 111 | # SVG. 112 | # Required for svg webfonts on iPad 113 | # twitter.com/FontSquirrel/status/14855840545 114 | AddType image/svg+xml svg svgz 115 | AddEncoding gzip svgz 116 | 117 | # Webfonts 118 | AddType application/vnd.ms-fontobject eot 119 | AddType application/x-font-ttf ttf ttc 120 | AddType font/opentype otf 121 | AddType application/x-font-woff woff 122 | 123 | # Assorted types 124 | AddType image/x-icon ico 125 | AddType image/webp webp 126 | AddType text/cache-manifest appcache manifest 127 | AddType text/x-component htc 128 | AddType application/x-chrome-extension crx 129 | AddType application/x-xpinstall xpi 130 | AddType application/octet-stream safariextz 131 | AddType text/x-vcard vcf 132 | 133 | 134 | 135 | # ---------------------------------------------------------------------- 136 | # Allow concatenation from within specific js and css files 137 | # ---------------------------------------------------------------------- 138 | 139 | # e.g. Inside of script.combined.js you could have 140 | # 141 | # 142 | # and they would be included into this single file. 143 | 144 | # This is not in use in the boilerplate as it stands. You may 145 | # choose to name your files in this way for this advantage or 146 | # concatenate and minify them manually. 147 | # Disabled by default. 148 | 149 | # 150 | # Options +Includes 151 | # AddOutputFilterByType INCLUDES application/javascript application/json 152 | # SetOutputFilter INCLUDES 153 | # 154 | # 155 | # Options +Includes 156 | # AddOutputFilterByType INCLUDES text/css 157 | # SetOutputFilter INCLUDES 158 | # 159 | 160 | 161 | # ---------------------------------------------------------------------- 162 | # Gzip compression 163 | # ---------------------------------------------------------------------- 164 | 165 | 166 | 167 | # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/ 168 | 169 | 170 | SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding 171 | RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding 172 | 173 | 174 | 175 | # HTML, TXT, CSS, JavaScript, JSON, XML, HTC: 176 | 177 | FilterDeclare COMPRESS 178 | FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html 179 | FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css 180 | FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain 181 | FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml 182 | FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component 183 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript 184 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json 185 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml 186 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml 187 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml 188 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml 189 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject 190 | FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml 191 | FilterProvider COMPRESS DEFLATE resp=Content-Type $image/x-icon 192 | FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf 193 | FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype 194 | FilterChain COMPRESS 195 | FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no 196 | 197 | 198 | 199 | # Legacy versions of Apache 200 | AddOutputFilterByType DEFLATE text/html text/plain text/css application/json 201 | AddOutputFilterByType DEFLATE application/javascript 202 | AddOutputFilterByType DEFLATE text/xml application/xml text/x-component 203 | AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml 204 | AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype 205 | 206 | 207 | 208 | 209 | 210 | # ---------------------------------------------------------------------- 211 | # Expires headers (for better cache control) 212 | # ---------------------------------------------------------------------- 213 | 214 | # These are pretty far-future expires headers. 215 | # They assume you control versioning with cachebusting query params like 216 | #