3

I would like to know if there is a PHP web application, such that

  • When called with something like http://example.com/index.php?inputfile=mymarkdownfile.txt; it will open the file mymarkdownfile.txt at the same location as index.php on the webserver, and render it as Markdown (i.e., it will convert the Markdown to HTML and serve it)
  • There will be an "edit" button, which opens a "live preview" Markdown editor (like on StackExchange/StackOverflow sites)
  • When you're done editing and click on the "save" button, previous version is archived on server (saved as text file mymarkdownfile-timestamp.txt), and the changed version is saved as mymarkdownfile.txt.
  • If you try to "open" a "nonexisting file" (say, via http://example.com/index.php?inputfile=nonexistant.txt), then the editor starts first; and the content typed there will be saved as nonexistant.txt (and nonexistant-timestamp.txt)

I just need this for server based note taking, and I don't really need local linking or anything like that; nor user authentication nor protection (I'd intend to use this on local network, so I wouldn't be worried about public exposure of "edit" button and vandalism).

I imagine it could be a PHP page, which uses:

Anything like that out there?

Many thanks in advance for any answers,
Cheers!

sdaau
  • 6,008

1 Answers1

5

Well, given that I really needed something like this, I put together a small PHP script/application that does the above; called it the Single-page Markdown Web Editor (spmdwe); please see:

enter image description here

Hope this helps someone,
Cheers!

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311
sdaau
  • 6,008