Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade docusaurus #49

Merged
merged 9 commits into from
Nov 9, 2023
5 changes: 4 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
BASE_URL=/docs/
TARGET_URL=https://flashbots.github.io
TARGET_URL=https://flashbots.github.io
ALGOLIA_SEARCH_API_KEY=
ALGOLIA_INDEX_NAME=
ALGOLIA_APP_ID=
3 changes: 3 additions & 0 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
env:
TARGET_URL: "http://localhost:3000"
BASE_URL: "/docs/"
ALGOLIA_APP_ID: "example"
ALGOLIA_SEARCH_API_KEY: "example"
ALGOLIA_INDEX_NAME: "example"
run: yarn build

- name: Check for broken links
Expand Down
12 changes: 6 additions & 6 deletions docs/how-to/interact-with-suave/forge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ Then, run the Forge script with the `ffi` flag enabled:
forge script Example.sol --ffi
```

<details>
<Details>
<summary>Having issues?</summary>
<div>
<div>
<div>
Typically, building SUAVE yourself places the binary in the $GOPATH/bin directory. If it didn't happen, ensure that path is added to your PATH environment variable:<br/><br/>
<code>
export PATH=$PATH:$GOPATH/bin
</code>
Typically, building SUAVE yourself places the binary in the $GOPATH/bin directory. If it didn't happen, ensure that path is added to your PATH environment variable: <br/><br/>
<pre>
export PATH=\$PATH\:$GOPATH\/bin
</pre>
</div>
</div>
</div>
</details>
</Details>

The Forge script should print the gas used to run the specified function in your console. If you check the logs of your SUAVE devnet, you should see a message like this:

Expand Down
12 changes: 6 additions & 6 deletions docs/how-to/run-suave/build-yourself.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ It should tell you the block height of your local network.
<div>
<div>
If you are seeing:<br/>
<code>
<pre>
"cp: cannot create regular file '/bin/suave': Permission denied"
</code><br/><br/>
</pre><br/><br/>
it is most likely because you have not set your GOPATH correctly. You can do so by running:<br/><br/>
<code>
<pre>
export GOPATH=$HOME/go
</code>
</pre>
</div>
</div>
</div>
Expand All @@ -115,9 +115,9 @@ It should tell you the block height of your local network.
<div>
<div>
If you have set up a new machine to run through this, you'll also need to install Make and Go:<br/>
<code>
<pre>
sudo apt install make golang-go
</code>
</pre>
</div>
</div>
</div>
Expand Down
40 changes: 19 additions & 21 deletions docs/how-to/run-suave/with-docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,20 @@ Run SUAVE:
make devnet-up
```

<details>
<Details>
<summary>1. Docker permission errors</summary>
<div>
<div>
<div>
It is likely best to create a new user group for Docker, rather than run the above command as <code>sudo</code>. You can do by running:<br/><br/>
<code>
It is likely best to create a new user group for Docker, rather than run the above command as sudo. You can do by running:<br/><br/>
<pre>
sudo usermod -aG docker $USER
</code><br/>
<code>
newgrp docker
</code>
</pre>
</div>
</div>
</div>
</details>
</Details>


### Testing transactions
Expand Down Expand Up @@ -81,38 +79,38 @@ make devnet-down

### Troubleshooting

<details>
<Details>
<summary>Docker not running</summary>
<div>
<div>
<div>
Make sure that Docker is running. On most Linux machines, you can do this with:<br/>
<code>
<pre>
sudo systemctl start docker
</code><br/><br/>
</pre><br/>
You can check the current status with:<br/>
<code>
<pre>
sudo systemctl status docker
</code><br/><br/>
</pre><br/>
If you installed Docker and still run into issues with docker-compose, you can try:<br/>
<code>
<pre>
sudo apt install docker-compose
</code>
</pre>
</div>
</div>
</div>
</details>
<details>
</Details>
<Details>
<summary>Unsupported version</summary>
<div>
<div>
<div>
If you're running an older version of Docker, you may get a message that looks like this:<br/><br/>
<code>
If you're running an older version of Docker, you may get a message that looks like this:<br/>
<pre>
ERROR: Version in "././suave/devenv/docker-compose.yml" is unsupported.
</code><br/><br/>
Go to the file in <code>/suave/devenv/docker-compose.yml</code> and change the first line to use <code>3.3</code> rather than <code>3.8</code>.
</pre><br/>
Go to the file in "/suave/devenv/docker-compose.yml" and change the first line to use <b>3.3</b> rather than <b>3.8</b>.
</div>
</div>
</div>
</details>
</Details>
4 changes: 2 additions & 2 deletions docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Welcome. Let's start building better mechanisms.
Run SUAVE locally
</div>
<div class="introDesc">
Start learning about what SUAVE can do by running it
Learn about SUAVE by running it
</div>
</div>
</div>
Expand Down Expand Up @@ -126,7 +126,7 @@ If you'd like to discuss ideas for SUAVE or begin contributing, you can find us
Start contributing
</div>
<div class="introDesc">
See the code and understand how we work together
Read the code and work with us
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/join/code-of-conduct.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Code of Conduct

At Flashbots we contribute with the larger free software community to illuminate the dark forest.

You are welcome here <3.
You are welcome here.

We just ask you to be nice. Please start by reading our code of conduct.

Expand Down
193 changes: 99 additions & 94 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,104 +1,109 @@
/**
* Copyright (c) Flashbots Ltd. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
require('dotenv').config()
const math = require('remark-math');
const katex = require('rehype-katex');
const lightCodeTheme = require("prism-react-renderer/themes/github")
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
const {themes} = require('prism-react-renderer');
const lightTheme = themes.github;
const darkTheme = themes.dracula;

// With JSDoc @type annotations, IDEs can provide config autocompletion
/** @type {import('@docusaurus/types').DocusaurusConfig} */
(module.exports = {
title: 'SUAVE',
tagline: 'Illuminate, Democratize, Distribute',
baseUrl: process.env.BASE_URL,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'flashbots',
projectName: 'docs',
url: process.env.TARGET_URL,
markdown: {
mermaid: true,
},
themes: ['@docusaurus/theme-mermaid'],
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
type: 'text/css',
integrity:
'sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X',
crossorigin: 'anonymous',
/** @returns {Promise<import('@docusaurus/types').Config>} */
module.exports = async function createConfigAsync() {
return {
title: 'SUAVE',
tagline: 'Illuminate, Democratize, Distribute',
baseUrl: process.env.BASE_URL,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'flashbots',
projectName: 'docs',
url: process.env.TARGET_URL,
markdown: {
mermaid: true,
},
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
algolia: {
apiKey: '693df7609c6aeaac03b78418095b79c4',
indexName: 'flashbots',
// Optional: see doc section below
appId: 'BH4D9OD16A',
},
colorMode: {
defaultMode: 'light',
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ['solidity']
},
docs: {
sidebar: {
hideable: true
}
themes: ['@docusaurus/theme-mermaid'],
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
type: 'text/css',
integrity:
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
crossorigin: 'anonymous',
},
navbar: {
title: 'SUAVE',
logo: {
alt: 'Flashbots Logo',
src: 'img/logo.png',
},
items: [
{
href: 'https://github.com/flashbots/suave-geth',
label: 'GitHub',
position: 'right',
},
],
}

}),
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
docs: {
sidebarPath: require.resolve('./docs/sidebars.js'),
// Please change this to your repo.
routeBasePath: '/',
editUrl: "https://github.com/flashbots/suave-docs/edit/main/",
showLastUpdateTime: true,
remarkPlugins: [math],
rehypePlugins: [katex],
algolia: {
apiKey: process.env.ALGOLIA_SEARCH_API_KEY,
indexName: process.env.ALGOLIA_INDEX_NAME,
appId: process.env.ALGOLIA_APP_ID,
},
colorMode: {
defaultMode: 'light',
},
theme: {
customCss: require.resolve("./src/scss/custom.scss")
prism: {
theme: lightTheme,
darkTheme: darkTheme,
additionalLanguages: ['solidity']
},
docs: {
sidebar: {
hideable: true
}
},
navbar: {
title: 'SUAVE',
logo: {
alt: 'Flashbots Logo',
src: 'img/logo.png',
},
items: [
{
href: 'https://github.com/flashbots/suave-geth',
label: 'GitHub',
position: 'right',
},
],
}

}),
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./docs/sidebars.js'),
// Please change this to your repo.
routeBasePath: '/',
editUrl: "https://github.com/flashbots/suave-docs/edit/main/",
showLastUpdateTime: true,
remarkPlugins: [(await import('remark-math')).default],
rehypePlugins: [(await import('rehype-katex')).default],
},
theme: {
customCss: require.resolve("./src/scss/custom.scss")
},
}),
],
],
],
plugins: [
'docusaurus-plugin-sass',
[
"docusaurus2-dotenv",
{
path: "./.env", // The path to your environment variables.
safe: false, // If false ignore safe-mode, if true load './.env.example', if a string load that file as the sample
systemvars: false, // Set to true if you would rather load all system variables as well (useful for CI purposes)
silent: false, // If true, all warnings will be suppressed
expand: false, // Allows your variables to be "expanded" for reusability within your .env file
defaults: false, // Adds support for dotenv-defaults. If set to true, uses ./.env.defaults
},
plugins: [
'docusaurus-plugin-sass',
[
"docusaurus2-dotenv",
{
path: "./.env", // The path to your environment variables.
safe: false, // If false ignore safe-mode, if true load './.env.example', if a string load that file as the sample
systemvars: false, // Set to true if you would rather load all system variables as well (useful for CI purposes)
silent: false, // If true, all warnings will be suppressed
expand: false, // Allows your variables to be "expanded" for reusability within your .env file
defaults: false, // Adds support for dotenv-defaults. If set to true, uses ./.env.defaults
},
],
],
],
})
}
}
Loading