New Typography extension #741
GiovanniSalmeri
started this conversation in
See what's new
Replies: 1 comment 2 replies
-
As regards to 1: Perhaps it's possible to style the title of a page without the need for a custom layout. At the moment the Typography extension requires to customise the default layout. Which is not that easy for new users. The extension could use the event Just a technical idea... stumbled upon it while commenting #998. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello. A new little extension Typography. This extension offers three "typographic" enhancements: I have put them together in one extension (after some hesitation) because each of them require little code (other than external JS libraries) and it seems to me probable that all of them are useful for the same scenarios:
As regards 2: I am not a huge fan of similar systems of automatic conversion, above all because there are two superior systems: directly writing the right Unicode characters (e.g. the .txt format in Project Gutemberg does so), or inserting (for the quotes) the tag
<q>
. But each of those systems can be inconvenient: for the first, text editors in general have a bad (or inexistent) support for those characters; for the second, one would be forced to use HTML, since no dialect of markdown has support for<q>
. Moreover, the first and most known system for automatic conversion of quotes and similar, Smartypants, was written by Gruber (and translated in PHP by Fortin) as a companion for Markdown, and also Commonmark has something very similar. In this implementation I tried to maintain the code as simple and fast as possible, and above all I made it language-sensitive: quotes are always written"
and'
(those are the ASCII proper characters), but they are converted differently according to the language of the page. Moreover, spaces receive a particular treatment in French texts. Obviously, the heuristic can sometimes fail, as in all similar systems.As regards 3: the native support for hyphenations is getting much better in the latest months, so the aim of this function is essentially to support older or niche browsers.
Edit: I have just discovered that a Smartypants extension did exist: #7 (comment)
Beta Was this translation helpful? Give feedback.
All reactions