forked from rollkit/rollkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: init mdbooks for specs site with place holder files (rollkit#1199)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. --> ## Overview <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. --> This PR adds [mdbook](https://rust-lang.github.io/mdBook/guide/installation.html) for hosting the specs site. A workflow was added to deploy the specs site to github pages. ## Checklist <!-- Please complete the checklist to ensure that the PR is ready to be reviewed. IMPORTANT: PRs should be left in Draft until the below checklist is completed. --> - [ ] New and updated code has appropriate documentation - [ ] New and updated code has new and/or updated testing - [ ] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [ ] Linked issues closed with keywords --------- Co-authored-by: nashqueue <[email protected]>
- Loading branch information
Showing
23 changed files
with
170 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Specs Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- specs/** | ||
pull_request: | ||
paths: | ||
- specs/** | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup mdBook | ||
uses: peaceiris/actions-mdbook@v1 | ||
with: | ||
mdbook-version: "0.4.21" | ||
|
||
- name: Build book | ||
run: mdbook build specs | ||
|
||
- name: Deploy main | ||
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./specs/book | ||
# keep_files is to prevent PR preview files from being overwritten. | ||
# If we need to overwrite such files, trigger this workflow manually. | ||
keep_files: ${{ github.event_name != 'workflow_dispatch' }} | ||
|
||
- name: Deploy PR preview | ||
# Only run this job if the PR was created from a branch on | ||
# rollkit/rollkit because this job will fail for branches from forks. | ||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | ||
uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
source-dir: ./specs/book |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ proto/pb | |
proto/tendermint | ||
types/pb/tendermint | ||
.vscode/launch.json | ||
*/**.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# DA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Mempool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# P2P |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
book |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Rollkit Specifications | ||
|
||
## Building From Source | ||
|
||
Install [mdbook](https://rust-lang.github.io/mdBook/guide/installation.html) and [mdbook-toc](https://github.com/badboy/mdbook-toc): | ||
|
||
```sh | ||
cargo install mdbook | ||
cargo install mdbook-toc | ||
``` | ||
|
||
To build book: | ||
|
||
```sh | ||
mdbook build | ||
``` | ||
|
||
To serve locally: | ||
|
||
```sh | ||
mdbook serve | ||
``` | ||
|
||
## Contributing | ||
|
||
Specifications are written and stored in the same directory with the implementation code. Since `mdbook` does not support referencing files outside of the book directory, we use a symlink to the `src/specs` directory. This allows us to reference the specifications from the `README.md` and `SUMMARY.md` files in the `src` directory. | ||
|
||
To create a symlink: | ||
|
||
```sh | ||
cd src/specs | ||
ln -s path/to/spec.md | ||
``` | ||
|
||
Markdown files must conform to [GitHub Flavored Markdown](https://github.github.com/gfm/). Markdown must be formatted with: | ||
|
||
- [markdownlint](https://github.com/DavidAnson/markdownlint) | ||
- [Markdown Table Prettifier](https://github.com/darkriszty/MarkdownTablePrettify-VSCodeExt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[book] | ||
authors = ["Rollkit"] | ||
language = "en" | ||
multilingual = false | ||
src = "src" | ||
title = "Rollkit Specifications" | ||
|
||
[output.html] | ||
git-repository-url = "https://github.com/rollkit/rollkit" | ||
|
||
[rust] | ||
edition = "2021" | ||
|
||
[preprocessor.toc] | ||
command = "mdbook-toc" | ||
renderer = ["html"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Welcome | ||
|
||
Welcome to the Rollkit Specifications. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Summary | ||
|
||
[Introduction](README.md) | ||
|
||
- [Template](./specs/template.md) | ||
- [Block](./specs/block.md) | ||
- [DA](./specs/da.md) | ||
- [Mempool](./specs/mempool.md) | ||
- [Node](./specs/node.md) | ||
- [P2P](./specs/p2p.md) | ||
- [State](./specs/state.md) | ||
- [Store](./specs/store.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../block/block.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../da/da.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../mempool/mempool.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../node/node.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../p2p/p2p.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../state/state.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../store/store.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../template.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Protocol/Component Name | ||
|
||
## Abstract | ||
|
||
Provide a concise description of the purpose of the component for which the | ||
specification is written, along with its contribution to the rollkit or | ||
other relevant parts of the system. Make sure to include proper references to | ||
the relevant sections. | ||
|
||
## Protocol/Component Description | ||
|
||
Offer a comprehensive explanation of the protocol, covering aspects such as data | ||
flow, communication mechanisms, and any other details necessary for | ||
understanding the inner workings of this component. | ||
|
||
## Message Structure/Communication Format | ||
|
||
If this particular component is expected to communicate over the network, | ||
outline the structure of the message protocol, including details such as field | ||
interpretation, message format, and any other relevant information. | ||
|
||
## Assumptions and Considerations | ||
|
||
If there are any assumptions required for the component's correct operation, | ||
performance, security, or other expected features, outline them here. | ||
Additionally, provide any relevant considerations related to security or other | ||
concerns. | ||
|
||
## Implementation | ||
|
||
Include a link to the location where the implementation of this protocol can be | ||
found. Note that specific implementation details should be documented in the | ||
rollkit repository rather than in the specification document. | ||
|
||
## References | ||
|
||
List any references used or cited in the document. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# State |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Store |