Format

Defines a conversion format in Scrybe.

package

Default

Methods

Initializes a new format.

__construct(string $name, string $mime_type, string|array<mixed,string> $extensions) 

Arguments

$name

string

$mime_type

string

$extensions

string|array<mixed,string>

Converts the given filename to be math this format.

convertFilename(string $filename) : string

Arguments

$filename

string

Response

string

Returns the file extensions commonly associated with files of this format.

getExtensions() : array<mixed,string>

Response

array<mixed,string>

Returns the Mime type commonly associated with files of this format.

getMimeType() : string

Response

string

Returns the name for this format.

getName() : string

Response

string

Sets the file extensions commonly associated with files of this format.

setExtensions(array<mixed,string> $extensions) : void

Arguments

$extensions

array<mixed,string>

Sets the mime type commonly associated with files of this format.

setMimeType(string $mime_type) : void

Arguments

$mime_type

string

Sets the name for this format.

setName(string $name) : void

The names of built-in formats are defined as class constants of this class.

Arguments

$name

string

Constants

MARKDOWN

MARKDOWN

JSON

JSON

RST

RST

HTML

HTML

LATEX

LATEX

PDF

PDF

DOCBOOK

DOCBOOK

Properties

the name for this format, usually any of the constants in this class

name : string
var

the name for this format, usually any of the constants in this class

Type(s)

string

the mime-type used for this format, i.e. application/json

mime_type : string
var

the mime-type used for this format, i.e. application/json

Type(s)

string

a series of file extensions that are commonly associated with this type of file

extensions : array<mixed,string>
var

a series of file extensions that are commonly associated with this type of file

Type(s)

array<mixed,string>