GithubHelp home page GithubHelp logo

giovannisalmeri / yellow-typography Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 719 KB

Typographic enhancements.

License: GNU General Public License v2.0

JavaScript 77.16% PHP 22.84%
datenstrom-yellow smartquotes hyphenation

yellow-typography's Introduction

Typography 0.8.21

Typographic enhancements.

Screenshot

How to install an extension

Download ZIP file and copy it into your system/extensions folder. Learn more about extensions.

How to style the title of the page

Change in the template (e.g. in layouts/default.html) $this->yellow->page->getHtml("titleContent") with $this->yellow->page->get("titleContent") and use markdown to style the title of the page.

How to insert proper quotations marks and other characters

Write " and ' for quotations marks, ' for apostrophe, ... for ellipsis, -- and --- for dashes, \' for prime, \" for double prime. These characters will be converted to the proper typographic ones.

How to hyphenate words at end of line

Add in the stylesheet the property hyphens: auto. With this extension the property is implied also when text-align: justify is set. Hyphenation will occur even in browsers that do not natively support it.

Examples

Content file with styled title:

---
Title: We make things for **people**
Published: 2020-04-07
Author: Datenstrom
---

We think people should be in the centre. Machines should support you.

Template for styled titles:

<?php $this->yellow->layout("header") ?>
<div class="content">
<div class="main" role="main">
<h1><?php echo $this->yellow->page->get("titleContent") ?></h1>
<?php echo $this->yellow->page->getContentHtml() ?>
</div>
</div>
<?php $this->yellow->layout("footer") ?>

Text with quotation marks and other special characters:

"We have three guidelines for our products..." she said. 
"Technology is useful in function and aesthetic. Technology 
is simple to use and adjust. Technology is made for people 
-- like you".

Stylesheet rule for hyphenating words when needed at end of line:

.content p {
    text-align: justify;
    hyphens: auto;
}

Settings

The following settings can be configured in file system/extensions/yellow-system.ini:

TypographyTitleParser = how titles are styled, markdown, safemarkdown without HTML, none
TypographySubstitutions = a comma separated list of characters which will be converted, e.g. quotes, apostrophe, dash, dots, space (space is used only in French texts)
TypographyHyphenation = enable hyphenation, 0 or 1

Acknowledgements

This extension includes Hyphenopoly 4.12.0 by Mathias Nater. Thank you for the good work.

Developer

Giovanni Salmeri. Get help.

yellow-typography's People

Contributors

giovannisalmeri avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.