No mode specified; opening in view mode No file specified - opening readme in edit mode Opened readme.txt in edit mode
Copyleft sdaau, 2012
Homepage and demo:
This is a small "web application", which consists of one file,
spmdwe.php, (which can be renamed to
index.php). It can be installed on a php server, and used to edit text files with live preview for Markdown syntax.
With proper permissions on the server directory, files can also be saved on the host (a backup of the previous version is also saved). There is also a switch that disables saving, enabled at the demo page for protection.
It is based on two other open-source packages, which are downloaded separately (see Installation below):
While the default .css style shown here is hardly impressive, do check out the list of some free markdown css styles, which can be used instead.
Here are the steps needed to install this application, in the form of
# mkdir spmdwe # if downloading manually, else: # checkout from svn - creates `spmdwe` directory and files in it svn co https://sdaaubckp.svn.sourceforge.net/svnroot/sdaaubckp/spmdwe spmdwe chmod 775 spmdwe # on server, else cannot save backups! cd spmdwe # see http://michelf.com/projects/php-markdown/ wget http://michelf.com/docs/projets/php-markdown-1.0.1o.zip # unzip creates "PHP Markdown 1.0.1o" directory unzip php-markdown-1.0.1o.zip # rename unzipped directory mv PHP* php-markdown # see http://stackoverflow.com/a/135155/277826 # creates "pagedown" directory hg clone https://code.google.com/p/pagedown/
The application is pretty simple:
editcan be used as values for the
modequery string argument (see source code for details)
fileof the URL query string, say
somefile.txt) doesn't exist, it should be created automatically, and edit mode displayed
http://example.com/spmdwe.php), then it loads
readme.txtand goes into edit mode.
You can also test this application via
php-cli; on a Linux terminal, call:
# test with php-cli: QUERY_STRING="file=readme.txt" php spmdwe.php