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

Decouple link checking from mdbook #287

Merged
merged 33 commits into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7448430
Add new linkcheck ci
JoshOrndorff Jun 4, 2020
1cd665e
strip old link checker
JoshOrndorff Jun 4, 2020
5184342
Remove broken and outdated link
JoshOrndorff Jun 5, 2020
9bb02fc
Don't check links to github code.
JoshOrndorff Jun 5, 2020
c8c91ce
remove crate.io link because they always come back 404 in linkcheck
JoshOrndorff Jun 5, 2020
c7b285e
Fix realative link in ocw writeup
JoshOrndorff Jun 5, 2020
501ceef
fix more ocw links
JoshOrndorff Jun 5, 2020
7aeffcd
another ocw relative link
JoshOrndorff Jun 5, 2020
5d2a28f
html -> md to fix link
JoshOrndorff Jun 5, 2020
68e8679
don't check link that actually works but appears broken to checker :s…
JoshOrndorff Jun 5, 2020
272f02d
prune fuzzing draft that was had little content and a broken link
JoshOrndorff Jun 5, 2020
34693fe
prune maps draft
JoshOrndorff Jun 5, 2020
ebe659d
clean links in optimization draft
JoshOrndorff Jun 5, 2020
c0f2356
work around broken link in potentially useful draft
JoshOrndorff Jun 5, 2020
2640900
fix draft link
JoshOrndorff Jun 5, 2020
fe65a7a
prune declarative syntax draft
JoshOrndorff Jun 5, 2020
7d04ab7
html -> md
JoshOrndorff Jun 5, 2020
a57bcca
clean readme links
JoshOrndorff Jun 5, 2020
28ec162
try quiet mode
JoshOrndorff Jun 5, 2020
bc91254
WIP
JoshOrndorff Jun 5, 2020
c0482ca
WIP
JoshOrndorff Jun 5, 2020
8e543fb
html -> md
JoshOrndorff Jun 5, 2020
b07b54b
fix ocw link
JoshOrndorff Jun 5, 2020
aca0ad6
try enabling config file
JoshOrndorff Jun 5, 2020
d87a476
disable config file
JoshOrndorff Jun 5, 2020
d8ede1f
try quiet mode again
JoshOrndorff Jun 8, 2020
5759386
try again with config file
JoshOrndorff Jun 8, 2020
7afb0d5
fix typo in config file (I dont expect this will solve the issue with…
JoshOrndorff Jun 8, 2020
9854c9f
Revert addition on individual ignore comments
JoshOrndorff Jun 8, 2020
93bf6e5
https for ignore patterns
JoshOrndorff Jun 8, 2020
51f8a24
try other path to config file
JoshOrndorff Jun 8, 2020
80923e2
Introduce a broken link just to be double sure
JoshOrndorff Jun 8, 2020
81f49b4
Revert "Introduce a broken link just to be double sure"
JoshOrndorff Jun 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/build-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,5 @@ jobs:
mdbook-version: '0.3.7'
# mdbook-version: 'latest'

- name: Install mdbook-linkcheck
run: |
curl -LSfs https://japaric.github.io/trust/install.sh | \
bash -s -- --git Michael-F-Bryan/mdbook-linkcheck

- name: Build Book
run: mdbook build
5 changes: 0 additions & 5 deletions .github/workflows/build-deploy-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ jobs:
mdbook-version: '0.3.5'
# mdbook-version: 'latest'

- name: Install mdbook-linkcheck
run: |
curl -LSfs https://japaric.github.io/trust/install.sh | \
bash -s -- --git Michael-F-Bryan/mdbook-linkcheck

- name: Build Book
run: mdbook build

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Links

on:
pull_request:
branches:
- master
- develop
push:
branches:
- master
- develop

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
config-file: '.github/workflows/mlc_config.json'
10 changes: 10 additions & 0 deletions .github/workflows/mlc_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ignorePatterns": [
{
"pattern": "^https://crates.io"
},
{
"pattern": "^https://github.com/substrate-developer-hub/recipes/tree/master"
}
]
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# <a href="https://substrate.dev/recipes">Substrate Recipes</a> 🍴😋🍴

![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fsubstrate-developer-hub%2Frecipes%2Fbadge%3Fref%3Dmaster&style=flat)
<!-- markdown-link-check-disable-next-line -->
![Lines of Code](https://tokei.rs/b1/github/substrate-developer-hub/recipes)

_A Hands-On Cookbook for Aspiring Blockchain Chefs_
Expand All @@ -21,7 +22,7 @@ There are five primary directories in this repository:
- **Consensus**: Consensus engines for use in Substrate nodes.
- **Nodes**: Complete Substrate nodes ready to run.

The book is built with [mdbook](https://rust-lang-nursery.github.io/mdBook/) and deployed via
The book is built with [mdbook](https://github.com/rust-lang/mdBook) and deployed via
[github pages](https://pages.github.com/).

## License
Expand Down
2 changes: 0 additions & 2 deletions pallets/execution-schedule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@ pub struct Task<BlockNumber> {
expected_execution: BlockNumber,
}
```

I wrote more about this [here](../../../../src/testing/schedule.md).
2 changes: 1 addition & 1 deletion text/2-appetizers/2-storage-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ about this value much, and it is fine to use the name of the pallet itself.

This pallet has two storage items, both of which are single storage values. Substrate's storage API
also supports more complex storage types which are
[covered in the entrees](../3-entrees/storage-api/index.html). The fundamentals for all types are
[covered in the entrees](../3-entrees/storage-api/index.md). The fundamentals for all types are
the same.

Our first storage item is a `u32` value which is declared with this syntax
Expand Down
6 changes: 3 additions & 3 deletions text/3-entrees/off-chain-workers/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ Off-chain workers are asynchronously run during block import. Since ocws are not
they run, at any single instance there could be multiple ocws running, being initiated by previous
block imports. See diagram below.

![More than one off-chain workers at a single instance](/img/multiple-ocws.png)
![More than one off-chain workers at a single instance](../../img/multiple-ocws.png)

The storage has a similar API usage as on-chain
[`StorageValue`](/2-appetizers/2-storage-values.html) with `get`, `set`, and `mutate`. `mutate` is
[`StorageValue`](../../2-appetizers/2-storage-values.md) with `get`, `set`, and `mutate`. `mutate` is
using a [`compare-and-set`](https://en.wikipedia.org/wiki/Compare-and-swap) pattern. It compares the
contents of a memory location with a given value and, only if they are the same, modifies the
contents of that memory location to a new given value. This is done as a single atomic operation.
The atomicity guarantees that the new value is calculated based on up-to-date information; if the
value had been updated by another thread in the meantime, the write would fail.

In this recipe, we will add a cache and lock over our previous
[http fetching example](./http-json.html). If the cached value existed, we will return using the
[http fetching example](./http-json.md). If the cached value existed, we will return using the
cached value. Otherwise we acquire the lock and then fetch from github public API and save it to the
cache.

Expand Down
2 changes: 1 addition & 1 deletion text/3-entrees/off-chain-workers/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,4 +368,4 @@ As in signed transactions, we prepare a function reference with its parameters a
## Testing

For writing test cases for off-chain worker, refer to our
[testing section](/3-entrees/testing/off-chain-workers.md).
[testing section](../testing/off-chain-workers.md).
1 change: 1 addition & 0 deletions text/3-entrees/randomness.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,6 @@ these randomness sources. If you'd like to get into the research, here are some

- [https://github.com/paritytech/ink/issues/57](https://github.com/paritytech/ink/issues/57)
- [https://wiki.polkadot.network/docs/en/learn-randomness](https://wiki.polkadot.network/docs/en/learn-randomness)
<!-- markdown-link-check-disable-next-line -->
- [http://www.cse.huji.ac.il/~nati/PAPERS/coll_coin_fl.pdf](http://www.cse.huji.ac.il/~nati/PAPERS/coll_coin_fl.pdf)
- [https://eccc.weizmann.ac.il/report/2018/140/](https://eccc.weizmann.ac.il/report/2018/140/)
6 changes: 2 additions & 4 deletions text/3-entrees/storage-api/ringbuffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,8 @@ oldest item in the queue if a new item is pushed into a full queue by incrementi
> The ringbuffer should be agnostic to the concrete `Index` type used. In order to decrement and
> increment the start and end index, though, any concrete type needs to implement `wrapping_add` and
> `wrapping_sub`. Because `std` does not provide such a trait, we need another way to require this
> behavior. One possbility would be using the
> [`num_traits` crate](https://crates.io/crates/num-traits), but to keep things simple here we just
> implement our own trait `WrappingOps` for the types we want to support (`u8`, `u16`, `u32` and
> `u64`).
> behavior. We just implement our own trait `WrappingOps` for the types we
> want to support (`u8`, `u16`, `u32` and `u64`).

The last function we implement is `pop`:

Expand Down
2 changes: 1 addition & 1 deletion text/3-entrees/testing/mock.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mock Runtime for Unit Testing

_See [Testing](./index.html) page for list of kitchen pallets with unit test coverage._
_See [Testing](./index.md) page for list of kitchen pallets with unit test coverage._

There are two main patterns on writing tests for pallets. We can put the tests:

Expand Down
2 changes: 1 addition & 1 deletion text/3-entrees/testing/off-chain-workers.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Off-chain Worker Test Environment

Learn more about how to set up and use offchain-workers in the
[offchain-demo entree](/3-entrees/off-chain-workers/index.md).
[offchain-demo entree](../off-chain-workers/index.md).

## Mock Runtime Setup

Expand Down
2 changes: 1 addition & 1 deletion text/drafts/chainspec.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Minimal Blockchain Configuration

[Substate Node](https://github.com/paritytech/substrate/tree/master/node) is Substrate's pre-baked
[Substate Node](https://github.com/paritytech/substrate/tree/master/bin/node) is Substrate's pre-baked
blockchain client. By creating and modifying a Substrate Node chain specification file, it is easy
to configure a new chain and launch a corresponding testnet.

Expand Down
31 changes: 0 additions & 31 deletions text/drafts/declarative-syntax.md

This file was deleted.

2 changes: 1 addition & 1 deletion text/drafts/ensure.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ storage changes.** This is similar to
[`require()`](https://ethereum.stackexchange.com/questions/15166/difference-between-require-and-assert-and-the-difference-between-revert-and-thro)
checks at the top of function bodies in Solidity contracts.

In the [set storage and iteration](../storage/iterate.md), a vector was stored in the runtime to
In the set storage and iteration recipe, a vector was stored in the runtime to
allow for simple membership checks for methods only available to members.

```rust, ignore
Expand Down
13 changes: 0 additions & 13 deletions text/drafts/fuzzing.md

This file was deleted.

61 changes: 0 additions & 61 deletions text/drafts/maps.md

This file was deleted.

6 changes: 2 additions & 4 deletions text/drafts/optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ to._ - [src](http://wiki.c2.com/?PrematureOptimization)

**Rust API Guidelines**

<!-- markdown-link-check-disable-next-line -->
- [Official Rust API Guidelines](https://rust-lang-nursery.github.io/api-guidelines/about.html)
- [Rust Unofficial Design Patterns](https://github.com/rust-unofficial/patterns)
- [Elegant Library API Guidelines](https://deterministic.space/elegant-apis-in-rust.html) by
Expand All @@ -56,10 +57,8 @@ We call an algorithm _efficient_ if its running time is polynomial in the size o
_highly efficient_ if its running time is linear in the size of the input. It is important for all
on-chain algorithms to be highly efficient, because they must scale linearly as the size of the
Polkadot network grows. In contrast, off-chain algorithms are only required to be efficient. -
[Web3 Research](http://research.web3.foundation/en/latest/polkadot/NPoS/1.intro/)
[Web3 Research](https://research.web3.foundation/en/latest/polkadot/NPoS/)

_See [Substrate Best Practices](https://substrate.dev/docs/en/tutorials/tcr/) for more details on
how efficiency influences the runtime's economic security._

**Related Reading**

Expand Down Expand Up @@ -152,7 +151,6 @@ To dive deeper down these 🐰 holes

- [RustLatam 2019 - Without Boats: Zero-Cost Async IO](https://www.youtube.com/watch?v=skos4B5x7qE)
- [Introduction to Async/Await Programming (withoutboats/wakers-i):](https://boats.gitlab.io/blog/post/wakers-i/)
- [Futures (by Aaron Turon)](http://aturon.github.io/2016/08/11/futures/)

**Projects**

Expand Down