GithubHelp home page GithubHelp logo

mkdocs-browsersync's Introduction

MkDocs + BrowserSync

Due to recent changes in MkDocs version 1.1.1, it is now less convenient to run MkDocs within a Docker for local development. In addition, the maintainer of MkDocs has stated that the libraries used to support serving and live reloading are poorly supported and may break in the future.

This repository attempts to offer an alternative solution, combining MkDocs, BrowserSync, and Gulp into a single Docker container which will watch a volume, automatically rebuild on changes, and then refresh attached browsers. The documentation is built and then rsynced to the final location to allow for a clean build that does not delete actively-served files while the build is in progress.

Usage

Basic usage (from the directory with your mkdocs.yml):

docker run --rm -p 8080:8080 -v $(pwd):/docs -it acaos/mkdocs-browsersync:latest

If you are using the excellent git-revision-date plugin and your .git directory is above your mkdocs.yml, you may need to specify the working directory as well (the example below assumes project/mkdocs.yml):

docker run --rm -p 8080:8080 -v $(pwd):/docs -w /docs/project -it acaos/mkdocs-browsersync:latest

Configuration

The only additional configuration available is that a MKDOCS_IGNORE environment variable may be passed which specifies a space-separated list of globs to ignore when watching.

Future Development

  • Inspect mkdocs.yml and build a better list of directories to watch rather than watching the entire working directory.
  • Allow more configuration of BrowserSync.
  • Add a sample docker-compose.yml for use with Docker Compose.
  • Add examples of more advanced usage (e.g. plugin integration, additional Gulp build steps).
  • Add examples for non-Dockerized usage.

mkdocs-browsersync's People

Contributors

trel avatar acaos avatar

Watchers

 avatar James Cloos avatar

Forkers

trel sashainparis

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.