Giter VIP home page Giter VIP logo

plugin-styles-sass's Introduction

SASS Stylesheets for GitBook

This plugin makes it easy to use SASS custom stylesheets instead of CSS for your book.

Add it to your book.json, with some custom stylesheets:

{
    "plugins": ["styles-sass"],
    "styles": {
        "pdf": "./styles/pdf.sass"
    }
}

plugin-styles-sass's People

Contributors

ddidier avatar samypesse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

plugin-styles-sass's Issues

How can this work?

First I'm no JS or Node expert. I followed the simple instructions on the README page but that wasn't working. After much debugging with my limited knowledge I came to the conclusion that cannot possibly work or I'm really missing something.

In website.js in prepareStyles at line 52 : that.book.resolve(stylePath) is resolving the style path against the source root and not the generated _book directory. So it's working for a static file which is already there but not for a generated one which will be in the _book directory.

The only workaround I see without touching gitbook is to generated the CSS in the source, ie:

// Temporary CSS file
var tmpfile = filename.replace(/(sass|scss)$/i, "css");

// Replace config
book.config.set('styles.'+type, tmpfile);

return renderSASS(
    book.resolve(filename),
    path.resolve(tmpfile)
);

Q: Isn't node-sass upgraded?

I tried work in Windows

Problem:
Install style-sass work hard; depends [email protected]

  1. download fail for
Cannot download "https://github.com/sass/node-sass/releases/download/v3.4.1/win32-x64-51_binding.node":
  1. build error msbuild v120 with not found function in .dll
  2. build fail msbuild v140 mismatch version

at Visual Studio 2015 Comm. (v140) / msbuild solo install (v120)

Resolved:
npm install -g node-sass(current version 4.0.0) are fine.
this package binary safe

Regerd.

Issues with nodejs 6.0.0

Got following error after updating to Node.js v6.0.0:

Error: Error loading plugins: gitbook-plugin-styles-sass. Run 'gitbook install' to install plugins from NPM.

gitbook install finished without warnings.

I can't make it work

Hello ! Thanks for this plugin development, SASS would be very useful for sure.
Unfortunately, I can't manage to make it work.

I've tried :

  • Adding to book.json then gitbook install
  • Install via npm, npm i gitbook-plugin-styles-sass --save-dev then gitbook serve
  • Every combination of the above in every order, using both the "plugins": ["styles-sass"] and the "plugins": ["[email protected]"] syntax.

What did I miss ?


[email protected]
├── [email protected]

Error loading plugin

I've got an error when using this plugin, but I don't know why. I'm using NVM with node 5.1.

{
    "plugins": [
        "[email protected]"
    ],
    "styles": {
        "website": "styles/website.css"
    }
}
{ nvm: 5.1.0 }
% gitbook install                   
info: 1 plugins to install 
info: install plugin styles-sass from npm (gitbook-plugin-styles-sass) with version 1.0.0 
info: >> plugin styles-sass installed with success 

Done, without error

{ nvm: 5.1.0 }
% gitbook build                     
info: loading book configuration....OK 
info: load plugin gitbook-plugin-styles-sass ....ERROR
info: load plugin gitbook-plugin-highlight ....OK 

Error: Error loading plugins: gitbook-plugin-styles-sass. Run "gitbook install" to install plugins from NPM.

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.