diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ee98ae16..b6b74fc5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,3 +17,36 @@ jobs: with: python-version: 3.6 - run: scripts/changelog-check.sh + deploy: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + + - name: get-npm-version + id: package-version + uses: martinbeentjes/npm-get-version-action@master + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: '0.4.11' + + - run: mdbook build + + - name: Deploy v${{ steps.package-version.outputs.current-version }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + keep_files: true + publish_dir: ./book + destination_dir: ./v${{ steps.package-version.outputs.current-version }} + + # TODO: We can't update the config so we have to push twice, it's clearly not + # the best solution but it is A solution. + - name: Deploy latest + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + keep_files: true + publish_dir: ./book + destination_dir: ./latest \ No newline at end of file diff --git a/.gitignore b/.gitignore index b6ea28a0..4f968fbf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ bifrost-registration.yaml *.log* data/ .nyc_output/ -lib/ \ No newline at end of file +lib/ +book/ \ No newline at end of file diff --git a/README.md b/README.md index da54a051..4e37f287 100644 --- a/README.md +++ b/README.md @@ -120,3 +120,18 @@ if certain purple plugins cause more crashes, or if anything in particular lead ## Testing Running the tests is as simple as doing `yarn test` + +### Documentation + +Documentation can be found on [GitHub Pages](https://matrix-org.github.io/matrix-appservice-irc). + +You can build the documentaion yourself by: +``` +# Ensure that Rust is installed on your system. +# cargo install mdbook +mdbook build +sensible-browser book/index.html +``` + +## Contributing +Please see the [CONTRIBUTING](./CONTRIBUTING.md) file for information on contributing. diff --git a/book.toml b/book.toml new file mode 100644 index 00000000..39622376 --- /dev/null +++ b/book.toml @@ -0,0 +1,27 @@ +[book] +title = "Matrix Bifrost" +authors = ["The Matrix.org Foundation C.I.C."] +language = "en" +multilingual = false +src = "docs" + + +[build] +# Prevent markdown pages from being automatically generated when they're +# linked to in SUMMARY.md +create-missing = false + + +[output.html] +# The URL visitors will be directed to when they try to edit a page +edit-url-template = "https://github.com/matrix-org/matrix-bifrost/edit/develop/docs/{path}" + +# Remove the numbers that appear before each item in the sidebar, as they can +# get quite messy as we nest deeper +no-section-label = true + +# The source code URL of the repository +git-repository-url = "https://github.com/matrix-org/matrix-bifrost" + +# The path that the docs are hosted on +site-url = "/matrix-bifrost/" diff --git a/changelog.d/263.feature b/changelog.d/263.feature new file mode 100644 index 00000000..cee7df6f --- /dev/null +++ b/changelog.d/263.feature @@ -0,0 +1 @@ +Add in-tree documentation diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md new file mode 100644 index 00000000..190cea30 --- /dev/null +++ b/docs/SUMMARY.md @@ -0,0 +1,11 @@ +# Summary + +- [Bifrost](./bifrost.md) + +# Backends +- [XMPP](./getting-started/xmpp-js.md) +- [node-purple](./getting-started/node-purple.md) + +# Help +- [Usage](./usage.md) +- [Troubleshooting](./troubleshooting.md) \ No newline at end of file diff --git a/docs/bifrost.md b/docs/bifrost.md new file mode 100644 index 00000000..d021e998 --- /dev/null +++ b/docs/bifrost.md @@ -0,0 +1,2 @@ +Bifrost +======= \ No newline at end of file diff --git a/docs/getting-started/node-purple.md b/docs/getting-started/node-purple.md new file mode 100644 index 00000000..683be497 --- /dev/null +++ b/docs/getting-started/node-purple.md @@ -0,0 +1,2 @@ +libpurple +========= \ No newline at end of file diff --git a/docs/getting-started/xmpp-js.md b/docs/getting-started/xmpp-js.md new file mode 100644 index 00000000..009d8f81 --- /dev/null +++ b/docs/getting-started/xmpp-js.md @@ -0,0 +1,2 @@ +XMPP.js +======= \ No newline at end of file diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md new file mode 100644 index 00000000..4bbf2d3c --- /dev/null +++ b/docs/troubleshooting.md @@ -0,0 +1,2 @@ +Troubleshooting +================ \ No newline at end of file diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 00000000..9aeb47d1 --- /dev/null +++ b/docs/usage.md @@ -0,0 +1,2 @@ +Using the bridge +================ \ No newline at end of file