Skip to content

Commit 54c3163

Browse files
authored
Merge pull request #1 from acolytec3/docusaurus
Docusaurus
2 parents 15399c2 + 9eef24a commit 54c3163

25 files changed

+23567
-45
lines changed

.github/workflows/deploy.yaml

Lines changed: 40 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,54 @@
1-
name: Deploy specification
1+
name: Deploy to GitHub Pages
22

33
on:
44
push:
55
branches:
66
- main
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
workflow_dispatch:
710

811
env:
9-
# this avoids node running out of memory while building
10-
NODE_OPTIONS: --max_old_space_size=20480
11-
12+
cwd: ${{github.workspace}}/site
1213
jobs:
13-
deploy-spec:
14+
build:
15+
name: Build Docusaurus
1416
runs-on: ubuntu-latest
1517
steps:
16-
- uses: actions/checkout@v2
17-
- name: Use Node.js 15
18-
uses: actions/setup-node@v1
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: npm
25+
26+
- name: Install dependencies
27+
run: npm install --frozen-lockfile
28+
- name: Build website
29+
run: npm run build
30+
31+
- name: Upload Build Artifact
32+
uses: actions/upload-pages-artifact@v3
1933
with:
20-
node-version: '15'
21-
- run: npm ci
22-
- run: npm run build
23-
- name: setup git config
24-
run: |
25-
git config user.name "GitHub Actions Bot"
26-
git config user.email "<>"
27-
- name: Deploy assembled spec
28-
run: |
29-
git checkout -b assembled-spec
30-
git add -f openrpc.json
31-
git add -f refs-openrpc.json
32-
git commit -m "assemble openrpc.json"
33-
git push -fu origin assembled-spec
34-
deploy-gh-pages:
34+
path: build
35+
36+
deploy:
37+
name: Deploy to GitHub Pages
38+
needs: build
39+
40+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
41+
permissions:
42+
pages: write # to deploy to Pages
43+
id-token: write # to verify the deployment originates from an appropriate source
44+
45+
# Deploy to the github-pages environment
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
3550
runs-on: ubuntu-latest
3651
steps:
37-
- uses: actions/checkout@v2
38-
- name: Use Node.js 15
39-
uses: actions/setup-node@v1
40-
with:
41-
node-version: '15'
42-
- run: npm ci
43-
- run: npm run build
44-
- run: npm run generate-clients
45-
- run: 'sed -i -e "s|Prefix: \"\"|Prefix: \"/execution-apis\"|g" build/docs/gatsby/gatsby-config.js'
46-
- run: 'sed -i -e "s|/api|api|g" build/docs/gatsby/src/pages/index.tsx'
47-
- run: npm run build:docs
48-
- name: setup git config
49-
run: |
50-
git config user.name "GitHub Actions Bot"
51-
git config user.email "<>"
5252
- name: Deploy to GitHub Pages
53-
if: success()
54-
uses: crazy-max/ghaction-github-pages@v3
55-
with:
56-
target_branch: gh-pages
57-
build_dir: build/docs/gatsby/public
58-
env:
59-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
id: deployment
54+
uses: actions/deploy-pages@v4

.github/workflows/deploy.yaml.old

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy specification
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
# this avoids node running out of memory while building
10+
NODE_OPTIONS: --max_old_space_size=20480
11+
12+
jobs:
13+
deploy-spec:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Use Node.js 15
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: '15'
21+
- run: npm ci
22+
- run: npm run build
23+
- name: setup git config
24+
run: |
25+
git config user.name "GitHub Actions Bot"
26+
git config user.email "<>"
27+
- name: Deploy assembled spec
28+
run: |
29+
git checkout -b assembled-spec
30+
git add -f openrpc.json
31+
git add -f refs-openrpc.json
32+
git commit -m "assemble openrpc.json"
33+
git push -fu origin assembled-spec
34+
deploy-gh-pages:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- name: Use Node.js 15
39+
uses: actions/setup-node@v1
40+
with:
41+
node-version: '15'
42+
- run: npm ci
43+
- run: npm run build
44+
- run: npm run generate-clients
45+
- run: 'sed -i -e "s|Prefix: \"\"|Prefix: \"/execution-apis\"|g" build/docs/gatsby/gatsby-config.js'
46+
- run: 'sed -i -e "s|/api|api|g" build/docs/gatsby/src/pages/index.tsx'
47+
- run: npm run build:docs
48+
- name: setup git config
49+
run: |
50+
git config user.name "GitHub Actions Bot"
51+
git config user.email "<>"
52+
- name: Deploy to GitHub Pages
53+
if: success()
54+
uses: crazy-max/ghaction-github-pages@v3
55+
with:
56+
target_branch: gh-pages
57+
build_dir: build/docs/gatsby/public
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

site/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

site/.nojekyll

Whitespace-only changes.

site/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
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.

site/docs/reference/intro.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
slug: /
3+
sidebar_position: 1
4+
---
5+
6+
# Introduction
7+
8+
Welcome to the Ethereum Execution APIs documentation. This documentation provides comprehensive information about the JSON-RPC APIs provided by Ethereum 1.0 clients.
9+
10+
## What are Execution APIs?
11+
12+
Execution APIs are the set of JSON-RPC endpoints that allow applications to interact with Ethereum nodes. These APIs enable developers to:
13+
14+
- Query blockchain data
15+
- Send transactions
16+
- Interact with smart contracts
17+
- Monitor network status
18+
- And much more
19+
20+
## Getting Started
21+
22+
To get started with the Execution APIs:
23+
24+
1. Choose an Ethereum client implementation
25+
2. Set up your development environment
26+
3. Connect to an Ethereum node
27+
4. Start making JSON-RPC calls
28+
29+
## API Categories
30+
31+
The Execution APIs are organized into several categories:
32+
33+
- Core APIs
34+
- Account APIs
35+
- Network APIs
36+
- Debug APIs
37+
- Trace APIs
38+
39+
Each category serves specific purposes and provides different functionalities for interacting with the Ethereum network.
40+
41+
## Contributing
42+
43+
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.

site/docusaurus.config.ts

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import { themes as prismThemes } from 'prism-react-renderer';
2+
import type { Config } from '@docusaurus/types';
3+
import type * as Preset from '@metamask/docusaurus-openrpc/dist/preset';
4+
5+
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
6+
7+
const config: Config = {
8+
title: 'My Site',
9+
tagline: 'Dinosaurs are cool',
10+
favicon: 'img/favicon.ico',
11+
12+
// Set the production url of your site here
13+
url: 'https://your-docusaurus-site.example.com',
14+
// Set the /<baseUrl>/ pathname under which your site is served
15+
// For GitHub pages deployment, it is often '/<projectName>/'
16+
baseUrl: '/',
17+
18+
// GitHub pages deployment config.
19+
// If you aren't using GitHub pages, you don't need these.
20+
organizationName: 'acolytec3', // Usually your GitHub org/user name.
21+
projectName: 'execution-apis', // Usually your repo name.
22+
deploymentBranch: 'gh-pages',
23+
24+
onBrokenLinks: 'throw',
25+
onBrokenMarkdownLinks: 'warn',
26+
27+
// Even if you don't use internationalization, you can use this field to set
28+
// useful metadata like html lang. For example, if your site is Chinese, you
29+
// may want to replace "en" with "zh-Hans".
30+
i18n: {
31+
defaultLocale: 'en',
32+
locales: ['en'],
33+
},
34+
35+
presets: [
36+
[
37+
'@metamask/docusaurus-openrpc/dist/preset',
38+
/** @type {import('@metamask/docusaurus-openrpc/dist/preset').Options} */
39+
{
40+
docs: {
41+
routeBasePath: '/',
42+
openrpc: {
43+
openrpcDocument: '../refs-openrpc.json',
44+
path: 'Reference',
45+
sidebarLabel: 'JSON-RPC',
46+
},
47+
48+
sidebarPath: './sidebars.ts',
49+
// Please change this to your repo.
50+
// Remove this to remove the "edit this page" links.
51+
editUrl:
52+
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
53+
},
54+
blog: false,
55+
theme: {
56+
customCss: './src/css/custom.css',
57+
},
58+
} satisfies Preset.Options,
59+
],
60+
],
61+
62+
themeConfig: {
63+
// Replace with your project's social card
64+
image: 'img/docusaurus-social-card.jpg',
65+
navbar: {
66+
title: 'Execution APIs',
67+
logo: {
68+
alt: 'My Site Logo',
69+
src: 'img/logo.svg',
70+
},
71+
items: [
72+
{
73+
type: 'docSidebar',
74+
sidebarId: 'referenceSidebar',
75+
position: 'left',
76+
label: 'API Reference',
77+
},
78+
{
79+
href: 'https://github.com/facebook/docusaurus',
80+
label: 'GitHub',
81+
position: 'right',
82+
},
83+
],
84+
},
85+
footer: {
86+
style: 'dark',
87+
links: [
88+
{
89+
title: 'Docs',
90+
items: [
91+
{
92+
label: 'Tutorial',
93+
to: '/docs/intro',
94+
},
95+
],
96+
},
97+
{
98+
title: 'More',
99+
items: [
100+
{
101+
label: 'GitHub',
102+
href: 'https://github.com/facebook/docusaurus',
103+
},
104+
],
105+
},
106+
],
107+
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
108+
},
109+
prism: {
110+
theme: prismThemes.github,
111+
darkTheme: prismThemes.dracula,
112+
},
113+
} satisfies Preset.ThemeConfig,
114+
};
115+
116+
export default config;

0 commit comments

Comments
 (0)