8000 GitHub - Remi-Lo/slate: Beautiful static documentation for your API
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remi-Lo/slate

 
 

Repository files navigation

Some contents of this chapter have been copied from the Using Slate in Docker documentation on the Slate Wiki.

This guide assumes you are using a Docker-supported Linux-capable system. You could for instance be running Ubuntu in the Windows Terminal using Windows Subsystem for Linux (WSL). In that case you'd be using the dropdown menu in the tab bar to change to your Ubuntu terminal profile.

Dependencies

Docker: See this page for installing Docker Desktop.

Slate:

  1. Go to the directory where you wish to store slate and the documentation files. E.g. cd /mnt/e/.
  2. Clone the Slate repository to your hard drive with git clone https://github.com/slatedocs/slate.git.
    • You can also use git clone https://github.com/Remi-Lo/slate.git but it might be out of sync when pulling.
    • If you intend to create a custom version of Slate:
      • Fork the slatedocs repository on GitHub before cloning.
      • Use git clone https://github.com/YOURGITHUBUSERNAME/slate.git when cloning to your hard-drive.
  3. Go to the slate directory (cd slate).
  4. Grab the slate image (docker pull slatedocs/slate) or build the docker image for the repository (docker build . -t slatedocs/slate).
  5. Go to the parent directory (cd ..).

Note: If you are using the pre-built images for Slate, you may wish to remove all files other than the source directory from your repository.

Documentation source files

  1. Go to where the slate directory is stored (eg. cd /mnt/e/).
  2. Visit the api_docs repository on the Timegrip Bitbucket
  3. Click Clone and copy the git clone command.
  4. Run the command in the terminal:
    • E.g. git clone https://YOURBITBUCKETUSERNAME@bitbucket.org/timegrip/api_docs.git.

Building

To use Docker to build your site, run the following command but modify cd /mnt/e/ to be where the slate directory is stored first (eg. /mnt/c/containers/):

cd /mnt/e/ & docker run --rm --name slate -v $(pwd)/slate/build:/srv/slate/build -v $(pwd)/api_docs/source:/srv/slate/source slatedocs/slate build

After this command completes, you should see the built artifacts for your site in the $(pwd)/build directory, which you can then statically serve for your website.

Note: You may omit the final build argument and get the same result. By default, if given no command, the Dockerfile will run build.

Running

If you wish to run the development server for Slate to aid in working on the site, run:

docker run --rm --name slate -p 4567:4567 -v $(pwd)/api_docs/source:/srv/slate/source slatedocs/slate serve

and you will be able to access your site at http://localhost:4567 until you stop the running container process.

Further reading

See the official Slate repository for:

About

Beautiful static documentation for your API

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • SCSS 43.7%
  • Shell 18.6%
  • JavaScript 18.1%
  • Ruby 12.4%
  • HTML 6.5%
  • Dockerfile 0.7%
0