Skip to content

Commit

Permalink
Merge pull request #58 from papermoonio/dev
Browse files Browse the repository at this point in the history
Add Pauline to CodeOwners and script to autogenerate chain info
  • Loading branch information
albertov19 authored Sep 25, 2024
2 parents 7f716b2 + 6f11dee commit 958ce94
Show file tree
Hide file tree
Showing 68 changed files with 12,017 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
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

0 comments on commit 958ce94

Please sign in to comment.