Skip to content

Switch to docusaurus #652

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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
85 changes: 40 additions & 45 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,59 +1,54 @@
name: Deploy specification
name: Deploy to GitHub Pages

on:
push:
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:

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

cwd: ${{github.workspace}}/site
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:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm install --frozen-lockfile
- name: Build website
run: npm run build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
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
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:
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
59 changes: 59 additions & 0 deletions .github/workflows/deploy.yaml.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy specification

on:
push:
branches:
- main

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

jobs:
deploy-spec:
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
- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Deploy assembled spec
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:
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 }}
20 changes: 20 additions & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Empty file added site/.nojekyll
Empty file.
41 changes: 41 additions & 0 deletions site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
43 changes: 43 additions & 0 deletions site/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 Execution APIs documentation. This documentation provides comprehensive information about the JSON-RPC APIs provided by Ethereum 1.0 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](/docs/making-changes) guide for more information on how to contribute.
File renamed without changes.
116 changes: 116 additions & 0 deletions site/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
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: 'My Site',
tagline: 'Dinosaurs are cool',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://your-docusaurus-site.example.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',

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

onBrokenLinks: 'throw',
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',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
blog: false,
theme: {
customCss: './src/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/facebook/docusaurus',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Tutorial',
to: '/docs/intro',
},
],
},
{
title: 'More',
items: [
{
label: 'GitHub',
href: 'https://github.com/facebook/docusaurus',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,
};

export default config;
Loading