Download the PHP package markdown-extended/mde-service without Composer

On this page you can find all versions of the php package markdown-extended/mde-service. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mde-service

MDE-Service

A webservice tool to parse Markdown-Extended contents online.

The MDE-Service webservice handles raw or JSON requests and send a JSON content response with significant headers.

The basic usage schema is:

$ curl -i http://localhost/mde-service/www/mde-api.php?source=%2AMarkdown%2A-__extended__%20content

HTTP/1.1 200 OK
Last-Modified: Mon, 29 Dec 2014 21:11:01 GMT
Content-Type: application/json; charset=utf-8
API-Status: 200 OK
API-Version: 0.1
MDE-Version: 0.1-gamma4
ETag: 8a4d0bef2b45148a6c8df14158704f6c

{
    "source":"*Markdown*-__extended__ content",
    "content":"\n\n<p><em>Markdown<\/em>-<strong>extended<\/strong> content<\/p>\n\n\n",
    "errors":[]
}

This webservice is available online at http://api.aboutmde.org/.

Build the request

You can send HTTP requests using verbs GET, POST or HEAD. The GET and POST requests will have the same results while the HEAD one will only fetch response headers.

Accepted data are:

If you specify both source and sources data, the single source will be added at the end of the sources table.

You can optionally define some special headers:

Using the source_type=file option, you can upload one or more files and their contents will be parsed as the sources.

Understand the response

The response is a JSON encoded content with a significant status code header.

The JSON content is built like:

The response status can be:

The default rendering of a parsed content is a full aggregation of its elements:

$mde_content->getMetadataToString()
\n
$mde_content->getBody()
\n
$mde_content->getNotesToString()

Using the extract argument, you can choose a single element to return.

When the sources came from one or more uploaded files, the filenames are rendered in the sources array with the same index as in the resulting contents array.

Versions information

Each response of the API will have a API-Version header with the current API version number. You can use it to check that you are still working with the right version.

If a content parsing happens, the response will also have a MDE-Version header with the version number of the MarkdownExtended parser used. This reference should be a release of the package http://github.com/piwi/markdown-extended.

Caching responses

The responses of the API are not cached (this would have no sense). But you can make a request with information to update your content only if the response is modified. You can do so by re-using the ETag header of a previous response you had and send it as a value of a If-None-Match header in your request:

$ curl --header "If-None-Match: YOUR_PREVIOUS_RESPONSE_ETAG" ...

The ETag embedded in each response of the API if an MDE parsing happens is built with the original sources AND their parsed contents. This way, if you use the header above you will have the 304 Not Modified status response only if you sent the same source AND if the result is not updated.

Implementation examples

Command line usage

The examples below can be run in command line using curl. Each of them will fetch the response headers and its content on the terminal. To get only the content ("in-real-life"), delete the -i option.

The options argument is shown empty in each request but is not required.

A basic POST request usage is:

A basic GET request usage is:

A POST request with JSON encoded arguments can be made with:

You can define a personal header in the request with:

To upload a file, use:

In case of error, you will have:

JavaScript implementation

Below is a sample of JavaScript usage of the interface via an XMLHttpRequest object:

PHP implementation

Below is a sample of a PHP usage of the interface via a cURL request:


All versions of mde-service with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
picas/markdown-extended Version dev-develop
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package markdown-extended/mde-service contains the following files

Loading the files please wait ....