erixtekila / gitbook-plugin-richquotes

Gitbook plugin : Transform annoted quotes to notes
Apache License 2.0
49 stars 14 forks source link

Adding option to omit icons #8

Closed alexandreaquiles closed 9 years ago

alexandreaquiles commented 10 years ago

Do not show icons in quotes if user configures an omitIcons option to true in book.json.

Example:

{
    "plugins"       : ["richquotes"]
    ,"pluginsConfig":
    {
        "richquotes" :
        {
            "omitIcons" : true
        }
    }
}

If omitIcons is missing or false, the icons are shown.

erixtekila commented 10 years ago

Hi,

What is the use case for this. Won't a normal quote suffice ?

omitIcons is global, making it impossible to use icons sometimes…

alexandreaquiles commented 10 years ago

Actually, I'm using richquotes just to create a box with some content. It differs a bit from a normal quote because it is "boxier"... :)

Besides that, there is a technical reason: for icons to work when generating an ebook (pdf, epub and mobi), you'd have to add FontAwesome. The style.css points to that font. I couldn't get it to work.

alexandreaquiles commented 9 years ago

Solved this through a custom Gitbook plugin that adds CSS to the HTML generated for ebook conversion.

Code of the plugin:

module.exports = {
    ebook : {
        assets: "./book",
        css: [
            "ebook.css"
        ]
    }

CSS code:

.alert {
    color: black;
    padding: 15px;
    margin: 10px 0 20px 0;
    border-collapse: collapse;
    border: 1px solid black;
    page-break-inside: avoid;
}
/* rest of file */