This commit is contained in:
Sergei Erjemin 2023-06-02 15:46:29 +03:00
parent 2d5b957c24
commit a065b795f3
2 changed files with 8 additions and 5 deletions

View File

@ -1,14 +1,17 @@
# mdash Typograph for Python 3.5 (and above) # mdash Typograph for Python 3.5 (and above)
Это mdash Typograph (Типограф Евгения Муравьева) адаптированный для версии Python 3.5 и выше. Оригинальный типограф был создан на PHP и находится [на github](https://github.com/emuravjev/mdash) и [mdash.ru](http://mdash.ru).
It is EMT (Evgeny Muravjev Typograph) prepared for Python 3.5 (and above). Original EMT is written in PHP and can be found here: [github.com/emuravjev/mdash](https://github.com/emuravjev/mdash) and It is EMT (Evgeny Muravjev Typograph) prepared for Python 3.5 (and above). Original EMT is written in PHP and can be found here: [github.com/emuravjev/mdash](https://github.com/emuravjev/mdash) and
[mdash.ru](http://mdash.ru). [mdash.ru](http://mdash.ru).
---- ----
### Note ### Примечания (Note)
Имейте в виду, что в сочетании с wysiwyg-редакторами (например с ckeditor) EMT может создавать артефакты HTML-кода и даже вызывать сбой типографа. Будьте осторожны и будьте готовы добавить костыли пре- и постобработки.
Be aware that when combined with wysiwyg-editor (like ckeditor), EMT can create HTML-code artifacts and even cause typographer to crash. Be careful and get ready to add pre- and post-processing crutches. Be aware that when combined with wysiwyg-editor (like ckeditor), EMT can create HTML-code artifacts and even cause typographer to crash. Be careful and get ready to add pre- and post-processing crutches.
### TODO ### TODO
* Protect text in `<pre>`, `<code>`, `<kbd>`, `<script>` and `<style>` tags. * Защитить от типографирования текст внутри `<pre>`, `<code>`, `<kbd>`, `<script>` и `<style>`.
* Long word wrap (Hyphenation `&shy;`). * Добавить переносы для длинных слов (Hyphenation `&shy;`).

4
run.py
View File

@ -12,8 +12,8 @@ def main():
'Это означает 100000 руб., что вы можете просто добавить максимальное количество символов заполнения, ' \ 'Это означает 100000 руб., что вы можете просто добавить максимальное количество символов заполнения, ' \
'которое вам когда-либо понадобится, а это три ( b\'===\'), и base64 обрежет все ненужные.\n\n' \ 'которое вам когда-либо понадобится, а это три ( b\'===\'), и base64 обрежет все ненужные.\n\n' \
'Это позволяет вам писать:\n' \ 'Это позволяет вам писать:\n' \
'<code>base64.b64decode(s + b\'===\')\n' \ '<pre>base64.b64decode(s + b\'===\')\n' \
'base64.b64decode(s + b\'=\' * (-len(s) % 4))\'\n</code>\n' 'base64.b64decode(s + b\'=\' * (-len(s) % 4))\'\n</pre>\n'
emt.set_text(txt) emt.set_text(txt)
# emt.set_tag_layout(layout=EMT.LAYOUT_CLASS) # emt.set_tag_layout(layout=EMT.LAYOUT_CLASS)
# rules = {'Text.paragraphs': 'on'} # rules = {'Text.paragraphs': 'on'}