Git Product home page Git Product logo

mkdocs-extra-sass-plugin's Introduction

mkdocs-extra-sass-plugin

PyPI version PyPI downloads


This plugin adds stylesheets to your mkdocs site from Sass/SCSS.

Features

How to use

Installation

  1. Install the package with pip:

    pip install mkdocs-extra-sass-plugin
  2. Enable the plugin in your mkdocs.yml:

    plugins:
      - extra-sass

    Note: If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set, but now you have to enable it explicitly.

  3. Create a extra_sass directory in your working directory (usually the same directory as mkdocs.yml), and create entry point file named style.css.sass or style.css.scss.

    (top)
    ├── docs
    :  ...snip...
    │   └── index.md
    ├── extra_sass
    :  ...snip...
    │   └── style.css.scss (or style.css.sass)  # compiler entry point file.
    └── mkdocs.yml
    

More information about plugins in the MkDocs documentation.

Contributing

From reporting a bug to submitting a pull request: every contribution is appreciated and welcome. Report bugs, ask questions and request features using Github issues. If you want to contribute to the code of this project, please read the Contribution Guidelines.

mkdocs-extra-sass-plugin's People

Contributors

orzih avatar

Stargazers

 avatar  avatar  avatar

Forkers

urz9999 max-uho

mkdocs-extra-sass-plugin's Issues

Live reload leads to re-compiling SCSS even when sources are not modified

When developing the site and modifying files and mkdocs.yml, a full rebuild of SCSS happens on the page renewal when a Markdown or a config files are modified. It impacts the developer experience quite a lot.

It would be great to update the plugin so that it runs rebuild only when its settings are changed, or when there are changes in the extra_sass directory

Reproduction

Ubuntu - ModuleNotFoundError: No module named 'livereload'

Hello, thanks for this plugin!

I understand that this 'livereload' issue has been common with others. This was supposedly fixed in mkdocs 1.2.2. However, I am still getting this error, and only when the mkdocs-extra-sass plugin in enabled in mkdocs.yml.

This only seems to be happening in GitHub Action's Ubuntu 20.04 with Python v. 3.10 - 3.9; macOS with Python v. 3.9 works fine. I have tried a variety of dependency versions.

Any insight is greatly appreciated.

Edit: I should add that I am attempting to use this in conjunction with @orzih 's mkdocs-with-pdf plugin (thank you for this plugin too!)

Error on server on windows

Error when server: ModuleNotFoundError: No module named 'livereload'

log
$ mkdocs serve
INFO     -  Building documentation...
Traceback (most recent call last):
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\Scripts\mkdocs.exe\__main__.py", line 7, in <module>
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\click\core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\mkdocs\__main__.py", line 173, in serve_command
    serve.serve(dev_addr=dev_addr, livereload=livereload, **kwargs)
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\mkdocs\commands\serve.py", line 54, in serve
    config = builder()
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\mkdocs\commands\serve.py", line 35, in builder
    config = load_config(
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\mkdocs\config\base.py", line 224, in load_config
    errors, warnings = cfg.validate()
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\mkdocs\config\base.py", line 108, in validate
    run_failed, run_warnings = self._validate()
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\mkdocs\config\base.py", line 63, in _validate
    self[key] = config_option.validate(value)
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\mkdocs\config\config_options.py", line 130, in validate
    return self.run_validation(value)
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\mkdocs\config\config_options.py", line 636, in run_validation       
    plgins[item] = self.load_plugin(item, cfg)
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\mkdocs\config\config_options.py", line 649, in load_plugin
    Plugin = self.installed_plugins[name].load()
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\importlib_metadata\__init__.py", line 194, in load
    module = import_module(match.group('module'))
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:\Users\<User>\AppData\Local\Programs\Python\Python39\lib\site-packages\mkdocs_extra_sass_plugin\plugin.py", line 10, in <module>
    from livereload import Server
ModuleNotFoundError: No module named 'livereload'

Solved by installing pip install livereload

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.