-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from celestiaorg/sevey/specs
- Loading branch information
Showing
15 changed files
with
602 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 |
Empty file.
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 @@ | ||
# go-header 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 = ["Celestia Labs"] | ||
language = "en" | ||
multilingual = false | ||
src = "src" | ||
title = "go-header Specifications" | ||
|
||
[output.html] | ||
git-repository-url = "https://github.com/celestiaorg/go-header" | ||
|
||
[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 go-header 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,8 @@ | ||
# Summary | ||
|
||
[Introduction](README.md) | ||
|
||
- [Template](./specs/template.md) | ||
- [P2P](./specs/p2p.md) | ||
- [Store](./specs/store.md) | ||
- [Sync](./specs/sync.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 @@ | ||
../../../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 @@ | ||
../../../sync/sync.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 |
Oops, something went wrong.