Download the PHP package asleepwalker/typographie without Composer
On this page you can find all versions of the php package asleepwalker/typographie. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download asleepwalker/typographie
More information about asleepwalker/typographie
Files in asleepwalker/typographie
Package typographie
Short Description Preparation of russian texts before web publication.
License MIT
Homepage https://github.com/asleepwalker/typographie.php
Informations about the package typographie
Typographie.php
Library for preparation of russian texts to web publication.
Core of Typographie web service.
Installation
Add package to the composer.json:
composer require asleepwalker/typographie
Run Composer:
composer install
Example
Actions
quotes
: Correction of quotes: "" becomes «».
inquot
(requires quotes
) : Nested quotes: «„“» (otherwise — duplicate quotes stashing).
dashes
: If necessary replace hyphens with dashes and minus signs.
angles
: Replace asterisks and quotes with degrees, feet, inches.
dblspace
: Fix duplicate spaces in the text.
specials
: Insert special characters (from the symbol table).
mathchars
: Insert mathematical symbols (from the same table).
punctuation
: Fix punctuation, such as spaces before commas.
specialspaces
: Fix the wrong skip special characters with spaces.
nbsp
: Attach short words to following words in the text.
hellip
: Replace repeating dot symbols with ellipsis.
paragraphs
: Puts paragraphs (<p>) when converting to HTML (with empty string as a delimeter).
safehtml
: Don't process text inside of <code> and <pre> blocks.
entities
: Replace special chars with HTML entities.
The list should be comma separated, e.g. action1,action2,action3
.
Beside defining in the object constructor, use can change configuration by method actions
:
Modes
plain
: Just plain text.
html
: Safe HTML processing.
The mode could be defined in the constructor:
$engine = new Typographie('quotes,dashes', $in, $out);
Or by method mode
:
$engine->mode('html', 'plain');
Default congifuration is plain
mode for both input and output.
License
The MIT License.