2017 © Pedro Peláez
 

library typographie

image

asleepwalker/typographie

  • Saturday, March 31, 2018
  • by asleepwalker
  • Repository
  • 1 Watchers
  • 4 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Typographie.php Build Status Dependency Status

Library for preparation of russian texts to web publication.
Core of Typographie web service., (*1)

Installation

Add package to the composer.json:, (*2)

composer require asleepwalker/typographie

Run Composer:, (*3)

composer install

Example

<?php

use asleepwalker\typographie\Typographie;

$engine = new Typographie('quotes,inquot,dashes,specials,paragraphs');

$raw = 'Сервис "Typographie" - подготовка текстов к веб-публикации онлайн (с) 2014-2017';
echo $engine->process($raw);
// > Сервис «Typographie» — подготовка текстов к веб-публикации онлайн © 2014–2017

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., (*4)

The list should be comma separated, e.g. action1,action2,action3., (*5)

Beside defining in the object constructor, use can change configuration by method actions:, (*6)

$engine->actions('punctuation,dblspace');
echo $engine->process('К  чёрту орфографию ,главное   все понимают !Ведь так  ?..');
// > К чёрту орфографию, главное все понимают! Ведь так?..

Modes

plain : Just plain text.
html : Safe HTML processing., (*7)

The mode could be defined in the constructor:, (*8)

$engine = new Typographie('quotes,dashes', $in, $out);

Or by method mode:, (*9)

$engine->mode('html', 'plain');

Default congifuration is plain mode for both input and output., (*10)

License

The MIT License., (*11)

The Versions

31/03 2018

v1.1

1.1.0.0

  Sources   Download

31/03 2018

v1.0

1.0.0.0

  Sources   Download

07/02 2017

dev-master

9999999-dev https://github.com/asleepwalker/typographie.php

Preparation of russian texts before web publication.

  Sources   Download

MIT

The Development Requires

text web articles russian auto typography publication copywriting preparation

01/02 2017

1.4.0

1.4.0.0 https://github.com/asleepwalker/typographie.php

Preparation of russian texts before web publication.

  Sources   Download

MIT

The Development Requires

text web articles russian auto typography publication copywriting preparation

31/01 2017

1.3.1

1.3.1.0 https://github.com/asleepwalker/typographie.php

Preparation of russian texts before web publication.

  Sources   Download

MIT

The Development Requires

text web articles russian auto typography publication copywriting preparation

21/01 2017

1.3.0

1.3.0.0 https://github.com/asleepwalker/typographie

Preparation of russian texts before web publication.

  Sources   Download

MIT

The Development Requires

text web articles russian auto typography publication copywriting preparation

17/04 2015

1.2.2

1.2.2.0 https://github.com/asleepwalker/typographie

Preparation of russian texts before web publication.

  Sources   Download

MIT

The Development Requires

text web articles russian auto typography publication copywriting preparation

27/03 2015

1.2.1

1.2.1.0 https://github.com/asleepwalker/typographie

Preparation of russian texts before web publication.

  Sources   Download

MIT

The Development Requires

text web articles russian auto typography publication copywriting preparation

24/03 2015

1.2.0

1.2.0.0 https://github.com/asleepwalker/typographie

Preparation of russian texts before web publication.

  Sources   Download

MIT

The Development Requires

text web articles russian auto typography publication copywriting preparation