Skip to content

Migrate docs to docusaurus #653

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

Merged
merged 30 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
909208b
add docusaurus
acolytec3 May 14, 2025
19ac475
update deploy scripts
acolytec3 May 14, 2025
5b0c81b
clean up stuff
acolytec3 May 14, 2025
6e0dc69
update action
acolytec3 May 14, 2025
f272141
workflow dispatch trigger
acolytec3 May 14, 2025
406f4eb
build against main
acolytec3 May 14, 2025
9eef24a
Merge remote-tracking branch 'upstream/main' into docusaurus
acolytec3 May 14, 2025
54c3163
Merge pull request #1 from acolytec3/docusaurus
acolytec3 May 14, 2025
6bb9628
push build to correct place
acolytec3 May 14, 2025
b3a20fc
use correct working directory
acolytec3 May 14, 2025
1612d44
fix references
acolytec3 May 14, 2025
e15e33e
update build artifact path in deploy workflow
acolytec3 May 14, 2025
4557be6
consolidate in base dir
acolytec3 May 14, 2025
caf5990
more cleanup
acolytec3 May 14, 2025
8b0a015
add test deploy ci
acolytec3 May 14, 2025
1d5d76a
add workflow_dispatch
acolytec3 May 14, 2025
0f036d9
fix deploy script
acolytec3 May 14, 2025
55d1bda
build specs and website
acolytec3 May 14, 2025
fb9286f
don't throw on broken links
acolytec3 May 14, 2025
e4a3ddd
update baseUrl
acolytec3 May 14, 2025
929cd81
make ESM/CJS stuff play nice
acolytec3 May 15, 2025
4719822
clean up links and docusaurus references
acolytec3 May 15, 2025
0608537
more link cleanup
acolytec3 May 15, 2025
87e206e
update links to point to ethereum
acolytec3 May 15, 2025
b63f4c4
remove docu boilerplate
acolytec3 May 15, 2025
13b1f6e
build docs too
acolytec3 May 15, 2025
5e218ea
Update docs/reference/intro.md
acolytec3 May 15, 2025
b5fff3b
Update docusaurus.config.ts
acolytec3 May 15, 2025
4331158
remove old deployment job
acolytec3 May 15, 2025
2325067
remove gatsby
lightclient May 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 39 additions & 45 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,59 +1,53 @@
name: Deploy specification
name: Deploy to GitHub Pages

on:
push:
branches:
- main

env:
# this avoids node running out of memory while building
NODE_OPTIONS: --max_old_space_size=20480
workflow_dispatch:

jobs:
deploy-spec:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 15
uses: actions/setup-node@v1
- uses: actions/checkout@v4
with:
node-version: '15'
- run: npm ci
- run: npm run build
- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Deploy assembled spec
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm install --frozen-lockfile

- name: Build specs and website
run: |
git checkout -b assembled-spec
git add -f openrpc.json
git add -f refs-openrpc.json
git commit -m "assemble openrpc.json"
git push -fu origin assembled-spec
deploy-gh-pages:
npm run build
npm run build:docs

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 15
uses: actions/setup-node@v1
with:
node-version: '15'
- run: npm ci
- run: npm run build
- run: npm run generate-clients
- run: 'sed -i -e "s|Prefix: \"\"|Prefix: \"/execution-apis\"|g" build/docs/gatsby/gatsby-config.js'
- run: 'sed -i -e "s|/api|api|g" build/docs/gatsby/src/pages/index.tsx'
- run: npm run build:docs
- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: build/docs/gatsby/public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: deployment
uses: actions/deploy-pages@v4
29 changes: 29 additions & 0 deletions .github/workflows/test-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test deployment

on:
pull_request:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
workflow_dispatch:

jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm install --frozen-lockfile
- name: Test build website
run: |
npm run build
npm run build:docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ data.json
schema.json
*.dic
.idea/
.docusaurus
Empty file added .nojekyll
Empty file.
30 changes: 30 additions & 0 deletions css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/

/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #2e8555;
--ifm-color-primary-dark: #29784c;
--ifm-color-primary-darker: #277148;
--ifm-color-primary-darkest: #205d3b;
--ifm-color-primary-light: #33925d;
--ifm-color-primary-lighter: #359962;
--ifm-color-primary-lightest: #3cad6e;
--ifm-code-font-size: 95%;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme='dark'] {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: #21af90;
--ifm-color-primary-darker: #1fa588;
--ifm-color-primary-darkest: #1a8870;
--ifm-color-primary-light: #29d5b0;
--ifm-color-primary-lighter: #32d8b4;
--ifm-color-primary-lightest: #4fddbf;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}
43 changes: 43 additions & 0 deletions docs/reference/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
slug: /
sidebar_position: 1
---

# Introduction

Welcome to the Ethereum JSON-RPC documentation. This site provides comprehensive information about the JSON-RPC APIs provided by Ethereum execution clients.

## What are Execution APIs?

Execution APIs are the set of JSON-RPC endpoints that allow applications to interact with Ethereum nodes. These APIs enable developers to:

- Query blockchain data
- Send transactions
- Interact with smart contracts
- Monitor network status
- And much more

## Getting Started

To get started with the Execution APIs:

1. Choose an Ethereum client implementation
2. Set up your development environment
3. Connect to an Ethereum node
4. Start making JSON-RPC calls

## API Categories

The Execution APIs are organized into several categories:

- Core APIs
- Account APIs
- Network APIs
- Debug APIs
- Trace APIs

Each category serves specific purposes and provides different functionalities for interacting with the Ethereum network.

## Contributing

We welcome contributions to improve this documentation. Please see our [Making Changes](/reference/making-changes) guide for more information on how to contribute.
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ others don't.

[exec-apis]: https://github.com/ethereum/execution-apis
[pm]: https://github.com/ethereum/pm
[test-gen]: ../tests/README.md
[test-gen]: https://github.com/ethereum/execution-apis/blob/main/tests/README.md
103 changes: 103 additions & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@metamask/docusaurus-openrpc/dist/preset';

// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)

const config: Config = {
title: 'Ethereum Execution APIs',
tagline: 'A JSON-RPC specification for Ethereum execution clients',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://ethereum.github.io',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/execution-apis/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'ethereum', // Usually your GitHub org/user name.
projectName: 'execution-apis', // Usually your repo name.
deploymentBranch: 'gh-pages',

onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'@metamask/docusaurus-openrpc/dist/preset',
/** @type {import('@metamask/docusaurus-openrpc/dist/preset').Options} */
{
docs: {
routeBasePath: '/',
openrpc: {
openrpcDocument: './refs-openrpc.json',
path: 'reference',
sidebarLabel: 'JSON-RPC',
},
sidebarPath: './sidebars.ts',
path: './docs',
},
blog: false,
theme: {
customCss: './css/custom.css',
},
} satisfies Preset.Options,
],
],

themeConfig: {
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'Execution APIs',
// logo: {
// alt: 'My Site Logo',
// src: 'img/logo.svg',
// },
items: [
{
type: 'docSidebar',
sidebarId: 'referenceSidebar',
position: 'left',
label: 'API Reference',
},
{
href: 'https://github.com/ethereum/execution-apis',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'More',
items: [
{
label: 'GitHub',
href: 'https://github.com/ethereum/execution-apis',
},
],
},
],
copyright: `Copyright and related rights waived via CC0.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,
};

export default config;
Loading