Skip to content

Commit

Permalink
fix(tooling): make links match headings (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias authored Oct 21, 2020
1 parent 65e7c94 commit 2b6a295
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions content/glossary/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ The [_Init Actor_](sysactors) initializes new actors and records the network nam

## Leader

A leader, in the context of Filecoin consensus, is a node that is chosen to propose the next block in the blockchain during [Leader Electioni](#leader-election).
A leader, in the context of Filecoin consensus, is a node that is chosen to propose the next block in the blockchain during [Leader Electioni](glossary#leader-election).

## Leader election

Expand Down Expand Up @@ -375,7 +375,7 @@ Every mined block has a computed `weight`, also called its `WinCount`. Together,

## Window Proof-of-Spacetime (WindowPoSt)

[_Window Proof-of-Spacetime_ (WindowPoSt)](post#windowpost) is the mechanism by which the commitments made by [storage miners](glossary#storage-miner-actor) are audited. It sees each 24-hour period broken down into a series of windows. Correspondingly, each storage miner's set of pledged [sectors](glossary#sector) is partitioned into subsets, one subset for each window. Within a given window, each storage miner must submit a [Proof-of-Spacetime](glossary#proof-of-spacetime-post) for each sector in their respective subset. This requires ready access to each of the challenged sectors, and will result in a [zk-SNARK-compressed](glossary#zksnark) proof published to the Filecoin [blockchain](glossary#blockchain) as a [message](glossary#message) in a [block](#block). In this way, every sector of [pledged storage](glossary#pledged-storage) is audited at least once in any 24-hour period, and a permanent, verifiable, and public record attesting to each storage miner's continued commitment is kept.
[_Window Proof-of-Spacetime_ (WindowPoSt)](post#windowpost) is the mechanism by which the commitments made by [storage miners](glossary#storage-miner-actor) are audited. It sees each 24-hour period broken down into a series of windows. Correspondingly, each storage miner's set of pledged [sectors](glossary#sector) is partitioned into subsets, one subset for each window. Within a given window, each storage miner must submit a [Proof-of-Spacetime](glossary#proof-of-spacetime-post) for each sector in their respective subset. This requires ready access to each of the challenged sectors, and will result in a [zk-SNARK-compressed](glossary#zksnark) proof published to the Filecoin [blockchain](glossary#blockchain) as a [message](glossary#message) in a [block](glossary#block). In this way, every sector of [pledged storage](glossary#pledged-storage) is audited at least once in any 24-hour period, and a permanent, verifiable, and public record attesting to each storage miner's continued commitment is kept.

The Filecoin network expects constant availability of stored data. Failing to submit WindowPoSt for a sector will result in a [fault](glossary#fault), and the storage miner supplying the sector will be [slashed](glossary#slash).

Expand Down
2 changes: 1 addition & 1 deletion content/math-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ $$

**Implementation:**

- [`storage_proofs::merkle::MerkleTreeWrapper::gen_proof()`]()
- [`storage_proofs::merkle::MerkleTreeWrapper::gen_proof()`](https://ddd)
- [`merkle_light::merkle::MerkleTree::gen_proof()`](https://github.com/filecoin-project/merkle_light/blob/64a468807c594d306d12d943dd90cc5f88d0d6b0/src/merkle.rs#L918)

**Additional Notation:**
Expand Down
6 changes: 5 additions & 1 deletion layouts/_default/_markup/render-heading.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
...while the subsequent headings have the .Anchor appended which is a hugo provided id derived from the heading text.
e.g in intro/_index.md <h2>Spec Status</h2> gets the id #intro__spec-status
*/}}
{{- $anchor = printf "section-%s.%s" (delimit $pathParts ".") .Anchor -}}
{{- if eq .Level 1 -}}
{{- $anchor = printf "section-%s" (delimit $pathParts ".") -}}
{{- else -}}
{{- $anchor = printf "section-%s.%s" (delimit $pathParts ".") .Anchor -}}
{{- end -}}

{{/*
- headings get numbered by css; changing the nesting requires updating numbered.scss.
Expand Down
10 changes: 5 additions & 5 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
{{- $title := .Title -}}
{{- $isRemote := or (in .Destination ":") (strings.HasPrefix .Destination "//") }}
{{- if not $isRemote }}
{{/*
it's a local link so normalise the path and it to look up the hugo .Page data
.Destination is the markdown link target as written by the author, and is likely to be shortened...
{{/*
it's a local link so normalise the path and it to look up the hugo .Page data
.Destination is the markdown link target as written by the author, and is likely to be shortened...
...to simplify linking the author can write (see over here)[signatures] when they want to link file to algorithms/crypto/signatures.md
So .Destination is the raw target, which should be just unique enough for .GetPage to figure out what is wanted.

Expand All @@ -32,9 +32,9 @@
{{- $pathParts := split $path "/" -}}
{{- $anchor := "" -}}
{{- if $url.Fragment -}}
{{- $anchor = printf "#%s__%s" (delimit $pathParts "__") $url.Fragment -}}
{{- $anchor = printf "#section-%s.%s" (delimit $pathParts ".") $url.Fragment -}}
{{- else -}}
{{- $anchor = printf "#%s" (delimit $pathParts "__") -}}
{{- $anchor = printf "#section-%s" (delimit $pathParts ".") -}}
{{- end -}}
{{- $destination = $anchor }}
{{- if .Title -}}
Expand Down

0 comments on commit 2b6a295

Please sign in to comment.