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

Add Pauline to CodeOwners and script to autogenerate chain info #58

Merged
merged 2 commits into from
Sep 25, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@evgeniko
@evgeniko @PaulineAnnBar
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
venv
.DS_Store
scripts/node_modules
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ theme:
admonition:
note: octicons/pencil-16
warning: octicons/alert-16
validation:
absolute_links: ignore
unrecognized_links: ignore
markdown_extensions:
- abbr
- admonition
Expand Down
41 changes: 41 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Scripts for Autogenerating Content

The scripts in this directory automate the generation and insertion of blockchain-specific content into documentation files. The content that gets automatically generated is as follows:

- The supported chains
- The Wormhole chain ID table
- Each of the contract addresses tables
- The finality/consistency level table

## Understand How the Scripts Work

The scripts perform two major actions:

1. **Generates chain data** - using the Wormhole SDK, the scripts collect details about the supported chains and then create formatted tables based off of this chain data
2. **Inserts generated content** - it finds specific <!--tag--> comments in the documentation files and replaces the content between these tags with the newly generated HTML, markdown, or data tables. The script looks specifically in the `.snippets/text` directory for these tags. So please make sure that if you're expanding upon the scripts' capabilities, you store any new tags in the text snippets directory

This process ensures that documentation stays up to date with minimal manual intervention by dynamically generating and injecting relevant data.

## Generate Updated Content: Run the Scripts

Before you can generate the content, you'll need to ensure you have the [`wormhole-docs` repository](https://github.com/wormhole-foundation/wormhole-docs) nested inside of the `wormhole-mkdocs` repository.

Next, you'll need to change directories to the `scripts` directory and install the dependencies:

```sh
cd scripts && npm i
```

To generate the content, run the following command:

```sh
npm run generate
```

Now, you should be able to check out the changes made in the `wormhole-docs` repository and open a PR with these changes.

## Update Chain Configurations

To update chain configurations, such as chain IDs, finality levels, explorers, faucets, and more, you'll need to modify the JSON chain file in the `scripts/src/chains/` directory. There should be a chain file for each of the supported chains.

The information from the chain files gets pulled into the blockchain environment pages found under Build > Start Building > Supported Networks. Additionally, the `title` parameter in the chain file is used in the Supported Networks page and the Reference section pages. If you modify the `title`, please make sure it is in human-readable format, with proper spacing between words.
Loading