bitcoin-s/website/versioned_docs/version-0.1.0/contributing-website.md
2019-06-20 13:48:12 +02:00

2.6 KiB

id title original_id
version-0.1.0-contributing-website Contributing to the website contributing-website

This website is built using Docusaurus.

For simple changes to the documentation, click on the Edit button at the top of each page and submit those changes directly on GitHub.

Scaladoc

One of the goals of Bitcoin-S is having useful and well-formatted Scaladoc comments on classes, objects and functions. Here are some useful resources on how to properly format your Scaladoc comments:

To generate Scaladocs:

$ sbt
> unidoc

This gets placed in website/static/api. When viewing the Docusaurus site the generated Scaladocs appear under the API tab in the header bar, or in the "API reference" link in the footer.

Running the site locally

For running the website locally, you'll need:

In case you want to contribute substantial structural changes to the website, we suggest to read Docusaurus' documentation first.

You can now build and launch the website using these commands:

cd website
yarn install # only the first time, to install the dependencies
yarn start

In a separate shell:

$ sbt
> doc/mdoc --watch

The above commands compiles our Mdoc Markdown files every time you change them, and puts them in the correct directory for Docusaurus to find them.

Now visit http://localhost:3000/ and you should see a local version of the website.

Adding a new page

Whenever you add a new markdown page to the documentation, you'll have to manually include it in the side menu.

You can do this by editing the website/sidebars.json file. The name to use is the id specified in the page metadata (see the existing pages for an example).

Publishing the site

$ sbt
> docs/publishWebsite

This command first generates Scaladocs, then invokes docs/docusaurusPublishGhPages, which in turn compile our mdoc files, build the site and push them to GH pages.

Before running those commands, you might have to change a few constants in siteConfig.js. These are specifed in the comments of that file.