Skip to content

Commit

Permalink
Version 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronef committed Aug 22, 2023
2 parents 480367d + f50d106 commit e1324fc
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 43 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# (MODX)EvolutionCMS.snippets.ddTypograph changelog


## Version 2.6 (2023-08-22)
* \+ Parameters → `optAlign_useClasses`: The new parameter. Allows to use CSS classes instead of inline styles for optical alignment (`<span class="oa_comma_b">` instead of `<span style="margin-right:-0.2em;">`).
* \+ README:
* \+ Installation → Using (MODX)EvolutionCMS.libraries.ddInstaller.
* \+ Links → GitHub.
* \+ Composer.json:
* \+ `support`.
* \+ `autoload`.


## Version 2.5 (2021-03-29)
* \* Attention! PHP >= 5.6 is required.
* \* Attention! (MODX)EvolutionCMS.libraries.ddTools >= 0.48.1 is required.
Expand Down Expand Up @@ -108,5 +118,5 @@
* \+ Added disabling base-params for tofs.


<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />
<link rel="stylesheet" type="text/css" href="https://raw.githack.com/DivanDesign/CSS.ddMarkdown/master/style.min.css" />
<style>ul{list-style:none;}</style>
14 changes: 12 additions & 2 deletions CHANGELOG_ru.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# (MODX)EvolutionCMS.snippets.ddTypograph changelog


## Version 2.5 (2021-03-29)
## Версия 2.6 (2023-08-22)
* \+ Параметры → `optAlign_useClasses`: Новый параметр. Позволяет использовать CSS-классы вместо inline-стилей для оптического выравнивания (`<span class="oa_comma_b">` вместо `<span style="margin-right:-0.2em;">`).
* \+ README:
* \+ Установка → Используя (MODX)EvolutionCMS.libraries.ddInstaller.
* \+ Ссылки → GitHub.
* \+ Composer.json:
* \+ `support`.
* \+ `autoload`.


## Версия 2.5 (2021-03-29)
* \* Внимание! Требуется PHP >= 5.6.
* \* Внимание! Требуется (MODX)EvolutionCMS.libraries.ddTools >= 0.48.1.
* \+ Запустить сниппет без DB и eval можно через `\DDTools\Snippet::runSnippet` (см. примеры в README).
Expand Down Expand Up @@ -109,5 +119,5 @@
* \+ Добавлена возможность отключить базовые параметры для тофов.


<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />
<link rel="stylesheet" type="text/css" href="https://raw.githack.com/DivanDesign/CSS.ddMarkdown/master/style.min.css" />
<style>ul{list-style:none;}</style>
67 changes: 54 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,42 @@ The snippet doesn’t use third-party services, also it sends no requests. In ot
## Requires

* PHP >= 5.6
* [(MODX)EvolutionCMS.libraries.ddTools](https://code.divandesign.biz/modx/ddtools) >= 0.48.1
* [(MODX)EvolutionCMS.libraries.ddTools](https://code.divandesign.ru/modx/ddtools) >= 0.48.1
* [PHP.libraries.EMT](http://mdash.ru) 3.5 (contains in archive)


## Documentation
## Installation


### Installation
### Using [(MODX)EvolutionCMS.libraries.ddInstaller](https://github.com/DivanDesign/EvolutionCMS.libraries.ddInstaller)

Just run the following PHP code in your sources or [Console](https://github.com/vanchelo/MODX-Evolution-Ajax-Console):

```php
//Include (MODX)EvolutionCMS.libraries.ddInstaller
require_once(
$modx->getConfig('base_path') .
'assets/libs/ddInstaller/require.php'
);

//Install (MODX)EvolutionCMS.snippets.ddTypograph
\DDInstaller::install([
'url' => 'https://github.com/DivanDesign/EvolutionCMS.snippets.ddTypograph',
'type' => 'snippet'
]);
```

* If `ddTypograph` is not exist on your site, `ddInstaller` will just install it.
* If `ddTypograph` is already exist on your site, `ddInstaller` will check it version and update it if needed.


### Manually


#### 1. Elements → Snippets: Create a new snippet with the following data

1. Snippet name: `ddTypograph`.
2. Description: `<b>2.5</b> Snippet for text typography. The snippet doesn’t use third-party services, also it sends no requests. In other words, everything is performed on your server.`.
2. Description: `<b>2.6</b> Snippet for text typography. The snippet doesn’t use third-party services, also it sends no requests. In other words, everything is performed on your server.`.
3. Category: `Core`.
4. Parse DocBlock: `no`.
5. Snippet code (php): Insert content of the `ddTypograph_snippet.php` file from the archive.
Expand All @@ -32,7 +54,7 @@ The snippet doesn’t use third-party services, also it sends no requests. In ot
2. Extract the archive to the folder (except `ddTypograph_snippet.php`).


### Parameters description
## Parameters description

* `text`
* Desctription: Text to correct.
Expand All @@ -46,6 +68,24 @@ The snippet doesn’t use third-party services, also it sends no requests. In ot
* `1`
* Default value: `0`

* `optAlign_useClasses`
* Desctription: Use CSS classes instead of inline styles for optical alignment (`<span class="oa_comma_b">` instead of `<span style="margin-right:-0.2em;">`).
If the parameter is enabled, don't forget to specify the following CSS rules on your site:
```css
.oa_obracket_sp_s {margin-right:0.3em;}
.oa_obracket_sp_b {margin-left:-0.3em;}
.oa_obracket_nl_b {margin-left:-0.3em;}
.oa_comma_b {margin-right:-0.2em;}
.oa_comma_e {margin-left:0.2em;}
.oa_oquote_nl {margin-left:-0.44em;}
.oa_oqoute_sp_s {margin-right:0.44em;}
.oa_oqoute_sp_q {margin-left:-0.44em;}
```
* Valid values:
* `0`
* `1`
* Default value: `0`

* `text_paragraphs`
* Desctription: Section signs and line breaks insertion.
* Valid values:
Expand Down Expand Up @@ -81,17 +121,17 @@ The snippet doesn’t use third-party services, also it sends no requests. In ot
* Default value: `'notg,code'`


### Examples
## Examples


#### Typography the content
### Typography the content

```
[[ddTypograph? &text=`[*content*]`]]
```


#### Typography text with auto paragraphs, links & emails
### Typography text with auto paragraphs, links & emails

```
[[ddTypograph?
Expand All @@ -102,7 +142,7 @@ The snippet doesn’t use third-party services, also it sends no requests. In ot
```


#### Typography text with auto optical margin alignment (hanging quotes & etc)
### Typography text with auto optical margin alignment (hanging quotes & etc)

```
[[ddTypograph?
Expand All @@ -112,7 +152,7 @@ The snippet doesn’t use third-party services, also it sends no requests. In ot
```


#### Turn off typography for a text fragment (the `<notg></notg>` tag)
### Turn off typography for a text fragment (the `<notg></notg>` tag)

```html
[[ddTypograph?
Expand All @@ -121,7 +161,7 @@ The snippet doesn’t use third-party services, also it sends no requests. In ot
```


#### Run the snippet through `\DDTools\Snippet::runSnippet` without DB and eval
### Run the snippet through `\DDTools\Snippet::runSnippet` without DB and eval

```php
\DDTools\Snippet::runSnippet([
Expand Down Expand Up @@ -150,9 +190,10 @@ Nothing you can sing that can’t be&nbsp;sung</p>

## Links

* [Home page](https://code.divandesign.biz/modx/ddtypograph)
* [Home page](https://code.divandesign.ru/modx/ddtypograph)
* [Telegram chat](https://t.me/dd_code)
* [Packagist](https://packagist.org/packages/dd/evolutioncms-snippets-ddtypograph)
* [GitHub](https://github.com/DivanDesign/EvolutionCMS.snippets.ddTypograph)


<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />
<link rel="stylesheet" type="text/css" href="https://raw.githack.com/DivanDesign/CSS.ddMarkdown/master/style.min.css" />
65 changes: 53 additions & 12 deletions README_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,42 @@
## Использует

* PHP >= 5.6
* [(MODX)EvolutionCMS.libraries.ddTools](https://code.divandesign.biz/modx/ddtools) >= 0.48.1
* [(MODX)EvolutionCMS.libraries.ddTools](https://code.divandesign.ru/modx/ddtools) >= 0.48.1
* [PHP.libraries.EMT](http://mdash.ru) 3.5 (содержится в архиве)


## Документация
## Установка


### Установка
### Используя [(MODX)EvolutionCMS.libraries.ddInstaller](https://github.com/DivanDesign/EvolutionCMS.libraries.ddInstaller)

Просто вызовите следующий код в своих исходинках или модуле [Console](https://github.com/vanchelo/MODX-Evolution-Ajax-Console):

```php
//Подключение (MODX)EvolutionCMS.libraries.ddInstaller
require_once(
$modx->getConfig('base_path') .
'assets/libs/ddInstaller/require.php'
);

//Установка (MODX)EvolutionCMS.snippets.ddTypograph
\DDInstaller::install([
'url' => 'https://github.com/DivanDesign/EvolutionCMS.snippets.ddTypograph',
'type' => 'snippet'
]);
```

* Если `ddTypograph` отсутствует на вашем сайте, `ddInstaller` просто установит его.
* Если `ddTypograph` уже есть на вашем сайте, `ddInstaller` проверит его версию и обновит, если нужно.


### Вручную


#### 1. Элементы → Сниппеты: Создайте новый сниппет со следующими параметрами

1. Название сниппета: `ddTypograph`.
2. Описание: `<b>2.5</b> Сниппет типографирует текст. Не использует сторонних сервисов, не отправляет никаких запросов, всё делается прямо у вас на сервере.`.
2. Описание: `<b>2.6</b> Сниппет типографирует текст. Не использует сторонних сервисов, не отправляет никаких запросов, всё делается прямо у вас на сервере.`.
3. Категория: `Core`.
4. Анализировать DocBlock: `no`.
5. Код сниппета (php): Вставьте содержимое файла `ddTypograph_snippet.php` из архива.
Expand All @@ -31,7 +53,7 @@
2. Извлеките содержимое архива в неё (кроме файла `ddTypograph_snippet.php`).


### Описание параметров
## Описание параметров

* `text`
* Описание: Текст, который нужно типографировать.
Expand All @@ -45,6 +67,24 @@
* `1`
* Значение по умолчанию: `0`

* `optAlign_useClasses`
* Описание: Использовать CSS-классы вместо inline-стилей для оптического выравнивания (`<span class="oa_comma_b">` вместо `<span style="margin-right:-0.2em;">`).
Если параметр включен, не забудьте прописать на своём сайте следующие правила CSS:
```css
.oa_obracket_sp_s {margin-right:0.3em;}
.oa_obracket_sp_b {margin-left:-0.3em;}
.oa_obracket_nl_b {margin-left:-0.3em;}
.oa_comma_b {margin-right:-0.2em;}
.oa_comma_e {margin-left:0.2em;}
.oa_oquote_nl {margin-left:-0.44em;}
.oa_oqoute_sp_s {margin-right:0.44em;}
.oa_oqoute_sp_q {margin-left:-0.44em;}
```
* Допустимые значения:
* `0`
* `1`
* Значение по умолчанию: `0`

* `text_paragraphs`
* Описание: Простановка параграфов и переносов строк.
* Допустимые значения:
Expand Down Expand Up @@ -80,17 +120,17 @@
* Значение по умолчанию: `'notg,code'`


### Примеры
## Примеры


#### Типографирование контента перед выводом
### Типографирование контента перед выводом

```
[[ddTypograph? &text=`[*content*]`]]
```


#### Типографирование текста с автоматической расстановкой абзацев, ссылок и адресов email
### Типографирование текста с автоматической расстановкой абзацев, ссылок и адресов email

```
[[ddTypograph?
Expand All @@ -101,7 +141,7 @@
```


#### Типографирование текста с автоматическим оптическим выравниванием (висячие кавычки и пр.)
### Типографирование текста с автоматическим оптическим выравниванием (висячие кавычки и пр.)

```
[[ddTypograph?
Expand All @@ -111,7 +151,7 @@
```


#### Отключить работу типографа для фрагмента текста (тег `<notg></notg>`)
### Отключить работу типографа для фрагмента текста (тег `<notg></notg>`)

```html
[[ddTypograph?
Expand All @@ -120,7 +160,7 @@
```


#### Запустить сниппет без DB и eval через `\DDTools\Snippet::runSnippet`
### Запустить сниппет без DB и eval через `\DDTools\Snippet::runSnippet`

```php
\DDTools\Snippet::runSnippet([
Expand Down Expand Up @@ -152,6 +192,7 @@ Nothing you can sing that can’t be&nbsp;sung</p>
* [Home page](https://code.divandesign.ru/modx/ddtypograph)
* [Telegram chat](https://t.me/dd_code)
* [Packagist](https://packagist.org/packages/dd/evolutioncms-snippets-ddtypograph)
* [GitHub](https://github.com/DivanDesign/EvolutionCMS.snippets.ddTypograph)


<link rel="stylesheet" type="text/css" href="https://DivanDesign.ru/assets/files/ddMarkdown.css" />
<link rel="stylesheet" type="text/css" href="https://raw.githack.com/DivanDesign/CSS.ddMarkdown/master/style.min.css" />
20 changes: 11 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dd/evolutioncms-snippets-ddtypograph",
"type": "modxevo-snippet",
"version": "2.5.0",
"version": "2.6.0",
"description": "Snippet for text typography. The snippet doesn't use third-party services, also it sends no requests. In other words, everything is performed on your server.",
"keywords": [
"modx",
Expand All @@ -21,23 +21,25 @@
"text correction",
"text typography"
],
"homepage": "https://code.divandesign.biz/modx/ddtypograph",
"homepage": "https://code.divandesign.ru/modx/ddtypograph",
"support": {
"chat": "https://t.me/dd_code"
},
"authors": [
{
"name": "DD Group",
"email": "[email protected]",
"homepage": "https://code.divandesign.biz",
"role": "Owner"
},
{
"name": "Ilyas Ronef",
"email": "[email protected]",
"homepage": "https://ronef.ru",
"role": "Developer"
"role": "Owner"
}
],
"require": {
"php": ">=5.6.0",
"dd/evolutioncms-libraries-ddtools": ">=0.48.1"
},
"autoload": {
"psr-4": {
"ddTypograph\\": "src/"
}
}
}
6 changes: 3 additions & 3 deletions ddTypograph_snippet.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
/**
* ddTypograph
* @version 2.5 (2021-03-29)
* @version 2.6 (2023-08-22)
*
* @see README.md
*
* @link https://code.divandesign.biz/modx/ddtypograph
* @link https://code.divandesign.ru/modx/ddtypograph
*
* @copyright 2010–2021 DD Group {@link https://DivanDesign.biz }
* @copyright 2010–2023 Ronef {@link https://Ronef.ru }
*/

//Include (MODX)EvolutionCMS.libraries.ddTools
Expand Down
Loading

0 comments on commit e1324fc

Please sign in to comment.