https://github.com/gocom/php-textile-sandbox
Simple public sandbox endpoint for PHP-Textile
https://github.com/gocom/php-textile-sandbox
Last synced: about 1 month ago
JSON representation
Simple public sandbox endpoint for PHP-Textile
- Host: GitHub
- URL: https://github.com/gocom/php-textile-sandbox
- Owner: gocom
- License: mit
- Created: 2013-11-12T12:34:10.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-14T10:11:27.000Z (over 12 years ago)
- Last Synced: 2025-01-26T11:08:34.156Z (over 1 year ago)
- Language: PHP
- Size: 188 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
- License: LICENSE
Awesome Lists containing this project
README
h1. PHP-Textile sandbox
Simple public sandbox for "PHP-Textile":https://github.com/textile/php-textile. Send in a HTTP request, get Textile as response, wrapped in a JSON or JSON-P envelope.
h2. Installing
bc. $ git clone https://github.com/gocom/php-textile-sandbox.git && cd php-textile-sandbox
$ composer install
h2. Usage
The sandbox accepts requests from both GET and POST request methods. Both are 'read' only.
h3. Request parameters
* *method* Parsing method, either @unrestricted@ or @restricted@ (default), or an array of both.
* *text* Textile input to parse.
* *doctype* Output document type. Either @html5@ (default) or @xhtml@.
* *lite* Enable lite mode, either @true@ or @false@ (default).
* *noimage* Disable image tags, either @true@ (default) or @false@.
* *rel* Rel attribute applied to links.
* *callback* JSON-P callback function.
h3. Example request
bc. $ curl http://php-textile-sandbox.test/?text=h1.%20Hello%20World
Response headers:
bc. HTTP/1.1 200 OK
Date: Thu, 14 Nov 2013 07:48:01 GMT
Access-Control-Allow-Origin: *
X-Robots-Tag: noindex
Content-Type: application/json; charset=utf-8
Response body:
bc. {
"options": {
"method": ["restricted"],
"text": "h1. Hello World",
"doctype": "html5",
"lite": false,
"noimage": true,
"rel": "nofollow",
"callback" : ""
},
"output": {
"restricted": "
Hello World<\/h1>"
}
}