From 0a17da198478ec545e7f186d2b60a4743268a8f4 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Tue, 14 Jul 2020 12:09:16 +0100 Subject: [PATCH 01/27] feat: add to IPFS on PR (#976) * feat: add to IPFS on PR - Adds work flow to add the rendered website to IPFS, whenever a commit is pushed. Adds a github status on the commit with a link to the rendered site. - Replaces hardcoded paths with the $GITHUB_WORKSPACE var. This makes the build work on forked repos, where the repo has to be renamed, and shields us from future issues if actions change their workspace dir. - Updated IPFS github action to pin to work with the new style github actions https://github.com/ipfs-shipyard/ipfs-github-action License: MIT Signed-off-by: Oli Evans --- .github/workflows/add-to-ipfs.yml | 49 +++++++++++++++++++ .../{main.yml => deploy-to-gh-pages.yml} | 4 +- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/add-to-ipfs.yml rename .github/workflows/{main.yml => deploy-to-gh-pages.yml} (94%) diff --git a/.github/workflows/add-to-ipfs.yml b/.github/workflows/add-to-ipfs.yml new file mode 100644 index 000000000..1cdcd2d6f --- /dev/null +++ b/.github/workflows/add-to-ipfs.yml @@ -0,0 +1,49 @@ +name: Add to IPFS + +on: [push] + +jobs: + add-to-ipfs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Install Go + run: | + sudo apt-get remove golang-go + sudo apt-get remove --auto-remove golang-go + sudo rm -rf /usr/local/go + sudo rm -rf /usr/local/go1.12 + sudo rm -rf /usr/local/go1.27 + sudo apt-get update + wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz + sudo tar -xvf go1.14.4.linux-amd64.tar.gz + sudo chown -R root:root ./go + sudo cp -r go /usr/local + sudo cp -r go /usr/local/go1.12 + sudo cp -r go /usr/local/go1.27 + sudo ln -sf /usr/local/go/bin/go /usr/bin/go + sudo echo 'GOROOT=/usr/local/go' >> ~/.profile + sudo echo 'GOPATH=$HOME/work' >>~/.profile + sudo echo 'PATH=$GOROOT/bin:$GOPATH/bin' >>~/.profile + source ~/.profile + + - name: Install deps-ga + run: | + sudo make deps-ga + + - name: Build + run: | + sudo chown -R root:root $GITHUB_WORKSPACE + sudo make build + + - uses: ipfs-shipyard/ipfs-github-action@v1.0.0 + with: + path_to_add: $GITHUB_WORKSPACE/build/website + cluster_host: /dnsaddr/cluster.ipfs.io + cluster_user: ${{ secrets.CLUSTER_USER }} + cluster_password: ${{ secrets.CLUSTER_PASSWORD }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/main.yml b/.github/workflows/deploy-to-gh-pages.yml similarity index 94% rename from .github/workflows/main.yml rename to .github/workflows/deploy-to-gh-pages.yml index 88a2d336a..ed499824d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/deploy-to-gh-pages.yml @@ -50,7 +50,7 @@ jobs: - name: Build run: | - sudo chown -R root:root /home/runner/work/specs + sudo chown -R root:root $GITHUB_WORKSPACE sudo make build - name: Deploy using SSH @@ -58,7 +58,7 @@ jobs: DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - sudo chown -R runner /home/runner/work/specs/specs + sudo chown -R runner $GITHUB_WORKSPACE sudo chown -R runner .git/ eval "$(ssh-agent -s)" ssh-add - <<< "${DEPLOY_KEY}" From 0e370a965fe3f9823799a47e300bff7aadacdad5 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Thu, 27 Aug 2020 10:36:37 +0100 Subject: [PATCH 02/27] chore: improvements to dashboard UI (#1101) - [x] update legend text - [x] make background for n/a for audit white. - [x] show audit as WIP when audit is not yet published - [x] show no audit yet as "Missing" - [x] support links to multiple audits - [x] link to multiple proofs audits - [x] show entire table in page (no scrollbar, and dont break link positioning) - [x] dont show text for n/a and None - [x] hide weight column Fixes: #1098 Fixes: #1100 License: MIT Signed-off-by: Oli Evans --- assets/_dashboard.scss | 4 +++- assets/js/dashboard-spec.js | 6 ++---- content/implementations/_index.md | 3 +++ content/implementations/forest.md | 3 +++ content/implementations/fuhon.md | 3 +++ content/implementations/go-filecoin.md | 3 +++ content/implementations/lotus.md | 24 ++++++++++++++++++++---- content/intro/_index.md | 6 +++--- content/intro/filecoin_vm.md | 2 +- layouts/shortcodes/dashboard-impl.html | 22 +++++++++++++--------- 10 files changed, 54 insertions(+), 22 deletions(-) diff --git a/assets/_dashboard.scss b/assets/_dashboard.scss index 3e4460d36..d09a2b4ba 100644 --- a/assets/_dashboard.scss +++ b/assets/_dashboard.scss @@ -1,5 +1,7 @@ #dashboard-container { - height: 90vh; + // the dashboard is generated on the client, so it throws out in page anchor scrolling, so we set the heigt manually here. + // TODO: Fix properly. perhaps generating the table earlier in the page render could fix it... otherwise writing it into the dom as a post process. + height: 2850px; overflow: auto } table.Dashboard { diff --git a/assets/js/dashboard-spec.js b/assets/js/dashboard-spec.js index 9898a6e1f..149ae2b9c 100644 --- a/assets/js/dashboard-spec.js +++ b/assets/js/dashboard-spec.js @@ -18,7 +18,7 @@ const humanize = (input) => { } if(input === 'n/a') { - return 'N/A' + return '' } return input.charAt(0).toUpperCase() + input.substr(1); @@ -49,7 +49,6 @@ function buildDashboard(selector, model) { Section - Weight State Theory Audit @@ -58,9 +57,8 @@ function buildDashboard(selector, model) { ${data.map((i)=> i.page ? html` ${i.number} ${i.text} - ${i.dashboardWeight} ${humanize(i.dashboardState)} - + ${i.dashboardAuditURL ? html`${i.dashboardAuditDate}` : humanize(i.dashboardAudit) } diff --git a/content/implementations/_index.md b/content/implementations/_index.md index f4c8d66b5..12d382aac 100644 --- a/content/implementations/_index.md +++ b/content/implementations/_index.md @@ -3,6 +3,9 @@ title: Implementations weight: 8 dashboardhidden: true +dashboardWeight: 1 +dashboardState: reliable +dashboardAudit: n/a --- # Filecoin Implementations diff --git a/content/implementations/forest.md b/content/implementations/forest.md index 4c3167134..c8bb28f80 100644 --- a/content/implementations/forest.md +++ b/content/implementations/forest.md @@ -1,6 +1,9 @@ --- title: Forest weight: 3 +dashboardWeight: 1 +dashboardState: reliable +dashboardAudit: n/a implRepos: - { lang: rust, repo: https://github.com/ChainSafe/forest } --- diff --git a/content/implementations/fuhon.md b/content/implementations/fuhon.md index dd6295bdc..e3d64c3fb 100644 --- a/content/implementations/fuhon.md +++ b/content/implementations/fuhon.md @@ -1,6 +1,9 @@ --- title: Fuhon weight: 4 +dashboardWeight: 1 +dashboardState: reliable +dashboardAudit: n/a implRepos: - { lang: c++, repo: https://github.com/filecoin-project/cpp-filecoin } --- diff --git a/content/implementations/go-filecoin.md b/content/implementations/go-filecoin.md index e45c3aba0..1fb93d733 100644 --- a/content/implementations/go-filecoin.md +++ b/content/implementations/go-filecoin.md @@ -1,6 +1,9 @@ --- title: go-filecoin weight: 2 +dashboardWeight: 1 +dashboardState: reliable +dashboardAudit: n/a implRepos: - { lang: go, repo: https://github.com/filecoin-project/go-filecoin } --- diff --git a/content/implementations/lotus.md b/content/implementations/lotus.md index 4541b6506..005902be2 100644 --- a/content/implementations/lotus.md +++ b/content/implementations/lotus.md @@ -1,11 +1,27 @@ --- title: Lotus weight: 1 +dashboardWeight: 1 +dashboardState: reliable +dashboardAudit: n/a implRepos: - - { lang: go, repo: https://github.com/filecoin-project/lotus, auditState: done, auditDate: '2020-07-31' } - - { lang: go, repo: https://github.com/filecoin-project/go-fil-markets, auditState: done, auditDate: '2020-07-31' } - - { lang: go, repo: https://github.com/filecoin-project/specs-actors, auditState: done, auditDate: '2020-07-31' } - - { lang: rust, repo: https://github.com/filecoin-project/rust-fil-proofs } + - repo: https://github.com/filecoin-project/lotus + lang: go + auditState: wip + - repo: https://github.com/filecoin-project/go-fil-markets + lang: go + auditState: wip + - repo: https://github.com/filecoin-project/specs-actors + lang: go + auditState: wip + - repo: https://github.com/filecoin-project/rust-fil-proofs + lang: rust + auditState: done + audits: + - auditDate: '2020-07-28' + auditURL: https://github.com/filecoin-project/rust-fil-proofs/blob/master/audits/protocolai-audit-20200728.pdf + - auditDate: '2020-07-28' + auditURL: https://github.com/filecoin-project/rust-fil-proofs/blob/4a07a868d077f5926b23c3f913f99d8b46b8cebc/audits/Sigma-Prime-Protocol-Labs-Filecoin-Proofs-Security-Review-v2.1.pdf --- # Lotus diff --git a/content/intro/_index.md b/content/intro/_index.md index b8861b811..dbebd46c7 100644 --- a/content/intro/_index.md +++ b/content/intro/_index.md @@ -49,15 +49,15 @@ Each section of the spec must be stable and audited before it is considered done - Final, will not change before mainnet launch. + Unlikely to change in the foreseeable future. Stable - Reliable and likely to not change. + All content is correct. Important details are covered. Reliable - Work has started but not yet finished. + All content is correct. Details are being worked on. Draft/WIP diff --git a/content/intro/filecoin_vm.md b/content/intro/filecoin_vm.md index f7fc582be..c85ac3994 100644 --- a/content/intro/filecoin_vm.md +++ b/content/intro/filecoin_vm.md @@ -3,7 +3,7 @@ title: "Filecoin VM" weight: 3 dashboardWeight: 0.2 dashboardState: reliable -dashboardAudit: missing +dashboardAudit: n/a --- # Filecoin VM diff --git a/layouts/shortcodes/dashboard-impl.html b/layouts/shortcodes/dashboard-impl.html index d8ced8bfb..e6492cca0 100644 --- a/layouts/shortcodes/dashboard-impl.html +++ b/layouts/shortcodes/dashboard-impl.html @@ -49,16 +49,20 @@ {{ if $data.commit.totals.c }}{{ math.Round $data.commit.totals.c }}%{{ else }}Unknown{{end}} - - {{if eq $repoItem.auditState "wip"}} + + {{ if eq $repoItem.auditState "wip" }} WIP - {{else if $repoItem.auditURL}} - - {{ $repoItem.auditDate }} - - {{else}} - {{ humanize $repoItem.auditState | default "None" }} - {{end}} + {{ else if and (eq $repoItem.auditState "done") (isset $repoItem "audits") }} + {{ else }} + {{ humanize $repoItem.auditState | default "Missing" }} + {{ end }} + {{ if isset $repoItem "audits" }} + {{ range $auditIndex, $audit := $repoItem.audits }} + + [{{ add $auditIndex 1 }}] + + {{ end }} + {{ end }} {{ end }} From e88897744896517f342a621a469640014a9135b4 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Fri, 28 Aug 2020 09:13:03 +0100 Subject: [PATCH 03/27] fix: correct libp2p audit data (#1110) License: MIT Signed-off-by: Oli Evans --- content/libraries/libp2p/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/libraries/libp2p/_index.md b/content/libraries/libp2p/_index.md index aab1c2bf1..a3b25748b 100644 --- a/content/libraries/libp2p/_index.md +++ b/content/libraries/libp2p/_index.md @@ -7,7 +7,7 @@ dashboardWeight: 1 dashboardState: missing dashboardTests: 0 dashboardAudit: done -dashboardAuditDate: '2020-10-10' +dashboardAuditDate: '2019-10-10' dashboardAuditURL: https://github.com/protocol/libp2p-vulnerabilities/blob/master/DRAFT_NCC_Group_ProtocolLabs_1903ProtocolLabsLibp2p_Report_2019-10-10_v1.1.pdf --- From 6732ae6f3d09a5ea7da75edb3310ad1a7999fd3a Mon Sep 17 00:00:00 2001 From: Yiannis Psaras <52073247+yiannisbot@users.noreply.github.com> Date: Fri, 28 Aug 2020 11:24:41 +0300 Subject: [PATCH 04/27] chore: data transfer protocol is stable (#1111) --- content/systems/filecoin_files/data_transfer/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/systems/filecoin_files/data_transfer/_index.md b/content/systems/filecoin_files/data_transfer/_index.md index 6f936cbe5..1020294b1 100644 --- a/content/systems/filecoin_files/data_transfer/_index.md +++ b/content/systems/filecoin_files/data_transfer/_index.md @@ -2,7 +2,7 @@ title: Data Transfer weight: 3 dashboardWeight: 1 -dashboardState: wip +dashboardState: stable dashboardAudit: missing dashboardTests: 0 --- @@ -98,4 +98,4 @@ transport mechanism (including offline mechanisms) is acceptable. **Data Transfer Manager** -{{}} \ No newline at end of file +{{}} From e7a61695386bb2d11190a34875189b96db11f412 Mon Sep 17 00:00:00 2001 From: Yiannis Psaras <52073247+yiannisbot@users.noreply.github.com> Date: Sat, 29 Aug 2020 11:48:10 +0300 Subject: [PATCH 05/27] fix(content): deleting redundant payment channel section (#1120) --- content/algorithms/payment_channels.md | 74 -------------------------- 1 file changed, 74 deletions(-) delete mode 100644 content/algorithms/payment_channels.md diff --git a/content/algorithms/payment_channels.md b/content/algorithms/payment_channels.md deleted file mode 100644 index d1be30c4f..000000000 --- a/content/algorithms/payment_channels.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: "Payment Channels" -weight: 4 -dashboardWeight: 1 -dashboardState: wip -dashboardAudit: missing -dashboardTests: 0 ---- - -# Payment Channels - -In order for the Filecoin Markets to work in a timely manner, we need to be able to have off-chain payments. This is a solved problem (at least, for our purposes in v0). Payment channels have been implemented and used in bitcoin, ethereum and many other networks. - -The basic premise is this: User A wants to be able to send many small payments to user B. So user A locks up money in a contract that says "this money will only go to user B, and the unclaimed amount will be returned to user A after a set time period". Once that money is locked up, user A can send user B signed transactions that user B can cash out at any time. - -For example: - -- User A locks up 10 FIL to B -- User B does something for A -- User A sends `SignedVoucher{Channel, 1 FIL}` to B -- User B does something for user A -- User A sends `SignedVoucher{Channel, 2 FIL}` to B - -At this point, B has two signed messages from A, but the contract is set up such that it can only be cashed out once. So if B decided to cash out, they would obviously select the message with the higher value. Also, once B cashes out, they must not accept any more payments from A on that same channel. - -## Multi-Lane Payment Channel - -The filecoin storage market may require a way to do incremental payments between two parties, over time, for multiple different transactions. The primary motivating usecase for this is to provide payment for file storage over time, for each file stored. An additional requirement is the ability to have less than one message on chain per transaction 'lane', meaning that payments for multiple files should be aggregateable (Note: its okay if this aggregation is an interactive process). - -Let's say that `A` wants to make such an arrangement with `B`. `A` should create the payment channel with enough funds to cover all potential transactions. Then `A` decides to start the first transaction, so they send a signed voucher for the payment channel on 'lane 1', for 2 FIL. They can then send more updates on lane 1 as needed. Then, at some point `A` decides to start another independent transaction to `B`, so they send a voucher on 'lane 2'. The voucher for lane 2 can be cashed out independently of lane 1. However, `B` can ask `A` to 'reconcile' the two payment channels for them into a single update. This update could contain a value, and a list of lanes to close. Cashing out that reconciled update would invalidate the other lanes, meaning `B` couldnt also cash in those. The single update would be much smaller, and therefore cheaper to close out. - -Lane state can be easily tracked on-chain with a compact bitfield. - -## Payment Channel Reconciliation - -In a situation where peers A and B have several different payment channels between them, the scenario may frequently come up where A has multiple payment channel updates from B to apply. Submitting each of these individually would cost a noticeable amount in fees, and put excess unnecessary load on the chain. To remedy this, A can contact B and ask them for a single payment channel update for the combined value of all the updates they have (minus some fee to incent B to actually want to do this). This aggregated update would contain a list of the IDs of the other payment channels that it is superceding so that A cannot also cash out on the originals. - -## Payment Reconciliation - -The filecoin storage market will (likely) have many independent payments between the same parties. These payments will be secured through payment channels, set up initially on chain, but utilized almost entirely off-chain. The point at which they need to touch the chain is when miners wish to cash out their earnings. A naive solution to this problem would have miners perform one on-chain action per file stored for a particular client. This would not scale well. Instead, we need a system where the miner and client can have some additional off-chain communication and end up with the miner submitting only a single message to the chain. - -To accomplish this, we introduce the Payment Reconciliation Protocol. - -This is a libp2p service run by all participants wanting to participate in payment reconciliation. When Alice has a set of payments from Bob that she is ready to cash out, Alice can send a `ReconcileRequest` to Bob, containing the following information: - -```sh -type ReconcileRequest struct { - vouchers [Vouchers] - reqVal TokenAmount -} -``` - -The Vouchers should all be valid vouchers from Bob to Alice, on the same payment channel, and they should all be ready to be cashed in. `ReqVal` is a token amount less than or equal to the sum of all the values in the given vouchers. Generally, this value will be between the total sum of the vouchers, and that total sum minus the fees it would cost to submit them all to the chain. - -Bob receives this request, and checks that all the fields are correct, and then ensures that the difference between ReqVal and the vouchers sum is sufficient (this is a parameter that the client can set). Then, he sends back a response which either contains the requested voucher, or an error status and message. - -```sh -type ReconcileResponse struct { - combined Voucher - status Status - message optional String -} - -## TODO: what are the possible status cases? -type Status enum { - | Success - | Failure -} -``` - -Open Questions: - -- In a number of usecases, this protocol will require the miner look up and connect to a client to propose reconciliation. How does a miner look up and connect to a client over libp2p given only their filecoin address? -- Without repair miners, this protocol will likely not be used that much. Should that be made clear? Should there be other considerations added to compensate? From a9ffa2d678edc640945a7f0032cf8acfb5140b8e Mon Sep 17 00:00:00 2001 From: Yiannis Psaras <52073247+yiannisbot@users.noreply.github.com> Date: Sun, 30 Aug 2020 12:08:17 +0300 Subject: [PATCH 06/27] fix(content): fix minor MD typos on Payment Channel section (#1121) I've noticed a few typos relating to _italics_ in MD not being interpreted correctly in the payment channel section, which this PR is fixing. --- content/systems/filecoin_token/payment_channels/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/systems/filecoin_token/payment_channels/_index.md b/content/systems/filecoin_token/payment_channels/_index.md index 8a9d00d7c..6bfe39047 100644 --- a/content/systems/filecoin_token/payment_channels/_index.md +++ b/content/systems/filecoin_token/payment_channels/_index.md @@ -14,7 +14,7 @@ Payment channels are generally used as a mechanism to increase the scalability o The goal of the Payment Channel Actor specified here is to enable a series of off-chain microtransactions for applications built on top of Filecoin to be reconciled on-chain at a later time with fewer messages that involve the blockchain. Payment channels are already used in the Retrieval Market of the Filecoin Network, but their applicability is not constrained within this use-case only. Hence, here, we provide a detailed description of Payment Channels in the Filecoin network and then describe how Payment Channels are used in the specific case of the Filecoin Retrieval Market. -The payment channel actor can be used to open long-lived, flexible payment channels between users. Filecoin payment channels are _uni-directional_ and can be funded by adding to their balance. Given the context of _uni-directional_ payment channels, we define the **payment channel sender** as the party that receives some service, creates the channel, deposits funds and _sends_ payments (hence the term _payment channel sender_). The *payment channel recipient**, on the other hand is defined as the party that provides services and _receives payment_ for the services delivered (hence the term _payment channel recipient_). The fact that payment channels are uni-directional means that only the payment channel sender can add funds and the recipient can receive funds. Payment channels are identified by a unique address, as is the case with all Filecoin actors. +The payment channel actor can be used to open long-lived, flexible payment channels between users. Filecoin payment channels are _uni-directional_ and can be funded by adding to their balance. Given the context of _uni-directional_ payment channels, we define the **payment channel sender** as the party that receives some service, creates the channel, deposits funds and _sends_ payments (hence the term _payment channel sender_). The *payment channel recipient*, on the other hand is defined as the party that provides services and *receives payment* for the services delivered (hence the term *payment channel recipient*). The fact that payment channels are uni-directional means that only the payment channel sender can add funds and the recipient can receive funds. Payment channels are identified by a unique address, as is the case with all Filecoin actors. The payment channel state structure looks like this: From caf25fc00931355f5f1b911ca43d6b407b4b4fe6 Mon Sep 17 00:00:00 2001 From: Yiannis Psaras <52073247+yiannisbot@users.noreply.github.com> Date: Mon, 31 Aug 2020 13:02:39 +0300 Subject: [PATCH 07/27] fix(content): FIL VM State Tree Update (#1057) This PR is an update to the VM state tree and the (most important) functions related to updating it. @anorth please advise on important things not currently mentioned, as well as on whether the TODO at the end is still relevant or not. --- .../systems/filecoin_vm/state_tree/_index.md | 14 ++++---------- .../filecoin_vm/state_tree/state_tree.id | 19 ------------------- 2 files changed, 4 insertions(+), 29 deletions(-) delete mode 100644 content/systems/filecoin_vm/state_tree/state_tree.id diff --git a/content/systems/filecoin_vm/state_tree/_index.md b/content/systems/filecoin_vm/state_tree/_index.md index c3dc4dfec..73e9a6fdb 100644 --- a/content/systems/filecoin_vm/state_tree/_index.md +++ b/content/systems/filecoin_vm/state_tree/_index.md @@ -2,19 +2,13 @@ title: State Tree weight: 2 dashboardWeight: 1.5 -dashboardState: wip -dashboardAudit: n/a +dashboardState: reliable +dashboardAudit: missing dashboardTests: 0 --- # State Tree -The State Tree is the output of applying operations on the Filecoin Blockchain. +The State Tree is the output of the execution of any operation applied on the Filecoin Blockchain. The on-chain (i.e., VM) state data structure is a map (in the form of a Hash Array Mapped Trie - HAMT) that binds addresses to actor states. The current State Tree function is called by the VM upon every actor method invocation. -{{}} - -{{}} -TODO - -- Add ConvenienceAPI state to provide more user-friendly views. -{{}} +{{}} \ No newline at end of file diff --git a/content/systems/filecoin_vm/state_tree/state_tree.id b/content/systems/filecoin_vm/state_tree/state_tree.id deleted file mode 100644 index 90dca880e..000000000 --- a/content/systems/filecoin_vm/state_tree/state_tree.id +++ /dev/null @@ -1,19 +0,0 @@ -import abi "github.com/filecoin-project/specs-actors/actors/abi" -import addr "github.com/filecoin-project/go-address" -import actor "github.com/filecoin-project/specs/systems/filecoin_vm/actor" -import cid "github.com/ipfs/go-cid" - -// The on-chain state data structure is a map (HAMT) of addresses to actor states. -// Only ID addresses are expected as keys. -type StateTree struct { - ActorStates {addr.Address: actor.ActorState} // HAMT - - // Returns the CID of the root node of the HAMT. - RootCID() cid.Cid - - // Looks up an actor state by address. - GetActor(a addr.Address) (state actor.ActorState, ok bool) - - // Looks up an abi.ActorCodeID by address. - GetActorCodeID_Assert(a addr.Address) abi.ActorCodeID -} From cf315151bbff882f8933df28b19acf0410ea9d98 Mon Sep 17 00:00:00 2001 From: Yiannis Psaras <52073247+yiannisbot@users.noreply.github.com> Date: Mon, 31 Aug 2020 14:41:19 +0300 Subject: [PATCH 08/27] fix(content): FIL VM System Actors Update (#1061) Co-authored-by: Alex North <445306+anorth@users.noreply.github.com> --- .../systems/filecoin_vm/sysactors/_index.md | 53 ++++++++++++++++--- .../filecoin_vm/sysactors/account_actor.md | 12 ----- .../filecoin_vm/sysactors/cron_actor.md | 12 ----- .../filecoin_vm/sysactors/init_actor.md | 12 ----- .../filecoin_vm/sysactors/reward_actor.md | 17 ------ 5 files changed, 46 insertions(+), 60 deletions(-) delete mode 100644 content/systems/filecoin_vm/sysactors/account_actor.md delete mode 100644 content/systems/filecoin_vm/sysactors/cron_actor.md delete mode 100644 content/systems/filecoin_vm/sysactors/init_actor.md delete mode 100644 content/systems/filecoin_vm/sysactors/reward_actor.md diff --git a/content/systems/filecoin_vm/sysactors/_index.md b/content/systems/filecoin_vm/sysactors/_index.md index 4ff8129b6..60c76a66c 100644 --- a/content/systems/filecoin_vm/sysactors/_index.md +++ b/content/systems/filecoin_vm/sysactors/_index.md @@ -3,16 +3,55 @@ title: System Actors weight: 6 bookCollapseSection: true dashboardWeight: 2 -dashboardState: wip +dashboardState: reliable dashboardAudit: wip dashboardTests: 0 --- # System Actors -- There are two system actors required for VM processing: - - [InitActor](init_actor.md) - initializes new actors, records the network name - - [CronActor](cron_actor.md) - runs critical functions at every epoch -- There are two more VM level actors: - - [AccountActor](account_actor.md) - for user accounts (non-singleton). - - [RewardActor](reward_actor.md) - for block reward and token vesting (singleton). +There are eleven (11) builtin System Actors in total, but not all of them interact with the VM. Each actor is identified by a _Code ID_ (or CID). + +There are two system actors required for VM processing: + - the [InitActor](init_actor.md), which initializes new actors and records the network name, and + - the [CronActor](cron_actor.md), a scheduler actor that runs critical functions at every epoch. +There are another two actors that interact with the VM: + - the [AccountActor](account_actor.md) responsible for user accounts (non-singleton), and + - the [RewardActor](reward_actor.md) for block reward and token vesting (singleton). + + +The remaining seven (7) builtin System Actors that do not interact directly with the VM are the following: + +- `StorageMarketActor`: responsible for managing storage and retrieval deals [[Market Actor Repo](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/market/market_actor.go)] +- `StorageMinerActor`: actor responsible to deal with storage mining operations and collect proofs [[Storage Miner Actor Repo](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/miner/miner_actor.go)] +- `MultisigActor` (or Multi-Signature Wallet Actor): responsible for dealing with operations involving the Filecoin wallet [[Multisig Actor Repo](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/multisig/multisig_actor.go)] +- `PaymentChannelActor`: responsible for setting up and settling funds related to payment channels [[Paych Actor Repo](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/paych/paych_actor.go)] +- `StoragePowerActor`: responsible for keeping track of the storage power allocated at each storage miner [[Storage Power Actor](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/power/power_actor.go)] +- `VerifiedRegistryActor`: responsible for managing verified clients [[Verifreg Actor Repo](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/verifreg/verified_registry_actor.go)] +- `SystemActor`: general system actor [[System Actor Repo](https://github.com/filecoin-project/specs-actors/blob/master/actors/builtin/system/system_actor.go)] + +## CronActor + +Built in to the genesis state, the `CronActor`'s dispatch table invokes the `StoragePowerActor` and `StorageMarketActor` for them to maintain internal state and process deferred events. It could in principle invoke other actors after a network upgrade. + +{{}} + +## InitActor + +The `InitActor` has the power to create new actors, e.g., those that enter the system. It maintains a table resolving a public key and temporary actor addresses to their canonical ID-addresses. Invalid CIDs should not get committed to the state tree. + +Note that the canonical ID address does not persist in case of chain re-organization. The actor address or public key survives chain re-organization. + +{{}} + +## RewardActor + +The `RewardActor` is where unminted Filecoin tokens are kept. The actor distributes rewards directly to miner actors, where they are locked for vesting. The reward value used for the current epoch is updated at the end of an epoch through a cron tick. + +{{}} + +## AccountActor + +The `AccountActor` is responsible for user accounts. Account actors are not created by the `InitActor`, but their constructor is called by the system. Account actors are created by sending a message to a public-key style address. The address must be `BLS` or `SECP`, or otherwise there should be an exit error. The account actor is updating the state tree with the new actor address. + +{{}} \ No newline at end of file diff --git a/content/systems/filecoin_vm/sysactors/account_actor.md b/content/systems/filecoin_vm/sysactors/account_actor.md deleted file mode 100644 index ee42b0c4f..000000000 --- a/content/systems/filecoin_vm/sysactors/account_actor.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: AccountActor -weight: 3 -dashboardWeight: 2 -dashboardState: wip -dashboardAudit: wip -dashboardTests: 0 ---- - -# AccountActor - -{{}} diff --git a/content/systems/filecoin_vm/sysactors/cron_actor.md b/content/systems/filecoin_vm/sysactors/cron_actor.md deleted file mode 100644 index 02a61bbd6..000000000 --- a/content/systems/filecoin_vm/sysactors/cron_actor.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: CronActor -weight: 2 -dashboardWeight: 2 -dashboardState: wip -dashboardAudit: wip -dashboardTests: 0 ---- - -# CronActor - -{{}} diff --git a/content/systems/filecoin_vm/sysactors/init_actor.md b/content/systems/filecoin_vm/sysactors/init_actor.md deleted file mode 100644 index e263e4de0..000000000 --- a/content/systems/filecoin_vm/sysactors/init_actor.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: InitActor -weight: 1 -dashboardWeight: 2 -dashboardState: wip -dashboardAudit: wip -dashboardTests: 0 ---- - -# InitActor - -{{}} diff --git a/content/systems/filecoin_vm/sysactors/reward_actor.md b/content/systems/filecoin_vm/sysactors/reward_actor.md deleted file mode 100644 index b0b2302a9..000000000 --- a/content/systems/filecoin_vm/sysactors/reward_actor.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: RewardActor -dashboardWeight: 2 -dashboardState: wip -dashboardAudit: wip -dashboardTests: 0 ---- - -# RewardActor - -RewardActor is where unminted Filecoin tokens are kept. RewardActor contains a `RewardMap` which is a mapping from owner addresses to `Reward` structs. - -`Reward` struct is created to preserve the flexibility of introducing block reward vesting into the protocol. `MintReward` creates a new `Reward` struct and adds it to the `RewardMap`. - -A `Reward` struct contains a `StartEpoch` that keeps track of when this `Reward` is created, `Value` that represents the total number of tokens rewarded, and `EndEpoch` which is when the reward will be fully vested. `VestingFunction` is currently an enum to represent the flexibility of different vesting functions. `AmountWithdrawn` records how many tokens have been withdrawn from a `Reward` struct so far. Owner addresses can call `WithdrawReward` which will withdraw all vested tokens that the investor address has from the RewardMap so far. When `AmountWithdrawn` equals `Value` in a `Reward` struct, the `Reward` struct will be removed from the `RewardMap`. - -{{}} From 27cb127b3b6ffbe574f2a498fccbf88022a048ae Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 31 Aug 2020 13:46:23 +0100 Subject: [PATCH 09/27] fix: fix broken links --- .../systems/filecoin_markets/retrieval_market/_index.md | 2 +- .../systems/filecoin_vm/interpreter/vm_interpreter_old.md | 2 +- content/systems/filecoin_vm/sysactors/_index.md | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/content/systems/filecoin_markets/retrieval_market/_index.md b/content/systems/filecoin_markets/retrieval_market/_index.md index 0f8649b81..f104404b7 100644 --- a/content/systems/filecoin_markets/retrieval_market/_index.md +++ b/content/systems/filecoin_markets/retrieval_market/_index.md @@ -16,7 +16,7 @@ The `retrieval market` refers to the process of negotiating deals for a provider The main components are as follows: -- A [payment channel actor](payment_channel_actor) +- A [payment channel actor](payment_channels#payment-channel-actor) - A protocol for making queries - A Data Transfer subsystem and protocol used to query retrieval miners and initiate retrieval deals - A chain-based content routing interface diff --git a/content/systems/filecoin_vm/interpreter/vm_interpreter_old.md b/content/systems/filecoin_vm/interpreter/vm_interpreter_old.md index a8cb0e0fa..1a749cd27 100644 --- a/content/systems/filecoin_vm/interpreter/vm_interpreter_old.md +++ b/content/systems/filecoin_vm/interpreter/vm_interpreter_old.md @@ -20,7 +20,7 @@ The `global state` is modeled as a map of actor `ID`s to actor structs. This map There are two mechanisms by which an actor can be created. By explicitly invoking `exec` on the `Init` actor, and by sending a message to a `Public Key` typed `Address`. -Calling `exec` to create an actor should generate an Actor address, and register it in the state tree (see [Init Actor](init_actor) for more details). +Calling `exec` to create an actor should generate an Actor address, and register it in the state tree (see [Init Actor](sysactors#initactor) for more details). Sending a message to a non-existant account via a public key address causes the creation of an account actor for that address. The `To` address should be placed into the actor storage for later use in validating messages sent from this actor. diff --git a/content/systems/filecoin_vm/sysactors/_index.md b/content/systems/filecoin_vm/sysactors/_index.md index 60c76a66c..bb9a1ec0d 100644 --- a/content/systems/filecoin_vm/sysactors/_index.md +++ b/content/systems/filecoin_vm/sysactors/_index.md @@ -13,11 +13,11 @@ dashboardTests: 0 There are eleven (11) builtin System Actors in total, but not all of them interact with the VM. Each actor is identified by a _Code ID_ (or CID). There are two system actors required for VM processing: - - the [InitActor](init_actor.md), which initializes new actors and records the network name, and - - the [CronActor](cron_actor.md), a scheduler actor that runs critical functions at every epoch. + - the [InitActor](sysactors#initactor), which initializes new actors and records the network name, and + - the [CronActor](sysactors#cronactor), a scheduler actor that runs critical functions at every epoch. There are another two actors that interact with the VM: - - the [AccountActor](account_actor.md) responsible for user accounts (non-singleton), and - - the [RewardActor](reward_actor.md) for block reward and token vesting (singleton). + - the [AccountActor](sysactors#accountactor) responsible for user accounts (non-singleton), and + - the [RewardActor](sysactors#rewardactor) for block reward and token vesting (singleton). The remaining seven (7) builtin System Actors that do not interact directly with the VM are the following: From e9ddf273b5cce19e63c203f78e4b6fb3fac4ba09 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 31 Aug 2020 14:24:19 +0100 Subject: [PATCH 10/27] fix: update dns link --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b91e2f10..d94de87e2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,10 +39,10 @@ jobs: - run: echo ${{ github.ref }} - # This branch updates a dnslink for a domain if the current branch should be deployed to prod. + # Update the dnslink if changes to the current branch should go live # see https://github.com/ipfs-shipyard/js-dnslink-dnsimple - - run: npx dnslink-dnsimple --domain beta.spec.filecoin.io --link /ipfs/${{ steps.ipfs.outputs.cid }} + - run: npx dnslink-dnsimple --domain spec.filecoin.io --link /ipfs/${{ steps.ipfs.outputs.cid }} env: DNSIMPLE_TOKEN: ${{ secrets.DNSIMPLE_TOKEN }} # TODO: change to master once merged. - if: github.ref == 'refs/heads/beta' + if: github.ref == 'refs/heads/master' From 0031915ce08cac13dd2a0f37d63d2ad77c350549 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 31 Aug 2020 17:16:14 +0100 Subject: [PATCH 11/27] chore: update readme and package.json --- README.md | 5 +---- package.json | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bc1572a9d..0404917ff 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,7 @@ Note that the `beta` branch of the specs moves quickly. We work to merge PRs as ## Website -https://beta.spec.filecoin.io is the user-friendly website rendering, which we recommend for reading this repository. The website is updated automatically with every merge to `beta`. - -## Previous version -You can find the previous version of the Filecoin Spec in the master branch [here](https://github.com/filecoin-project/specs/tree/master). +https://spec.filecoin.io is the user-friendly website rendering, which we recommend for reading this repository. The website is updated automatically with every merge to `master`. ## Install diff --git a/package.json b/package.json index cb61f4cd7..9f50cfe75 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "specs", - "version": "1.0.0", + "version": "0.0.1", "description": "The Filecoin protocol specification", "main": "index.js", "scripts": { From 5211bcb9d6d3bbed5eeba52503b736a556594687 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 31 Aug 2020 17:18:38 +0100 Subject: [PATCH 12/27] v1.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9f50cfe75..cb61f4cd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "specs", - "version": "0.0.1", + "version": "1.0.0", "description": "The Filecoin protocol specification", "main": "index.js", "scripts": { From 2d8213f112454b33e9aefc24bcaffe7647e4b980 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 31 Aug 2020 17:36:18 +0100 Subject: [PATCH 13/27] feat(tooling): release scripts --- README.md | 2 -- package.json | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0404917ff..c9c2614ea 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ This is the [Filecoin Specification](https://github.com/filecoin-project/specs), a repository that contains documents, code, models, and diagrams that constitute the specification of the [Filecoin Protocol](https://filecoin.io). This repository is the singular source of truth for the Filecoin Protocol. All implementations of the Filecoin Protocol should match and comply with the descriptions, interfaces, code, and models defined in this specification. -Note that the `beta` branch of the specs moves quickly. We work to merge PRs as fast as possible into master, which means changes or reversals are possible here. Accordingly, we periodically compile swaths of spec along with a high-level difflog into the `release` branch. As the spec stabilizes, this practice will change. - ## Website https://spec.filecoin.io is the user-friendly website rendering, which we recommend for reading this repository. The website is updated automatically with every merge to `master`. diff --git a/package.json b/package.json index cb61f4cd7..89575adc9 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "watch-diagrams": "tools/diagrams.js --watch", "build": "npm run build-diagrams && hugo --gc --minify", "build-diagrams": "tools/diagrams.js --all", - "clean": "premove public resources static/_gen && hugo mod clean --all && hugo mod tidy" + "clean": "premove public resources static/_gen && hugo mod clean --all && hugo mod tidy", + "release": "np --no-publish && conventional-github-releaser -p angular" }, "author": "", "license": "MIT", @@ -35,10 +36,12 @@ "@mermaid-js/mermaid-cli": "^8.7.0", "chokidar": "^3.4.2", "concurrently": "^5.3.0", + "conventional-github-releaser": "^3.1.5", "execa": "^4.0.3", "globby": "^11.0.1", "graphviz-cli": "^1.0.0", "hugo-extended": "^0.74.3", + "np": "^6.5.0", "premove": "^3.0.1" } } From e01242c2c2b040408374d4e3bae2b5016950d3dc Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Mon, 31 Aug 2020 17:36:34 +0100 Subject: [PATCH 14/27] v1.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 89575adc9..ad327dae7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "specs", - "version": "1.0.0", + "version": "1.0.1", "description": "The Filecoin protocol specification", "main": "index.js", "scripts": { From 847b49c977a32ac1972eafd1c368673d7bd4933e Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Tue, 1 Sep 2020 19:30:32 +0100 Subject: [PATCH 15/27] feat: add symbol embeds and listing (#1126) --- README.md | 38 ++- assets/_code.scss | 5 +- assets/_custom.scss | 355 +------------------------ assets/plugins/_bagdes.scss | 24 ++ assets/plugins/_scrollbars.scss | 11 +- assets/plugins/_toc.scss | 2 +- go.mod | 8 +- go.sum | 28 ++ layouts/partials/docs/html-head.html | 17 +- layouts/partials/docs/inject/body.html | 23 +- layouts/shortcodes/embed.html | 65 ++++- layouts/shortcodes/listing.html | 85 ++++++ 12 files changed, 260 insertions(+), 401 deletions(-) create mode 100644 assets/plugins/_bagdes.scss create mode 100644 layouts/shortcodes/listing.html diff --git a/README.md b/README.md index c9c2614ea..ad23ec38f 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,36 @@ You can override the `` title by passing a second `string` in the link defini ## Shortcodes + +### `embed` +```md +# src relative to the page +{{}} + +# src relative to content folder +{{}} + +# can just embed a markdown file +{{}} + +# can embed symbols from Go files +# extracts comments and symbol body +{{}} +``` + +### `listing` +The listing shortcode creates tables from externals sources, supports Go `struct`. +```md +# src relative to the page +{{}} + +# src relative to content folder +{{}} + +# src can also be from the externals repos +{{}} +``` + ### `Mermaid` Inline mermaid syntax rendering ```html @@ -209,14 +239,8 @@ Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa {{< /hint >}} ``` -### `embed` -```md -# src relative to the page -{{}} -# src relative to content folder -{{}} -``` + ## Math mode For short snippets of math text you can just use the `{{}}` shortcode, but if you need to write lots of math in a page you can just use `math-mode` and avoid writting the katex shortcode everywhere. diff --git a/assets/_code.scss b/assets/_code.scss index 527ae4ecf..d9c7a48b9 100644 --- a/assets/_code.scss +++ b/assets/_code.scss @@ -1,4 +1,5 @@ .markdown pre { - max-height: 450px; - overflow: auto; + // max-height: 450px; + // overflow: auto; + } \ No newline at end of file diff --git a/assets/_custom.scss b/assets/_custom.scss index 183f5cd3b..2ef16ecff 100644 --- a/assets/_custom.scss +++ b/assets/_custom.scss @@ -4,15 +4,16 @@ @import "plugins/numbered"; @import "plugins/scrollbars"; -@import "plugins/toggles"; +// @import "plugins/toggles"; +@import "plugins/lightbox"; +@import "plugins/bagdes"; +@import "plugins/toc"; @import "table-sort"; @import "colors"; @import "dashboard"; -@import "plugins/toc"; @import "katex"; @import "icons"; @import "code"; -@import "plugins/lightbox"; .markdown { @@ -38,10 +39,7 @@ } } } -.section-badges { - float: right; - margin-top:-2.5rem; -} + // SVG Diagrams .diagrams-container { @@ -118,9 +116,11 @@ html { summary { outline: none; } + blockquote { overflow: auto; } + .book-menu nav { width: 20rem; height: 100%; @@ -130,9 +130,9 @@ blockquote { bottom: 0; overflow: hidden; } -.book-menu .toc { - height: 100%; - overflow: hidden; +.book-menu > nav > ul { + height: 90vh; + overflow: auto; } .markdown>h1:first-of-type { @@ -153,35 +153,7 @@ blockquote { vertical-align: middle; margin-inline-end: .5rem; } -.book-toc { - flex: 0 0 12rem; - font-size: .75rem; -} -.book-toc div { - padding: 1rem; - position: fixed; - width: 12rem; -} -.book-toc > div nav { - width: auto; - position: relative; - padding: 0; - height: 90vh; -} -.book-menu > nav .toc::-webkit-scrollbar, -.book-toc > div nav::-webkit-scrollbar{ - width: 8px; -} -.book-menu > nav .toc::-webkit-scrollbar-thumb, -.book-toc > div nav::-webkit-scrollbar-thumb{ - background: transparent; -} - -.book-menu > nav:hover .toc::-webkit-scrollbar-thumb, -.book-toc > div nav:hover .toc::-webkit-scrollbar-thumb{ - background: rgba(255,255,255,.1); -} @media screen and (max-width: 56rem) { .book-page { @@ -214,310 +186,3 @@ blockquote { display:none; } } - -.book-toc { - .book-toc-toggles { - top:0px; - opacity: 0.4; - transition: opacity 0.3s ease-in-out; - } - .book-toc-toggles:hover { - opacity: 1; - } - .toc { - top:78px; - } -} - -.toc-label, .dark-mode-toggle-label { - font-size: 10px; - font-weight: 700; - display: block; - color:$gray-600; -} -.gg-menu-motion, .gg-dark-mode { - display: inline-block; - margin-left: 0; - margin-right: 0; - vertical-align: middle; - font-size: 10px; - transform: scale(0.7); -} - -// Colors -.color-incorrect { - color: #BF616A; -} - -.color-wip { - color: #D08770; -} - -.color-incomplete { - color: #EBCB8B; -} - -.color-stable { - color: #5E81AC; -} - -.color-permanent { - color: #A3BE8C; -} - -i[class^="gg-"] { - display: inline-block; - margin-left: 3px; - margin-right: 3px; - vertical-align: text-top; - line-height: 1.6; -} - -// Icons -.gg-permanent { - color: #A3BE8C; - box-sizing: border-box; - position: relative; - display: block; - transform: scale(var(--ggs,1)); - width: 20px; - height: 20px; - border: 2px solid; - border-radius: 100px - } - - .gg-permanent::after { - content: ""; - display: block; - box-sizing: border-box; - position: absolute; - left: 2px; - top: -2px; - width: 6px; - height: 10px; - border-color: currentColor; - border-width: 0 2px 2px 0; - border-style: solid; - transform-origin: bottom left; - transform: rotate(45deg) -} -.gg-stable { - color: #5E81AC; - box-sizing: border-box; - position: relative; - display: block; - transform: scale(var(--ggs,1)); - width: 20px; - height: 20px; - border: 2px solid; - border-radius: 40px - } - - .gg-stable::after, - .gg-stable::before { - content: ""; - display: block; - box-sizing: border-box; - position: absolute; - border-radius: 3px; - width: 2px; - background: currentColor; - left: 7px - } - - .gg-stable::after { - bottom: 2px; - height: 8px - } - - .gg-stable::before { - height: 2px; - top: 2px -} -.gg-incorrect { - color: #BF616A; - box-sizing: border-box; - position: relative; - display: block; - transform: scale(var(--ggs,1)); - width: 20px; - height: 20px; - border: 2px solid; - border-radius: 40px - } - - .gg-incorrect::after, - .gg-incorrect::before { - content: ""; - display: block; - box-sizing: border-box; - position: absolute; - border-radius: 3px; - width: 2px; - background: currentColor; - left: 7px - } - - .gg-incorrect::after { - top: 2px; - height: 8px - } - - .gg-incorrect::before { - height: 2px; - bottom: 2px -} -.gg-incomplete { - color: #EBCB8B; - box-sizing: border-box; - position: relative; - display: block; - transform: rotate(45deg) scale(var(--ggs,1)); - width: 18px; - height: 18px; - border: 2px solid; - border-radius: 100% - } - - .gg-incomplete::after, - .gg-incomplete::before { - content: ""; - display: block; - box-sizing: border-box; - position: absolute; - width: 2px; - height: 7px; - background: currentColor; - border-radius: 5px; - left: 6px - } - - .gg-incomplete::before { - top: -2px - } - - .gg-incomplete::after { - bottom: -2px -} -.gg-wip { - color: #D08770; - transform: scale(var(--ggs,1)) - } - - .gg-wip, - .gg-wip::after, - .gg-wip::before { - box-sizing: border-box; - position: relative; - display: block; - width: 20px; - height: 20px - } - - .gg-wip::after, - .gg-wip::before { - content: ""; - position: absolute; - border-radius: 100px - } - - .gg-wip::before { - animation: spinner 1s - cubic-bezier(.6,0,.4,1) infinite; - border: 3px solid transparent; - border-top-color: currentColor - } - - .gg-wip::after { - border: 3px solid; - opacity: .2 - } - - @keyframes spinner { - 0% { transform: rotate(0deg) } - to { transform: rotate(359deg) } -} - -.gg-menu-motion { - box-sizing: border-box; - position: relative; - display: block; - width: 18px; - height: 14px; - transform: scale(var(--ggs,1)) - } - - .gg-menu-motion::before { - content: ""; - position: absolute; - box-sizing: border-box; - display: block; - width: 10px; - height: 2px; - bottom: 0; - box-shadow: 4px -6px 0,8px -12px 0; - border-radius: 4px; - background: currentColor -} - -.gg-dark-mode { - box-sizing: border-box; - position: relative; - display: block; - transform: scale(var(--ggs,1)); - border:2px solid; - border-radius:100px; - width:20px; - height:20px -} - -.gg-dark-mode::after, -.gg-dark-mode::before { - content: ""; - box-sizing: border-box; - position: absolute; - display: block -} - -.gg-dark-mode::before { - border:5px solid; - border-top-left-radius:100px; - border-bottom-left-radius:100px; - border-right: 0; - width:9px; - height:18px; - top:-1px; - left:-1px -} - -.gg-dark-mode::after { - border:4px solid; - border-top-right-radius:100px; - border-bottom-right-radius:100px; - border-left: 0; - width:4px; - height:8px; - right:4px; - top:4px -} - -.state-badge { - font-size: 10px; - font-weight: 500; -} -.state-badge-link { - text-decoration: none !important; - color: white !important; - &:hover { - text-decoration: none; - } -} -.state-badge-key, .state-badge-value { - padding: 2px 5px; -} -.state-badge-key { - background-color: #555; -} -.section-intro .state-badge { - display: none; -} \ No newline at end of file diff --git a/assets/plugins/_bagdes.scss b/assets/plugins/_bagdes.scss new file mode 100644 index 000000000..6bd5c4a0a --- /dev/null +++ b/assets/plugins/_bagdes.scss @@ -0,0 +1,24 @@ +.section-badges { + float: right; + margin-top:-2.5rem; +} +.state-badge { + font-size: 10px; + font-weight: 500; +} +.state-badge-link { + text-decoration: none !important; + color: white !important; + &:hover { + text-decoration: none; + } +} +.state-badge-key, .state-badge-value { + padding: 2px 5px; +} +.state-badge-key { + background-color: #555; +} +.section-intro .state-badge { + display: none; +} \ No newline at end of file diff --git a/assets/plugins/_scrollbars.scss b/assets/plugins/_scrollbars.scss index 908c6980e..693951561 100644 --- a/assets/plugins/_scrollbars.scss +++ b/assets/plugins/_scrollbars.scss @@ -24,17 +24,20 @@ // code blocks .markdown pre::-webkit-scrollbar { - display: none; -} -.markdown pre:hover::-webkit-scrollbar { - display: initial; + background-color: transparent; } .markdown pre { + scrollbar-color: transparent transparent ; +} +.markdown pre:hover { scrollbar-color: transparent rgba(255, 255, 255, 0.1) ; } .markdown pre::-webkit-scrollbar-thumb { + background-color: transparent; +} +.markdown pre:hover::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.1); } .markdown pre::-webkit-scrollbar-thumb:active { diff --git a/assets/plugins/_toc.scss b/assets/plugins/_toc.scss index cc4b337a5..e632f3911 100644 --- a/assets/plugins/_toc.scss +++ b/assets/plugins/_toc.scss @@ -1,5 +1,5 @@ .toc { - overflow-y: auto; + height: 100%; > ol { height: 90%; overflow: auto; diff --git a/go.mod b/go.mod index e8536a29c..acfdb0710 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,12 @@ module spec go 1.15 require ( - github.com/alex-shpak/hugo-book v0.0.0-20200819182225-6beca7928c20 // indirect + github.com/alex-shpak/hugo-book v0.0.0-20200707210728-615400b3b747 // indirect + github.com/filecoin-project/go-data-transfer v0.6.2 github.com/filecoin-project/go-fil-markets v0.5.7 // indirect github.com/filecoin-project/lotus v0.5.3 // indirect - github.com/filecoin-project/specs-actors v0.9.3 // indirect + github.com/filecoin-project/specs-actors v0.9.3 + github.com/ipfs/go-cid v0.0.7 + github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e + github.com/libp2p/go-libp2p-core v0.6.1 ) diff --git a/go.sum b/go.sum index 2f3c953d2..53530046b 100644 --- a/go.sum +++ b/go.sum @@ -56,6 +56,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alex-shpak/hugo-book v0.0.0-20200707210728-615400b3b747 h1:XuqsYYXFCvHQsSpB08qeDRapdznYZujyfeFAqnDm8kg= +github.com/alex-shpak/hugo-book v0.0.0-20200707210728-615400b3b747/go.mod h1:DvU1VD1ikK0ufuSgldRCwm4kVaEF0cQGdHUp16XjSVI= github.com/alex-shpak/hugo-book v0.0.0-20200819182225-6beca7928c20 h1:xkWkiissWW+nxjH4wKsL5Fx0jFemcoIRGof2PuDta70= github.com/alex-shpak/hugo-book v0.0.0-20200819182225-6beca7928c20/go.mod h1:DvU1VD1ikK0ufuSgldRCwm4kVaEF0cQGdHUp16XjSVI= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= @@ -86,6 +88,7 @@ github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dm github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= +github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= @@ -185,6 +188,7 @@ github.com/filecoin-project/go-bitfield v0.1.2/go.mod h1:CNl9WG8hgR5mttCnUErjcQj github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= +github.com/filecoin-project/go-data-transfer v0.6.2 h1:IgbkwcHoyWGglzfsY7P9L1GapzoiLNKuzfZY2bxER8E= github.com/filecoin-project/go-data-transfer v0.6.2/go.mod h1:uRYBRKVBVM12CSusBtVrzDHkVw/3DKZpkxKJVP1Ydas= github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-markets v0.5.7 h1:kzyMHqez8ssxchj5s9M1hkC3CTwRGh2MeglJGfUksQU= @@ -246,6 +250,7 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= @@ -372,6 +377,7 @@ github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiL github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM= github.com/ipfs/go-bitswap v0.2.8/go.mod h1:2Yjog0GMdH8+AsxkE0DI9D2mANaUTxbVVav0pPoZoug= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= +github.com/ipfs/go-block-format v0.0.2 h1:qPDvcP19izTjU8rgo6p7gTXZlkMkF5bz5G3fqIsSCPE= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= github.com/ipfs/go-blockservice v0.0.3/go.mod h1:/NNihwTi6V2Yr6g8wBI+BSwPuURpBRMtYNGrlxZ8KuI= github.com/ipfs/go-blockservice v0.0.7/go.mod h1:EOfb9k/Y878ZTRY/CH0x5+ATtaipfbRhbvNSdgc/7So= @@ -386,6 +392,7 @@ github.com/ipfs/go-cid v0.0.4/go.mod h1:4LLaPOQwmk5z9LBgQnpkivrx8BJjUyGwTXCd5Xfj github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6-0.20200501230655-7c82f3b81c00/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= +github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cidutil v0.0.2/go.mod h1:ewllrvrxG6AMYStla3GD7Cqn+XYSLqjK0vc+086tB6s= github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= @@ -447,15 +454,18 @@ github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7 github.com/ipfs/go-ipfs-routing v0.0.1/go.mod h1:k76lf20iKFxQTjcJokbPM9iBXVXVZhcOwc360N4nuKs= github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= +github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= github.com/ipfs/go-ipld-cbor v0.0.1/go.mod h1:RXHr8s4k0NE0TKhnrxqZC9M888QfsBN9rhS5NjfKzY8= github.com/ipfs/go-ipld-cbor v0.0.2/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.3/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.4/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-cbor v0.0.5-0.20200204214505-252690b78669/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= +github.com/ipfs/go-ipld-cbor v0.0.5-0.20200428170625-a0bd04d3cbdf h1:PRCy+w3GocY77CBEwTprp6hn7PLiEU1YToKe7B+1FVk= github.com/ipfs/go-ipld-cbor v0.0.5-0.20200428170625-a0bd04d3cbdf/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= +github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL37mwA= github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= github.com/ipfs/go-ipns v0.0.2/go.mod h1:WChil4e0/m9cIINWLxZe1Jtf77oz5L05rO2ei/uKJ5U= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= @@ -492,6 +502,7 @@ github.com/ipfs/interface-go-ipfs-core v0.2.3/go.mod h1:Tihp8zxGpUeE3Tokr94L6zWZ github.com/ipfs/iptb v1.4.0/go.mod h1:1rzHpCYtNp87/+hTxG5TfCVn/yMY3dKnLn8tBiMfdmg= github.com/ipfs/iptb-plugins v0.2.1/go.mod h1:QXMbtIWZ+jRsW8a4h13qAKU7jcM7qaittO8wOsTP0Rs= github.com/ipld/go-car v0.1.1-0.20200526133713-1c7508d55aae/go.mod h1:2mvxpu4dKRnuH3mj5u6KW/tmRSCcXvy/KYiJ4nC6h4c= +github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e h1:ZISbJlM0urTANR9KRfRaqlBmyOj5uUtxs2r4Up9IXsA= github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e/go.mod h1:uVIwe/u0H4VdKv3kaN1ck7uCb6yD9cFLS9/ELyXbsw8= github.com/ipld/go-ipld-prime-proto v0.0.0-20200428191222-c1ffdadc01e1/go.mod h1:OAV6xBmuTLsPZ+epzKkPB1e25FHk/vCtyatkdHcArLs= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52/go.mod h1:fdg+/X9Gg4AsAIzWpEHwnqd+QY3b7lajxyjE1m4hkq4= @@ -550,6 +561,7 @@ github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= +github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40JQWnayTvNMgD/vyk= github.com/libp2p/go-conn-security-multistream v0.0.1/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= @@ -628,6 +640,7 @@ github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqe github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= +github.com/libp2p/go-libp2p-core v0.6.1 h1:XS+Goh+QegCDojUZp00CaPMfiEADCrLjNZskWE7pvqs= github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= @@ -840,11 +853,13 @@ github.com/miekg/dns v1.1.4/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nr github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.30/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU= github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -862,8 +877,11 @@ github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVq github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= +github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= github.com/multiformats/go-multiaddr v0.0.1/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= github.com/multiformats/go-multiaddr v0.0.2/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= @@ -872,6 +890,7 @@ github.com/multiformats/go-multiaddr v0.1.0/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lg github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= github.com/multiformats/go-multiaddr v0.2.1/go.mod h1:s/Apk6IyxfvMjDafnhJgJ3/46z7tZ04iMk5wP4QMGGE= +github.com/multiformats/go-multiaddr v0.2.2 h1:XZLDTszBIJe6m0zF6ITBrEcZR73OPUhCBBS9rYAuUzI= github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= @@ -889,6 +908,7 @@ github.com/multiformats/go-multiaddr-net v0.1.4/go.mod h1:ilNnaM9HbmVFqsb/qcNysj github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.2/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= +github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= @@ -897,6 +917,7 @@ github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa github.com/multiformats/go-multihash v0.0.9/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= +github.com/multiformats/go-multihash v0.0.14 h1:QoBceQYQQtNUuf6s7wHxnE2c8bhbMqhfGzNI032se/I= github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= @@ -906,6 +927,7 @@ github.com/multiformats/go-multistream v0.1.2/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -966,6 +988,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190408063855-01bf1e26dd14/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= +github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a h1:hjZfReYVLbqFkAtr2us7vdy04YWz3LVAirzP7reh8+M= github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -1060,6 +1083,7 @@ github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -1120,6 +1144,7 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20200715143311-227fab5a2377/go.mod h1:f github.com/whyrusleeping/cbor-gen v0.0.0-20200723185710-6a3894a6352b/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200810223238-211df3b9e24c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200812213548-958ddffe352c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20200814224545-656e08ce49ee h1:U7zWWvvAjT76EiuWPSOiZlQDnaQYPxPoxugTtTAcJK0= github.com/whyrusleeping/cbor-gen v0.0.0-20200814224545-656e08ce49ee/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= github.com/whyrusleeping/go-ctrlnet v0.0.0-20180313164037-f564fbbdaa95/go.mod h1:SJqKCCPXRfBFCwXjfNT/skfsceF7+MBFLI2OrvuRA7g= @@ -1212,6 +1237,7 @@ golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200427165652-729f1e841bcc/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1367,6 +1393,7 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200427175716-29b57079015a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 h1:OjiUf46hAmXblsZdnoSXsEUSKU8r1UEzcL5RVZ4gO9Y= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1423,6 +1450,7 @@ golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWc golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= diff --git a/layouts/partials/docs/html-head.html b/layouts/partials/docs/html-head.html index d0f07921b..510c49dda 100644 --- a/layouts/partials/docs/html-head.html +++ b/layouts/partials/docs/html-head.html @@ -22,20 +22,11 @@ {{- $styles := resources.Get "book.scss" | resources.ExecuteAsTemplate "book.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }} -{{- $darkStyles := resources.Get "book-dark.scss" | resources.ExecuteAsTemplate "book-dark.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint }} - + + -{{- $darkModeJS := resources.Get "dark-mode/dark-mode.js" | resources.Minify | resources.Fingerprint }} - - -{{- if default true ($.Param "math-mode") -}} - -{{- end -}} - -{{- if .Site.Params.BookServiceWorker }} -{{- $swJS := resources.Get "sw-register.js" | resources.ExecuteAsTemplate "sw.js" . | resources.Minify | resources.Fingerprint }} - -{{ end -}} + + {{- template "_internal/google_analytics_async.html" . -}} diff --git a/layouts/partials/docs/inject/body.html b/layouts/partials/docs/inject/body.html index 942434c81..ca776c142 100644 --- a/layouts/partials/docs/inject/body.html +++ b/layouts/partials/docs/inject/body.html @@ -1,25 +1,10 @@ +{{ if ne .Site.IsServer true }} - + +{{end}} {{- if default true .Site.Params.BookSearch }} {{- $searchJSFile := printf "%s.search.js" .Language.Lang }} {{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate $searchJSFile . | resources.Minify | resources.Fingerprint }} -{{ end -}} - -{{- if default false ($.Param "math-mode") -}} - - - -{{- end -}} \ No newline at end of file +{{ end -}} \ No newline at end of file diff --git a/layouts/shortcodes/embed.html b/layouts/shortcodes/embed.html index f2a2043e1..9ecf76507 100644 --- a/layouts/shortcodes/embed.html +++ b/layouts/shortcodes/embed.html @@ -8,17 +8,66 @@ {{ $.Scratch.Add "filepath" ( .Get "src" ) }} {{ end }} -{{ if fileExists ($.Scratch.Get "filepath") }} - {{if eq (.Get "markdown") "true" }} - {{ $.Scratch.Get "filepath" | readFile | markdownify }} - {{ else if (.Get "lang") }} - {{ highlight ($.Scratch.Get "filepath" | readFile | safeHTML ) (.Get "lang") "" }} +{{ $path := ($.Scratch.Get "filepath")}} +{{ $lang := .Get "lang" }} +{{ $markdown := .Get "markdown" }} +{{ $symbolName := .Get "symbol" }} + + +{{ if fileExists $path }} + {{ if eq $markdown "true" }} + {{ $path | readFile | markdownify }} + {{ else if $symbolName }} + + {{ $content := readFile $path }} + {{ $body := "" }} + {{ $comment := "" }} + + + + {{ $pattern2 := printf "(?m)(^\\n^((//.*\\n)*)(func(\\s\\([^\\)]+\\))?\\s%s\\([\\s\\S]+?\\n}))" $symbolName}} + {{ $block := index (findRE $pattern2 $content ) 0}} + {{ $comment = replaceRE $pattern2 "$2" $block }} + {{ $body = replaceRE $pattern2 "$4" $block }} + + + + {{- if eq $body "" -}} + {{ $patternStruct := printf "(?m)(^\\n^((//.*\\n)*)(type %s struct \\{[\\s\\S]+?\\n}))" $symbolName}} + {{ $block := index (findRE $patternStruct $content ) 0}} + {{ $comment = replaceRE $patternStruct "$2" $block }} + {{ $body = replaceRE $patternStruct "$4" $block }} + {{- end -}} + + + {{- if eq $body "" -}} + {{ $patternStruct := printf "(?m)(^\\n^((//.*\\n)*)(type %s interface \\{[\\s\\S]+?\\n}))" $symbolName}} + {{ $block := index (findRE $patternStruct $content ) 0}} + {{ $comment = replaceRE $patternStruct "$2" $block }} + {{ $body = replaceRE $patternStruct "$4" $block }} + {{- end -}} + + {{- if $body }} +

+ {{ (replace $comment "//" "") | .Page.RenderString }} +

+
+ {{ highlight ($body | safeHTML) $lang "" }} +
+ {{- else -}} +
+ {{- printf "Symbol '%s' not found in file '%s' from Page '%s'" $symbolName $path .Page.File }} +
+ {{- errorf "Symbol '%s' not found in file '%s' from Page '%s'" $symbolName $path .Page.File }} + {{- end -}} + {{ else if $lang }} + {{ highlight ($path | readFile | safeHTML ) (.Get "lang") "" }} {{ else }} - {{ $.Scratch.Get "filepath" | readFile | safeHTML }} + {{ $path | readFile | safeHTML }} {{ end }} {{ else }}
- {{- printf "File '%s' not found from Page '%s'" ($.Scratch.Get "filepath") .Page.File }} + {{- printf "File '%s' not found from Page '%s'" ($path) .Page.File }}
- {{- warnf "File '%s' not found from Page '%s'" ($.Scratch.Get "filepath") .Page.File }} + {{- warnf "File '%s' not found from Page '%s'" ($path) .Page.File }} {{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/listing.html b/layouts/shortcodes/listing.html new file mode 100644 index 000000000..2d2d31e10 --- /dev/null +++ b/layouts/shortcodes/listing.html @@ -0,0 +1,85 @@ +{{/* Get the filepath */}} +{{/* Relative to content folder */}} +{{ if eq (.Get "src" | printf "%.1s") "/" }} + {{ $.Scratch.Set "filepath" ( strings.TrimLeft "/" ( .Get "src" ))}} +{{ else }} +{{/* Relative to page */}} + {{ $.Scratch.Set "filepath" $.Page.File.Dir }} + {{ $.Scratch.Add "filepath" ( .Get "src" ) }} +{{ end }} +{{ $path := ($.Scratch.Get "filepath")}} +{{ $lang := .Get "lang" }} +{{ $symbolName := .Get "symbol" }} + +{{ if fileExists $path }} + {{ $content := readFile $path }} + {{ $body := "" }} + {{ $comment := "" }} + + + + {{ $pattern2 := printf "(?m)(^\\n^((//.*\\n)*)(func(\\s\\([^\\)]+\\))?\\s%s\\([\\s\\S]+?\\n}))" $symbolName}} + {{ $block := index (findRE $pattern2 $content ) 0}} + {{ $comment = replaceRE $pattern2 "$2" $block }} + {{ $body = replaceRE $pattern2 "$4" $block }} + + + + {{- if eq $body "" -}} + {{ $patternStruct := printf "(?m)(^\\n^((//.*\\n)*)(type %s struct \\{[\\s\\S]+?\\n}))" $symbolName}} + {{ $block := index (findRE $patternStruct $content ) 0}} + {{ $comment = replaceRE $patternStruct "$2" $block }} + {{ $body = replaceRE $patternStruct "$4" $block }} + {{- end -}} + + + {{- if eq $body "" -}} + {{ $patternStruct := printf "(?m)(^\\n^((//.*\\n)*)(type %s interface \\{[\\s\\S]+?\\n}))" $symbolName}} + {{ $block := index (findRE $patternStruct $content ) 0}} + {{ $comment = replaceRE $patternStruct "$2" $block }} + {{ $body = replaceRE $patternStruct "$4" $block }} + {{- end -}} + + {{- if $body }} +

+ {{ (replace $comment "//" "") | .Page.RenderString }} +

+
+ {{ $parts := split $body "\n" }} + {{ $partsFirst := first (sub (len $parts) 1) $parts }} + {{ $partsLast := last (sub (len $partsFirst) 1) $partsFirst }} + + + + + + + + + + {{- range $partsLast -}} + {{- $pattern := printf "(?m)(^\\t([\\S]*)\\s*([\\S]*)(\\s//\\s(.*))?)" -}} + {{- $name := replaceRE $pattern "$2" . -}} + {{- $type := replaceRE $pattern "$3" . -}} + {{- $desc := replaceRE $pattern "$5" . -}} + + + + + + {{- end -}} + +
NameTypeDescription
{{ $name }}{{ $type }}{{ $desc }}
+
+ {{- else -}} +
+ {{- printf "Symbol '%s' not found in file '%s' from Page '%s'" $symbolName $path .Page.File }} +
+ {{- errorf "Symbol '%s' not found in file '%s' from Page '%s'" $symbolName $path .Page.File }} + {{- end -}} +{{ else }} +
+ {{- printf "File '%s' not found from Page '%s'" $path .Page.File }} +
+ {{- errorf "File '%s' not found from Page '%s'" $path .Page.File }} +{{ end }} \ No newline at end of file From b6d4257b48472c308b5e94d0a66870a1f6b0e4d6 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Wed, 2 Sep 2020 15:24:27 +0100 Subject: [PATCH 16/27] fix: css for label style and dashboard link (#1136) * fix the css for toc-label and make re-usable as a .label class * fix: css for dashboard audit links fixes #1135 License: MIT Signed-off-by: Oli Evans --- assets/_custom.scss | 7 +++++++ assets/_dashboard.scss | 5 +++++ layouts/partials/docs/toc.html | 2 +- layouts/partials/single/menu-single.html | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/assets/_custom.scss b/assets/_custom.scss index 2ef16ecff..cc79639a0 100644 --- a/assets/_custom.scss +++ b/assets/_custom.scss @@ -96,6 +96,13 @@ outline: none; } +.label { + font-size: 10px; + font-weight: 700; + display: block; + color:$gray-600; +} + // Tweaks html { scroll-behavior: auto; diff --git a/assets/_dashboard.scss b/assets/_dashboard.scss index d09a2b4ba..b849888dc 100644 --- a/assets/_dashboard.scss +++ b/assets/_dashboard.scss @@ -16,6 +16,11 @@ table.Dashboard { th:first-child { width: 50%; } + .gg-external { + display: inline-block; + margin-left: 3px; + vertical-align: text-top; + } } .Dashboard tr th, diff --git a/layouts/partials/docs/toc.html b/layouts/partials/docs/toc.html index ca5ad9631..43a8f2975 100644 --- a/layouts/partials/docs/toc.html +++ b/layouts/partials/docs/toc.html @@ -1,4 +1,4 @@
-

CONTENTS

+

CONTENTS

{{ .TableOfContents }}
diff --git a/layouts/partials/single/menu-single.html b/layouts/partials/single/menu-single.html index b71db7ddf..60e35ddee 100644 --- a/layouts/partials/single/menu-single.html +++ b/layouts/partials/single/menu-single.html @@ -1,6 +1,6 @@
-

TABLE OF CONTENTS

+

TABLE OF CONTENTS

From 55a72c363515de432db4a622bad342876daeafd0 Mon Sep 17 00:00:00 2001 From: David Dias Date: Wed, 2 Sep 2020 16:24:33 +0100 Subject: [PATCH 17/27] content: fix typo plus remove definition of weight (#1138) --- content/intro/_index.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/content/intro/_index.md b/content/intro/_index.md index dbebd46c7..68b0a4285 100644 --- a/content/intro/_index.md +++ b/content/intro/_index.md @@ -36,7 +36,6 @@ Each section of the spec must be stable and audited before it is considered done - The **State** column indicates the stability as defined in the legend. - The **Theory Audit** column shows the date of the last theory audit with a link to the report. -- The **Weight** column is used to highlight the relative criticality of a section against the others. ### Spec Status Legend @@ -74,7 +73,7 @@ Each section of the spec must be stable and audited before it is considered done ### Spec Status Overview
-### Spec Stabilization Progess +### Spec Stabilization Progress This progress bar shows what percentage of the spec sections are considered stable. @@ -85,4 +84,4 @@ This progress bar shows what percentage of the spec sections are considered stab Known implementations of the filecoin spec are tracked below, with their current CI build status, their test coverage as reported by [codecov.io](https://codecov.io), and a link to their last security audit report where one exists. -{{}} \ No newline at end of file +{{}} From a13ce946e8550094e9f6e648801e652f3a98e832 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Wed, 2 Sep 2020 16:25:54 +0100 Subject: [PATCH 18/27] feat: show wip and reliable in progress bar (#1137) show wip, reliable and stable percentages in the progress bar as a stacked bar chart. fixes #1119 License: MIT Signed-off-by: Oli Evans --- assets/plugins/_meter.scss | 17 ++++++++ layouts/shortcodes/dashboard-progress.html | 46 ++++++++++------------ 2 files changed, 37 insertions(+), 26 deletions(-) create mode 100644 assets/plugins/_meter.scss diff --git a/assets/plugins/_meter.scss b/assets/plugins/_meter.scss new file mode 100644 index 000000000..42f840cb6 --- /dev/null +++ b/assets/plugins/_meter.scss @@ -0,0 +1,17 @@ +.meter { + height: 24px; /* Can be anything */ + background: #EBEBEB; + border-radius: 4px; + color: #222; + border-radius: 4px; + overflow: hidden; +} +.meter > .bar { + display: inline-block; + height: 100%; + line-height: 24px; + text-align: right; + font-size: 12px; + padding-right: 1em; + vertical-align: top; +} \ No newline at end of file diff --git a/layouts/shortcodes/dashboard-progress.html b/layouts/shortcodes/dashboard-progress.html index af286b1db..fee819e3d 100644 --- a/layouts/shortcodes/dashboard-progress.html +++ b/layouts/shortcodes/dashboard-progress.html @@ -6,9 +6,9 @@ {{ define "dashboard-progress" }} {{- $count := .level -}} - {{- $countWeight:= 0 -}} {{- $stable := 0 -}} - {{- $stableWeight := 0 -}} + {{- $reliable := 0 -}} + {{- $wip := 0 -}} {{- $pages := where .Site.AllPages "Params.bookhidden" "ne" true -}} {{- $pages2 := where $pages "Params.dashboardhidden" "ne" true -}} {{- $pages3 := where $pages2 "Kind" "in" (slice "section" "page") -}} @@ -16,35 +16,29 @@ {{- range sort $pages4 "Weight" "asc" -}} {{- if .Params.dashboardState -}} {{- $count = add $count 1 -}} - {{- $countWeight = add $countWeight (mul 1 (float .Params.dashboardWeight)) -}} {{- if eq .Params.dashboardState "stable" -}} {{- $stable = add $stable 1 -}} - {{- $stableWeight = add $stableWeight (mul 1 (float .Params.dashboardWeight)) -}} + {{- end -}} + {{- if eq .Params.dashboardState "reliable" -}} + {{- $reliable = add $reliable 1 -}} + {{- end -}} + {{- if eq .Params.dashboardState "wip" -}} + {{- $wip = add $wip 1 -}} {{- end -}} {{- end -}} {{- end -}} - {{- $perc := lang.NumFmt 0 (div (float (mul $stable 100)) (float $count)) -}} - {{- $perc2 := lang.NumFmt 0 (div (mul $stableWeight 100) $countWeight) -}} - + {{- $total := (add $stable (add $reliable $wip)) }} + {{- $usable := add $stable $reliable }} + {{- $stablePercent := lang.NumFmt 0 (div (float (mul $stable 100)) (float $count)) -}} + {{- $reliablePercent := lang.NumFmt 0 (div (float (mul $reliable 100)) (float $count)) -}} + {{- $wipPercent := lang.NumFmt 0 (div (float (mul $wip 100)) (float $count)) -}} + {{- $totalPercent := lang.NumFmt 0 (div (float (mul $total 100)) (float $count)) -}} + {{- $usablePercent := lang.NumFmt 0 (div (float (mul $usable 100)) (float $count)) -}}
- {{$perc}}% + WIP {{$wipPercent}}% + Reliable {{$reliablePercent}}% + Stable {{$stablePercent}}% + + {{/* total {{$totalPercent}}% */}}
- {{ end }} \ No newline at end of file From eb7bd35f2e8293fb89742f91d983c8dac44a28d4 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Wed, 2 Sep 2020 16:28:58 +0100 Subject: [PATCH 19/27] feat: build toc and dashboard in hugo (#1122) - Avoid building the ToC and the dashboard on the client side by parse data from dom and building the toc from data. Generates a toc.json file in the hugo data dir, which is then used by the toc partial and the dashboard-spec shortcode. fixes #1125 - Refactor watchers. Add watch.js to configure chokidar. Pass watcher to each tool via an exported `configureWatcher` method. Allow tools to be run as scripts or required as modules see #1133 License: MIT Signed-off-by: Oli Evans --- .gitignore | 3 +- assets/js/content-model.js | 62 ------------------ assets/js/dashboard-spec.js | 76 ---------------------- assets/js/main.js | 6 -- assets/js/toc.js | 36 ---------- content/intro/_index.md | 3 +- data/.gitkeep | 0 layouts/partials/single/menu-single.html | 1 + layouts/partials/toc.html | 17 +++++ layouts/shortcodes/dashboard-spec.html | 76 ++++++++++++---------- package.json | 10 +-- tools/diagrams.js | 76 +++++++++------------- tools/toc.js | 54 +++++++++++++++ tools/toc/build-model.js | 83 ++++++++++++++++++++++++ tools/watch.js | 23 +++++++ 15 files changed, 262 insertions(+), 264 deletions(-) delete mode 100644 assets/js/content-model.js delete mode 100644 assets/js/dashboard-spec.js delete mode 100644 assets/js/toc.js create mode 100644 data/.gitkeep create mode 100644 layouts/partials/toc.html create mode 100755 tools/toc.js create mode 100644 tools/toc/build-model.js create mode 100755 tools/watch.js diff --git a/.gitignore b/.gitignore index 269b09ae5..21308525f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ public/ yarn.lock node_modules resources -static/_gen \ No newline at end of file +static/_gen +data/toc.json \ No newline at end of file diff --git a/assets/js/content-model.js b/assets/js/content-model.js deleted file mode 100644 index aa50912fe..000000000 --- a/assets/js/content-model.js +++ /dev/null @@ -1,62 +0,0 @@ -// [ -// { text: "Foo", id: "foo", tagName: 'h1', children: [ -// { text: "Xyz", id: "xyz", tagName: 'h2', children: [ -// { text: "Bar", id: "bar", tagName: 'h3, children:[] } -// { text: "Bar", id: "bar", tagName: 'h3, children:[] } -// ]} -// ]}, -// { text: "Baz", id: "baz", tag: 'h1', children: [] } -// ] - -function buildTocModel (contentSelector) { - const model = [] - const headingList = document.querySelector(contentSelector).querySelectorAll('h1,h2,h3,h4,h5,h6') - let parents = [{tagName: 'H0', children: model}] - let prevSibling = null - for (let el of headingList) { - let node = { - id: el.id, - tagName: el.tagName, - text: cleanHeadingText(el), - page: Boolean(el.dataset.page), - dashboardWeight: el.dataset.dashboardWeight, - dashboardAudit: el.dataset.dashboardAudit, - dashboardAuditURL: el.dataset.dashboardAuditUrl, - dashboardAuditDate: el.dataset.dashboardAuditDate, - dashboardState: el.dataset.dashboardState, - children: [] - } - if (!prevSibling || headingNum(node) === headingNum(prevSibling)) { - parents[parents.length - 1].children.push(node) - prevSibling = node - - // is h3 > h2 ? - } else if (headingNum(node) > headingNum(prevSibling)) { - parents.push(prevSibling) - prevSibling.children.push(node) - prevSibling = node - } else { - // h2 or h1 after an h3... gotta find out how far to unwind, parents may not be contiguous in a bad doc, so we walk. - let prevParent = parents.pop() - while (headingNum(node) <= headingNum(prevParent)) { - prevParent = parents.pop() - } - prevParent.children.push(node) - parents.push(prevParent) - prevSibling = node - } - } - return model - } - - function cleanHeadingText (el) { - return el.textContent.trim() - } - - function headingNum (el) { - return Number(el.tagName[1]) - } - - export { - buildTocModel - } \ No newline at end of file diff --git a/assets/js/dashboard-spec.js b/assets/js/dashboard-spec.js deleted file mode 100644 index 149ae2b9c..000000000 --- a/assets/js/dashboard-spec.js +++ /dev/null @@ -1,76 +0,0 @@ -import {html, render} from 'lit-html'; - -const tableData = (model, depth, output=[]) => { - const index = depth.length-1 - for (const node of model) { - depth[index] += 1 - output.push({number: depth.join("."), ...node}) - if (node.children) { - tableData(node.children, [...depth, 0], output) - } - } - return output -} - -const humanize = (input) => { - if(input === 'wip') { - return 'Draft/WIP' - } - - if(input === 'n/a') { - return '' - } - - return input.charAt(0).toUpperCase() + input.substr(1); -} - -const stateToNumber = (s) => { - switch (s) { - case 'done': - case 'stable': - return 1 - case 'reliable': - return 2 - case 'wip': - return 3 - case 'incorrect': - return 4 - case 'missing': - return 5 - default: - return 6 - } -} - -function buildDashboard(selector, model) { - const data = tableData(model, [0]) - const tpl = html` - - - - - - - - - - ${data.map((i)=> i.page ? html` - - - - - - `: '')} - -
SectionStateTheory Audit
${i.number} ${i.text}${humanize(i.dashboardState)} - ${i.dashboardAuditURL - ? html`${i.dashboardAuditDate}` - : humanize(i.dashboardAudit) } -
- ` - render(tpl, document.querySelector(selector)) -} - -export { - buildDashboard -} \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js index c0feaf4a9..6aac1c22d 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,9 +1,6 @@ import '@pwabuilder/pwaupdate' -import { initToc } from './toc.js' import tablesort from 'tablesort' import Gumshoe from 'gumshoejs' -import { buildTocModel } from './content-model' -import { buildDashboard } from './dashboard-spec' import { renderKatex } from './katex'; import { lightbox } from './lightbox' // Note: the tablesort lib is not ESM friendly, and the sorts expect `Tablesort` to be available on the global @@ -48,9 +45,6 @@ function initTocScrollSpy () { } window.addEventListener('DOMContentLoaded', () => { - const model = buildTocModel('.markdown') - initToc({tocSelector:'.toc', model }) - buildDashboard('#dashboard-container', model) initTocDepthSlider() initTocScrollSpy() initTableSort() diff --git a/assets/js/toc.js b/assets/js/toc.js deleted file mode 100644 index 39afa3815..000000000 --- a/assets/js/toc.js +++ /dev/null @@ -1,36 +0,0 @@ -function initToc ({tocSelector, model}) { - const toc = buildTocDom(model) - document.querySelector(tocSelector).appendChild(toc) -} - -function buildTocDom (model) { - const parent = document.createDocumentFragment() - buildList(parent, model, 0) - return parent -} - -function buildList (parent, children, depth) { - let ol = createList(depth) - parent.append(ol) - for (node of children) { - let li = document.createElement('li') - let a = document.createElement('a') - a.setAttribute('href', '#' + node.id) - a.innerText = node.text - li.appendChild(a) - ol.append(li) - if (node.children) { - buildList(li, node.children, depth + 1) - } - } -} - -function createList(depth) { - const ol = document.createElement('ol') - ol.className = 'depth-' + depth - return ol -} - -export { - initToc -} diff --git a/content/intro/_index.md b/content/intro/_index.md index 68b0a4285..3946ff2cc 100644 --- a/content/intro/_index.md +++ b/content/intro/_index.md @@ -71,7 +71,8 @@ Each section of the spec must be stable and audited before it is considered done ### Spec Status Overview -
+ +{{}} ### Spec Stabilization Progress diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/layouts/partials/single/menu-single.html b/layouts/partials/single/menu-single.html index 60e35ddee..e0d6a5448 100644 --- a/layouts/partials/single/menu-single.html +++ b/layouts/partials/single/menu-single.html @@ -3,4 +3,5 @@

TABLE OF CONTENTS

+ {{ partial "toc" . }} diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html new file mode 100644 index 000000000..2136fca6a --- /dev/null +++ b/layouts/partials/toc.html @@ -0,0 +1,17 @@ +{{ define "toc-list" }} + {{ $depth := .depth }} +
    + {{ range .children }} +
  1. + {{.text}} + {{ if gt (len .children) 0 }} + {{ template "toc-list" (dict "children" .children "depth" (add 1 $depth) ) }} + {{ end }} +
  2. + {{ end }} +
+{{ end }} + +{{ if isset .Site.Data "toc" }} + {{ template "toc-list" (dict "children" .Site.Data.toc "depth" 0 )}} +{{ end }} diff --git a/layouts/shortcodes/dashboard-spec.html b/layouts/shortcodes/dashboard-spec.html index 9ebbafb2d..f9639fa4e 100644 --- a/layouts/shortcodes/dashboard-spec.html +++ b/layouts/shortcodes/dashboard-spec.html @@ -1,59 +1,69 @@ -{{- with .Site.GetPage "/" -}} +{{ if isset .Site.Data "toc" }} + {{ template "dashboard-spec" (dict "children" .Site.Data.toc "number" 0 )}} +{{ end }} + +{{ define "dashboard-spec" }} - - {{- template "dashboard-section-children" (dict "Section" . "level" 0) -}} + {{ range .children }} + {{- template "dashboard-spec-tr" . -}} + {{ end }}
SectionWeight State Theory Audit
-{{- end -}} +{{ end }} - -{{ define "dashboard-section-children" }} - {{- $level := .level -}} - {{- $level = mul $level 10 -}} - {{- $pages := where .Section.Pages "Params.bookhidden" "ne" true -}} - {{- $pages2 := where $pages "Params.dashboardhidden" "ne" true -}} - {{- range sort $pages2 "Weight" "asc" -}} - {{- $level = add $level 1 -}} - {{- if (or (lt $level 200) (gt $level 10000)) -}} - {{ template "dashboard-section-children" (dict "Section" . "level" $level) }} - {{- else if .IsSection -}} - {{ template "dashboard-tr" (dict "Page" . "Level" $level) }} - {{ template "dashboard-section-children" (dict "Section" . "level" $level) }} - {{ else if and .IsPage .Content }} - {{ template "dashboard-tr" (dict "Page" . "Level" $level) }} - {{ end }} +{{ define "stateToNumber" }} + {{- $num := 6 -}} + {{- if eq . "done" -}}{{$num = 1}}{{end}} + {{- if eq . "stable" -}}{{$num = 1}}{{end}} + {{- if eq . "reliable" -}}{{$num = 2}}{{end}} + {{- if eq . "wip" -}}{{$num = 3}}{{end}} + {{- if eq . "incorrect" -}}{{$num = 4}}{{end}} + {{- if eq . "missing" -}}{{$num = 5}}{{end}} + {{- $num -}} +{{end}} + +{{ define "humanizeState" }} + {{- if eq . "wip" -}} + Draft/WIP + {{- else if eq . "n/a" -}} + {{ else }} + {{ humanize . }} {{ end }} {{ end }} -{{- define "dashboard-tr" -}} +{{- define "dashboard-spec-tr" -}} - {{- delimit (split .Level "") "." }} - {{ template "portable-link" (dict "Destination" .Page.File.Path "Text" .Page.Title "Page" .Page) }} + + {{.number}} {{.text}} - - - {{- (default 0 .Page.Params.dashboardWeight) -}} - - {{- if eq .Page.Params.dashboardState "wip" -}} - WIP - {{- else -}} - {{- (default "N/A" (humanize .Page.Params.dashboardState)) -}} - {{- end -}} + + {{ template "humanizeState" .dashboardState }} - {{ .Page.Params.dashboardaudit }} + + {{- if eq .dashboardAuditURL "" -}} + {{ template "humanizeState" .dashboardAudit }} + {{ else }} + {{.dashboardAuditDate}} + {{ end }} + +{{ range .children }} + {{ if .page }} + {{- template "dashboard-spec-tr" . -}} + {{ end }} +{{ end }} {{- end -}} \ No newline at end of file diff --git a/package.json b/package.json index ad327dae7..2cff736d8 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,11 @@ "test": "remark content --quiet", "start": "concurrently npm:watch-*", "serve": "npm start", - "watch-hugo": "npm run build-diagrams && hugo server --bind=0.0.0.0 --disableFastRender", - "watch-diagrams": "tools/diagrams.js --watch", - "build": "npm run build-diagrams && hugo --gc --minify", - "build-diagrams": "tools/diagrams.js --all", + "watch-hugo": "npm run build-diagrams && hugo server --bind=0.0.0.0 --disableFastRender --renderToDisk", + "watch-assets": "tools/watch.js --watch", + "build": "npm run build-diagrams && hugo --quiet && npm run build-toc && hugo --gc --minify", + "build-diagrams": "tools/diagrams.js", + "build-toc": "tools/toc.js", "clean": "premove public resources static/_gen && hugo mod clean --all && hugo mod tidy", "release": "np --no-publish && conventional-github-releaser -p angular" }, @@ -41,6 +42,7 @@ "globby": "^11.0.1", "graphviz-cli": "^1.0.0", "hugo-extended": "^0.74.3", + "jsdom": "^16.4.0", "np": "^6.5.0", "premove": "^3.0.1" } diff --git a/tools/diagrams.js b/tools/diagrams.js index 680dcbd07..ca3eae333 100755 --- a/tools/diagrams.js +++ b/tools/diagrams.js @@ -4,12 +4,11 @@ const globby = require('globby'); const execa = require('execa') const path = require('path') const fs = require('fs') -const chokidar = require('chokidar'); const runMmd = (p) => { - const outDir =path.dirname(p).replace('content/', 'static/_gen/diagrams/') + const outDir = path.dirname(p).replace('content/', 'static/_gen/diagrams/') const outFile = path.basename(p).replace('.mmd', '.svg') - + fs.mkdirSync(outDir, { recursive: true }) return execa('mmdc', [ @@ -19,7 +18,7 @@ const runMmd = (p) => { } const runMmdAll = async () => { - const paths = await globby(['content/**/*.mmd']); + const paths = await globby(['content/**/*.mmd']); await Promise.all(paths.map(runMmd)) } @@ -39,50 +38,37 @@ const runDotAll = async () => { await Promise.all(paths.map(runDot)) } - const run = async () => { const args = process.argv.slice(2); + console.log('Processing *.{mmd,dot}'); + console.time('Processed *.{mmd,dot}') + await Promise.all([ + runDotAll(), + runMmdAll() + ]) + console.timeEnd('Processed *.{mmd,dot}') +} - if(args[0] === '--all') { - console.log('Processing *.{mmd,dot}'); - await Promise.all([ - runDotAll(), - runMmdAll() - ]) - console.log('Done'); - } - - if(args[0] === '--watch') { - chokidar - .watch('content/**/*.{dot,mmd}', { - awaitWriteFinish: { - stabilityThreshold: 1000, - pollInterval: 100 - }, - ignoreInitial: true - }) - .on('all', async (event, p) => { - console.log(event, p); - const ext = path.extname(p) - switch (ext) { - case ".dot": - await runDot(p) - console.log('done ', p) - break; - case ".mmd": - await runMmd(p) - console.log('done ', p) - break - default: - break; - } - }) - .on('ready', () => { - console.log(`Watching 'content/**/*.{dot,mmd}'`); - }) - .on('error', err => console.error('error watching: ', err)); +module.exports.configureWatcher = (watcher) => { + watcher.on('all', async (_, p) => { + const ext = path.extname(p) + switch (ext) { + case ".dot": + await runDot(p) + console.log('done ', p) + break; + case ".mmd": + await runMmd(p) + console.log('done ', p) + break + default: + break; } - + }) + watcher.add('content/**/*.{mmd,dot}') } -run() +// run as script, so do the thing +if (require.main === module) { + run() +} diff --git a/tools/toc.js b/tools/toc.js new file mode 100755 index 000000000..76025ec55 --- /dev/null +++ b/tools/toc.js @@ -0,0 +1,54 @@ +#!/usr/bin/env node + +const jsdom = require('jsdom') +const path = require('path') +const fs = require('fs') +const { buildTocModel } = require('./toc/build-model') + +const src = 'public/index.html' +const dest = 'data/toc.json' + +// run as script, so do the thing +if (require.main === module) { + run(src, dest) +} + +async function run (src, dest) { + console.log('Building toc.json') + console.time('Built toc.json') + await buildToc(src, dest) + console.timeEnd('Built toc.json') +} + +async function buildToc (src, dest) { + if (!fs.existsSync(path.dirname(dest))) { + fs.mkdirSync(path.dirname(dest)) + } + const dom = await jsdom.JSDOM.fromFile(src) + const model = buildTocModel(dom.window.document.querySelector('.markdown')) + const json = JSON.stringify(model, null, 2) + let prev = Buffer.from('') + try { + prev = fs.readFileSync(dest) + } catch { + // ok, no previous data. + } + if (!Buffer.from(json).equals(prev)) { + try { + fs.writeFileSync(dest, json) + console.log(`Updated toc.json`) + } catch (err) { + return console.error(err) + } + } +} + +module.exports.configureWatcher = (watcher) => { + watcher.on('all', async (_, p) => { + if (p === src) { + await buildToc(src, dest) + } + }) + + watcher.add(src) +} diff --git a/tools/toc/build-model.js b/tools/toc/build-model.js new file mode 100644 index 000000000..beb5416b4 --- /dev/null +++ b/tools/toc/build-model.js @@ -0,0 +1,83 @@ +// [ +// { text: "Foo", id: "foo", tagName: 'h1', children: [ +// { text: "Xyz", id: "xyz", tagName: 'h2', children: [ +// { text: "Bar", id: "bar", tagName: 'h3, children:[] } +// { text: "Bar", id: "bar", tagName: 'h3, children:[] } +// ]} +// ]}, +// { text: "Baz", id: "baz", tag: 'h1', children: [] } +// ] + +function buildTocModel (root) { + const model = [] + const headingList = root.querySelectorAll('h1,h2,h3,h4,h5,h6') + let parents = [{tagName: 'H0', children: model}] + let prevSibling = null + let sectionNumber = [0] + + function addSibling(node) { + sectionNumber[sectionNumber.length - 1] = sectionNumber[sectionNumber.length - 1] + 1 + node.number = sectionNumber.join('.') + parents[parents.length - 1].children.push(node) + prevSibling = node + } + + function addChild(node) { + sectionNumber.push(1) + node.number = sectionNumber.join('.') + parents.push(prevSibling) + prevSibling.children.push(node) + prevSibling = node + } + + for (let el of headingList) { + let node = { + id: el.id, + number: '', + tagName: el.tagName, + text: cleanHeadingText(el), + page: Boolean(el.dataset.page), + dashboardWeight: el.dataset.dashboardWeight, + dashboardAudit: el.dataset.dashboardAudit, + dashboardAuditURL: el.dataset.dashboardAuditUrl, + dashboardAuditDate: el.dataset.dashboardAuditDate, + dashboardState: el.dataset.dashboardState, + children: [] + } + + if (!prevSibling || headingNum(node) === headingNum(prevSibling)) { + // sibling: h2 == h2 + addSibling(node) + + } else if (headingNum(node) > headingNum(prevSibling)) { + // child: h3 > h2 + addChild(node) + + } else { + // h2 or h1 after an h3... gotta find out how far to unwind. Parents may not be contiguous, so walk till we find a parent + let target = headingNum(node) + let rmCount = 0 + while (target <= headingNum(parents[parents.length - (rmCount + 1)])) { + rmCount++ + } + parents = parents.slice(0, parents.length - rmCount) + sectionNumber = sectionNumber.slice(0, sectionNumber.length - rmCount) + + addSibling(node) + } + } + + return model +} + +function cleanHeadingText (el) { + return el.textContent.trim() +} + +function headingNum (el) { + return Number(el.tagName[1]) +} + +module.exports = { + buildTocModel +} \ No newline at end of file diff --git a/tools/watch.js b/tools/watch.js new file mode 100755 index 000000000..8476faf42 --- /dev/null +++ b/tools/watch.js @@ -0,0 +1,23 @@ +#!/usr/bin/env node +const chokidar = require('chokidar') +const diagrams = require('./diagrams') +const toc = require('./toc') + +watch() + +function watch () { + const watcher = chokidar.watch([], { + awaitWriteFinish: { + stabilityThreshold: 1000, + pollInterval: 100 + }, + ignoreInitial: true + }) + + watcher + .on('error', err => console.error('error watching: ', err)) + .on('all', (event, p) => console.log(event, p)) + + toc.configureWatcher(watcher) + diagrams.configureWatcher(watcher) +} \ No newline at end of file From eeaa6b525ff0668e2a9dc97464b7c5b9e479c98a Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Wed, 2 Sep 2020 21:53:48 +0100 Subject: [PATCH 20/27] fix: import meter css (#1140) fixes css for progress bar License: MIT Signed-off-by: Oli Evans --- assets/_custom.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/_custom.scss b/assets/_custom.scss index cc79639a0..00e3ba1c5 100644 --- a/assets/_custom.scss +++ b/assets/_custom.scss @@ -7,6 +7,7 @@ // @import "plugins/toggles"; @import "plugins/lightbox"; @import "plugins/bagdes"; +@import "plugins/meter"; @import "plugins/toc"; @import "table-sort"; @import "colors"; From ba0c089ac84a6c29e86f748f4fc6756e2445afa3 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 3 Sep 2020 11:35:30 +0100 Subject: [PATCH 21/27] fix: fix broken refs and change warns to errors (#1139) closes #980 closes #1103 --- README.md | 2 +- content/algorithms/porep/stacked_drg.md | 4 ++-- content/intro/arch.md | 1 - go.mod | 3 --- go.sum | 27 ---------------------- layouts/_default/_markup/render-image.html | 12 +++++----- layouts/_default/_markup/render-link.html | 4 ++-- layouts/shortcodes/embed.html | 2 +- layouts/shortcodes/mermaid.html | 2 +- 9 files changed, 13 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index ad23ec38f..5785150c4 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ The listing shortcode creates tables from externals sources, supports Go `struct {{}} ``` -### `Mermaid` +### `mermaid` Inline mermaid syntax rendering ```html {{< mermaid >}} diff --git a/content/algorithms/porep/stacked_drg.md b/content/algorithms/porep/stacked_drg.md index 72f9ce28b..2f5645075 100644 --- a/content/algorithms/porep/stacked_drg.md +++ b/content/algorithms/porep/stacked_drg.md @@ -74,7 +74,7 @@ In Filecoin, PoRep provides two guarantees: (1) *space-hardness*: Storage Miners Glossary: - __*sector:*__ a fixed-size block of data of `SECTOR_SIZE` bytes which generally contains clients' data. -- __*unsealed sector:*__ a concrete representation (on disk or in memory) of a sector's that follows the "Storage Format" described in [Client Data Processing](/missing_link) (currently `paddedfr32v1` is the required default). +- __*unsealed sector:*__ a concrete representation (on disk or in memory) of a sector's that follows the "Storage Format" described in Client Data Processing (currently `paddedfr32v1` is the required default). - __*sealed sector:*__ a concrete representation (on disk or in memory) of the unique replica generated by `Seal` from an __*unsealed sector*__. A sector contains one or more ***pieces***. - __*piece:*__ a block of data of at most `SECTOR_SIZE` bytes which is generally a client's file or part of. @@ -234,7 +234,7 @@ TODO: link to filproofs/feistel > The Replication phase turns an *unsealed sector* into a *sealed sector* by first *generating a key*, then using the key to *encode the orignal data*. -Before running the `Replicate` algorithm, the prover must ensure that the sector is correctly formatted with a valid "Storage Format" described in [Filecoin Client Data Processing](/missing_link) (currently `paddedfr32v1` is the required default). +Before running the `Replicate` algorithm, the prover must ensure that the sector is correctly formatted with a valid "Storage Format" described in Filecoin Client Data Processing (currently `paddedfr32v1` is the required default). {{< hint warning >}} TODO: inputs are missing diff --git a/content/intro/arch.md b/content/intro/arch.md index 0145779cd..dd26bf702 100644 --- a/content/intro/arch.md +++ b/content/intro/arch.md @@ -17,7 +17,6 @@ dashboardAudit: n/a - move data_transfers into Token {{< /details >}} - ![Protocol Overview Diagram](diagrams/overview1/overview.dot) ## Protocol Flow Diagram diff --git a/go.mod b/go.mod index acfdb0710..d4d16a79f 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,4 @@ require ( github.com/filecoin-project/go-fil-markets v0.5.7 // indirect github.com/filecoin-project/lotus v0.5.3 // indirect github.com/filecoin-project/specs-actors v0.9.3 - github.com/ipfs/go-cid v0.0.7 - github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e - github.com/libp2p/go-libp2p-core v0.6.1 ) diff --git a/go.sum b/go.sum index 53530046b..31e346c66 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,6 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alex-shpak/hugo-book v0.0.0-20200707210728-615400b3b747 h1:XuqsYYXFCvHQsSpB08qeDRapdznYZujyfeFAqnDm8kg= github.com/alex-shpak/hugo-book v0.0.0-20200707210728-615400b3b747/go.mod h1:DvU1VD1ikK0ufuSgldRCwm4kVaEF0cQGdHUp16XjSVI= -github.com/alex-shpak/hugo-book v0.0.0-20200819182225-6beca7928c20 h1:xkWkiissWW+nxjH4wKsL5Fx0jFemcoIRGof2PuDta70= -github.com/alex-shpak/hugo-book v0.0.0-20200819182225-6beca7928c20/go.mod h1:DvU1VD1ikK0ufuSgldRCwm4kVaEF0cQGdHUp16XjSVI= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -88,7 +86,6 @@ github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dm github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= -github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= @@ -250,7 +247,6 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= @@ -377,7 +373,6 @@ github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiL github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM= github.com/ipfs/go-bitswap v0.2.8/go.mod h1:2Yjog0GMdH8+AsxkE0DI9D2mANaUTxbVVav0pPoZoug= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= -github.com/ipfs/go-block-format v0.0.2 h1:qPDvcP19izTjU8rgo6p7gTXZlkMkF5bz5G3fqIsSCPE= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= github.com/ipfs/go-blockservice v0.0.3/go.mod h1:/NNihwTi6V2Yr6g8wBI+BSwPuURpBRMtYNGrlxZ8KuI= github.com/ipfs/go-blockservice v0.0.7/go.mod h1:EOfb9k/Y878ZTRY/CH0x5+ATtaipfbRhbvNSdgc/7So= @@ -392,7 +387,6 @@ github.com/ipfs/go-cid v0.0.4/go.mod h1:4LLaPOQwmk5z9LBgQnpkivrx8BJjUyGwTXCd5Xfj github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6-0.20200501230655-7c82f3b81c00/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cidutil v0.0.2/go.mod h1:ewllrvrxG6AMYStla3GD7Cqn+XYSLqjK0vc+086tB6s= github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= @@ -454,18 +448,15 @@ github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7 github.com/ipfs/go-ipfs-routing v0.0.1/go.mod h1:k76lf20iKFxQTjcJokbPM9iBXVXVZhcOwc360N4nuKs= github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= -github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= github.com/ipfs/go-ipld-cbor v0.0.1/go.mod h1:RXHr8s4k0NE0TKhnrxqZC9M888QfsBN9rhS5NjfKzY8= github.com/ipfs/go-ipld-cbor v0.0.2/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.3/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.4/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-cbor v0.0.5-0.20200204214505-252690b78669/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= -github.com/ipfs/go-ipld-cbor v0.0.5-0.20200428170625-a0bd04d3cbdf h1:PRCy+w3GocY77CBEwTprp6hn7PLiEU1YToKe7B+1FVk= github.com/ipfs/go-ipld-cbor v0.0.5-0.20200428170625-a0bd04d3cbdf/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= -github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL37mwA= github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= github.com/ipfs/go-ipns v0.0.2/go.mod h1:WChil4e0/m9cIINWLxZe1Jtf77oz5L05rO2ei/uKJ5U= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= @@ -502,7 +493,6 @@ github.com/ipfs/interface-go-ipfs-core v0.2.3/go.mod h1:Tihp8zxGpUeE3Tokr94L6zWZ github.com/ipfs/iptb v1.4.0/go.mod h1:1rzHpCYtNp87/+hTxG5TfCVn/yMY3dKnLn8tBiMfdmg= github.com/ipfs/iptb-plugins v0.2.1/go.mod h1:QXMbtIWZ+jRsW8a4h13qAKU7jcM7qaittO8wOsTP0Rs= github.com/ipld/go-car v0.1.1-0.20200526133713-1c7508d55aae/go.mod h1:2mvxpu4dKRnuH3mj5u6KW/tmRSCcXvy/KYiJ4nC6h4c= -github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e h1:ZISbJlM0urTANR9KRfRaqlBmyOj5uUtxs2r4Up9IXsA= github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e/go.mod h1:uVIwe/u0H4VdKv3kaN1ck7uCb6yD9cFLS9/ELyXbsw8= github.com/ipld/go-ipld-prime-proto v0.0.0-20200428191222-c1ffdadc01e1/go.mod h1:OAV6xBmuTLsPZ+epzKkPB1e25FHk/vCtyatkdHcArLs= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52/go.mod h1:fdg+/X9Gg4AsAIzWpEHwnqd+QY3b7lajxyjE1m4hkq4= @@ -561,7 +551,6 @@ github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= -github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40JQWnayTvNMgD/vyk= github.com/libp2p/go-conn-security-multistream v0.0.1/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= @@ -640,7 +629,6 @@ github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqe github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= -github.com/libp2p/go-libp2p-core v0.6.1 h1:XS+Goh+QegCDojUZp00CaPMfiEADCrLjNZskWE7pvqs= github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= @@ -853,13 +841,11 @@ github.com/miekg/dns v1.1.4/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nr github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.30/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU= github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -877,11 +863,8 @@ github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVq github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= -github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= github.com/multiformats/go-multiaddr v0.0.1/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= github.com/multiformats/go-multiaddr v0.0.2/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= @@ -890,7 +873,6 @@ github.com/multiformats/go-multiaddr v0.1.0/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lg github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= github.com/multiformats/go-multiaddr v0.2.1/go.mod h1:s/Apk6IyxfvMjDafnhJgJ3/46z7tZ04iMk5wP4QMGGE= -github.com/multiformats/go-multiaddr v0.2.2 h1:XZLDTszBIJe6m0zF6ITBrEcZR73OPUhCBBS9rYAuUzI= github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= @@ -908,7 +890,6 @@ github.com/multiformats/go-multiaddr-net v0.1.4/go.mod h1:ilNnaM9HbmVFqsb/qcNysj github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.2/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= -github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= @@ -917,7 +898,6 @@ github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa github.com/multiformats/go-multihash v0.0.9/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.0.14 h1:QoBceQYQQtNUuf6s7wHxnE2c8bhbMqhfGzNI032se/I= github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= @@ -927,7 +907,6 @@ github.com/multiformats/go-multistream v0.1.2/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -988,7 +967,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190408063855-01bf1e26dd14/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= -github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a h1:hjZfReYVLbqFkAtr2us7vdy04YWz3LVAirzP7reh8+M= github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -1083,7 +1061,6 @@ github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -1144,7 +1121,6 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20200715143311-227fab5a2377/go.mod h1:f github.com/whyrusleeping/cbor-gen v0.0.0-20200723185710-6a3894a6352b/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200810223238-211df3b9e24c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200812213548-958ddffe352c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.0.0-20200814224545-656e08ce49ee h1:U7zWWvvAjT76EiuWPSOiZlQDnaQYPxPoxugTtTAcJK0= github.com/whyrusleeping/cbor-gen v0.0.0-20200814224545-656e08ce49ee/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= github.com/whyrusleeping/go-ctrlnet v0.0.0-20180313164037-f564fbbdaa95/go.mod h1:SJqKCCPXRfBFCwXjfNT/skfsceF7+MBFLI2OrvuRA7g= @@ -1237,7 +1213,6 @@ golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200427165652-729f1e841bcc/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1393,7 +1368,6 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200427175716-29b57079015a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 h1:OjiUf46hAmXblsZdnoSXsEUSKU8r1UEzcL5RVZ4gO9Y= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1450,7 +1424,6 @@ golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWc golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index be67246e7..b5de27b79 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -16,7 +16,9 @@ {{ $src := .Page.Resources.GetMatch .Destination }} {{ with $src }} {{ $genPath = .RelPermalink }} - {{ $title }} + {{ $title }} + {{- else -}} + {{- errorf "Image '%s' not found from Page '%s'" .Destination .Page.File }} {{ end }} {{- else -}} {{ if eq ( $src | printf "%.1s") "/" }} @@ -26,19 +28,17 @@ {{ $path = printf "%s%s" .Page.File.Dir $src }} {{ $genPath = (printf "/_gen/diagrams/%s?%d" (replace $path $ext ".svg") now.Unix)}} {{- end -}} + {{ if fileExists $path }} {{ .Text }} {{ else }} -
- {{- printf "File '%s' not found from Page '%s'" $src .Page.File }} -
- {{- warnf "File '%s' not found from Page '%s'" $src .Page.File }} + {{- errorf "Image '%s' not found from Page '%s'" $src .Page.File }} {{ end }} {{- end -}}
Figure: {{ $title }} - Open in tab + Open in tab
\ No newline at end of file diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index dad37725a..21504777e 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -36,7 +36,7 @@ {{- else -}} {{- $anchor = printf "#%s" (delimit $pathParts "__") -}} {{- end -}} - {{- $destination = $anchor }} + {{- $destination = $anchor }} {{- if .Title -}} {{- $title = .Title -}} {{- else -}} @@ -45,7 +45,7 @@ {{- else if fileExists (print .Page.File.Dir .Destination) }} {{- else -}} - {{- warnf "Page '%s' not found in '%s' for lang '%s'" .Destination .Page.File .Page.File.Lang }} + {{- errorf "Page '%s' not found in '%s' for lang '%s'" .Destination .Page.File .Page.File.Lang }} {{- end }} {{- end }} {{ (default $title .Text) | safeHTML }} diff --git a/layouts/shortcodes/embed.html b/layouts/shortcodes/embed.html index 9ecf76507..ab0eb2e24 100644 --- a/layouts/shortcodes/embed.html +++ b/layouts/shortcodes/embed.html @@ -69,5 +69,5 @@
{{- printf "File '%s' not found from Page '%s'" ($path) .Page.File }}
- {{- warnf "File '%s' not found from Page '%s'" ($path) .Page.File }} + {{- errorf "File '%s' not found from Page '%s'" ($path) .Page.File }} {{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html index 0e4bf3499..5960f84e0 100644 --- a/layouts/shortcodes/mermaid.html +++ b/layouts/shortcodes/mermaid.html @@ -43,7 +43,7 @@
{{- printf "File '%s' not found from Page '%s'" ($.Scratch.Get "filepath") .Page.File }}
- {{- warnf "File '%s' not found from Page '%s'" ($.Scratch.Get "filepath") .Page.File }} + {{- errorf "File '%s' not found from Page '%s'" ($.Scratch.Get "filepath") .Page.File }} {{ end }} {{ else }} {{ $uuid := delimit (shuffle (seq 1 9)) "" }} From b9019c7a32a700cb72d7e56ea8ffbc5c06d9bb3b Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 3 Sep 2020 11:41:44 +0100 Subject: [PATCH 22/27] fix: reword stacked drg missing link text" --- content/algorithms/porep/stacked_drg.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/algorithms/porep/stacked_drg.md b/content/algorithms/porep/stacked_drg.md index 2f5645075..48a72f5d0 100644 --- a/content/algorithms/porep/stacked_drg.md +++ b/content/algorithms/porep/stacked_drg.md @@ -234,7 +234,7 @@ TODO: link to filproofs/feistel > The Replication phase turns an *unsealed sector* into a *sealed sector* by first *generating a key*, then using the key to *encode the orignal data*. -Before running the `Replicate` algorithm, the prover must ensure that the sector is correctly formatted with a valid "Storage Format" described in Filecoin Client Data Processing (currently `paddedfr32v1` is the required default). +Before running the `Replicate` algorithm, the prover must ensure that the sector is correctly formatted with a valid "Storage Format" (currently `paddedfr32v1` is the required default). {{< hint warning >}} TODO: inputs are missing From 62a0f273aafe136a01785095f1c8a312fb9f9064 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Thu, 3 Sep 2020 14:45:35 +0100 Subject: [PATCH 23/27] docs: tidy up the readme, add toc. (#1141) - Put the focus on things content authors are going to need most. Every one will edit content, links, images. Some will add new pages. Few will link in new external modules. - Add a ToC - Fix code fencing around code-fencing --- README.md | 341 ++++++++++++++++++++++++++++-------------------- package.json | 24 ++-- tools/readme.js | 15 +++ 3 files changed, 231 insertions(+), 149 deletions(-) create mode 100755 tools/readme.js diff --git a/README.md b/README.md index 5785150c4..05bedf099 100644 --- a/README.md +++ b/README.md @@ -1,159 +1,122 @@ - # Filecoin Specification + ![CI](https://github.com/filecoin-project/specs/workflows/CI/badge.svg) This is the [Filecoin Specification](https://github.com/filecoin-project/specs), a repository that contains documents, code, models, and diagrams that constitute the specification of the [Filecoin Protocol](https://filecoin.io). This repository is the singular source of truth for the Filecoin Protocol. All implementations of the Filecoin Protocol should match and comply with the descriptions, interfaces, code, and models defined in this specification. -## Website - -https://spec.filecoin.io is the user-friendly website rendering, which we recommend for reading this repository. The website is updated automatically with every merge to `master`. + is the user-friendly website rendering, which we recommend for reading this repository. The website is updated automatically with every merge to `master`. + +## Table of Contents + +- [Install](#install) +- [Writing the spec](#writing-the-spec) +- [Check your markdown](#check-your-markdown) +- [Page Template](#page-template) +- [Code](#code) +- [Images](#images) +- [Links](#links) +- [Shortcodes](#shortcodes) + - [`embed`](#embed) + - [`listing`](#listing) + - [`mermaid`](#mermaid) + - [`hint`](#hint) +- [Math mode](#math-mode) + - [Wrap `def`, `gdef`, etc.](#wrap-def-gdef-etc) + - [Wrap inline math text with code blocks](#wrap-inline-math-text-with-code-blocks) + - [Wrap math blocks with code fences](#wrap-math-blocks-with-code-fences) +- [Front-matter](#front-matter) +- [External modules](#external-modules) +- [Solving Common problems](#solving-common-problems) +- [References](#references) ## Install -```sh -git clone https://github.com/filecoin-project/specs.git -yarn install -``` +To build the spec website you need -## Develop -You need to have [Go](https://golang.org/doc/install) and `bzr` installed (required to build lotus) +- [`node` & `npm`](https://nodejs.org/en/download) +- [`go`](https://golang.org/doc/install) +- `bzr` (required to build lotus) + +On macOS you can get go and bzr from Homebrew ```bash brew install go bzr ``` -### Serve with Live Reload -```sh -yarn start -# open http://localhost:1313/ in the browser -``` - -### Check your markdown - -We have a markdown linter set up to check for common errors like incorrectly nested headers. It runs in CI and you can run it locally with: +Clone the repo, and use `npm install` to fetch the dependencies -```bash -npm test -content/algorithms/crypto/randomness.md - 15:39-15:46 warning Found reference to undefined definition no-undefined-references remark-lint - 54:24-54:31 warning Found reference to undefined definition no-undefined-references remark-lint - -âš  2 warnings +```sh +git clone https://github.com/filecoin-project/specs.git +npm install ``` -### Solving Common problems - -**Problem** - Site fails to build with an error that states it faled to download modules on macos +To run the development server with live-reload locally, run: -``` -Error: failed to download modules: go command failed ... +```sh +npm start ``` -**Solution** - run `npm run clean` - the cache dir hugo uses can get corrupted, and this resets it. See [#1048](https://github.com/filecoin-project/specs/issues/1048) +Then open in the browser +## Writing the spec -### External modules -External modules should be added as [Hugo Modules](https://gohugo.io/hugo-modules/) -You can find examples in the `config.toml` - -```toml -[module] - [[module.imports]] - path = "github.com/filecoin-project/specs-actors" - [[module.imports.mounts]] - source = "." - target = "content/externals/specs-actors" -``` -> `target` should **ALWAYS** use the folder `content/externals` +The spec is written in markdown. Each section is markdown document in the `content` directory. The first level of the directory structure denotes the top level sections of the spec; (Introduction, Systems, etc.) The `_index.md` file in each folder is used as the starting point for each section. For example the **Introduction** starts in `content/intro/_index.md`. -This makes files from external repos available for Hugo rendering and allows for linking to up-to-date files that are directly pulled from other repositories. +Sections can be split out into multiple markdown documents. The build process combines them into a single html page. The sections are ordered by the `weight` front-matter property. The introduction appears at the start of the html page because `content/intro/_index.md` has `weight: 1`, while `content/systems/_index.html` has `weight: 2` so it appears as the second section. -The configuration above gives the following information: +You can split out sub-sections by adding additional pages to a section directory. The `content/intro/concepts.md` defines the Key Concepts sub-section of the the Introduction. The order of sub-sections within a section is again controlled by setting the `weight` property. This pattern repeats for sub sub folders which represent sub sub sections. -- `path`: Repository's URL without protocol. -- `source`: Folder from the repository referenced in the `path` to be mounted into the local Hugo filesystem. -- `target`: Folder where `source` will be mounted locally, this should follow this structure `content/modules/`. +The markdown documents should all be well formed, with a single h1, and headings should increment by a single level. -Example: if you want to link/embed to the file `xyz.go` that lives in `https://github.com/filecoin-project/specs-actors/actors/xyz-folder/xyz.go`, from within a markdown file then with the above configuration the `src` for shortcodes or markdown image syntax would be: +## Check your markdown -``` -{{}} -``` -> The first foward slash is important it means the path is relative to the content folder. +Use `npm test` to run a markdown linter set up to check for common errors. It runs in CI and you can run it locally with: -These modules can be updated with +```bash +npm test +content/algorithms/crypto/randomness.md + 15:39-15:46 warning Found reference to undefined definition no-undefined-references remark-lint + 54:24-54:31 warning Found reference to undefined definition no-undefined-references remark-lint -```sh -hugo mod get -u +âš  2 warnings ``` -or to a specific version with -```sh -hugo mod get github.com/filecoin-project/specs-actors@v0.7.2 -``` +## Page Template -## Page Header -The first heading should be an atx style heading `# Head` and should refer to the overall title of the document. +A spec document should start with a YAML front-matter section and contain at least a single h1, as below. ```md --- -title: Storage Power Actor +title: Important thing +weight: 1 +dashboardState: wip +dashboardAudit: missing --- -# Storage Power Actor - -## Header for a section in this document -Some text - -### Sub header for the a nested section - -## Another top level header +# Important thing ``` -## Frontmatter +## Code -Description for all the available frontmatter properties +Wrap code blocks in _code fences_. Code fences should **always** have a lang. It is used to provide syntax highlighting. Use `text` as the language flag for pseudocode for no highlighting. -```md - -title: Libraries - -description: Libraries used from Filecoin - -weight: 3 - -bookCollapseSection: true - -bookhidden: true - -dashboardWeight: 2 - -dashboardState: stable - -dashboardAudit: wip - -dashboardAuditURL: https://url.to.the.report - -dashboardAuditDate: "2020-08-01" - -dashboardTests: 0 +````text +```text +Your algorithm here ``` +```` -## Code fences +You can embed source code from other repos. Mount the repo as a hugo modules as descibed in [External Modules](#external-modules) then use the [`embed shorcode`](#embed) to link to a specific symbol. -Code fences should **always** have a lang, if you don't know or don't care just use `text` - -```text +```go +{{}} +``` -```text -Random plain text context ... -`` +## Images -``` +Use normal markdown syntax to include images. -## Images, diagrams - Markdown images -To add an image or diagram you just need to use normal markdown syntax. -For diagrams you can use the source files and the pipelines will handle converting that to `svg`, we support mermaid and dot source files. +For `dot` and `mermaid` diagrams you link to the source file and the pipelines will handle converting that to `svg`. ```md # relative to the markdown file @@ -164,33 +127,46 @@ For diagrams you can use the source files and the pipelines will handle converti ![Alt text](graph.dot "Graph title") ``` -> When there's no title we use the alt text as title +> the alt text as title is used as the title where it is not provided. + +## Links + +Use markdown syntax `[text](markdown-document-name)`. -## References - Markdown links -These links use "portable links" just like `relref` so you can just give it the name of the file and it will fetch the correct relative link and title for the `` automatically. -You can override the `` title by passing a second `string` in the link definition. +These links use "portable links" just like `relref`. Just give it the name of the file and it will fetch the correct relative path and title automatically. You can override the title by passing a second `string` in the link definition. > **Note**: When using anchors the title can't be fetched automatically. + ```md [](storage_power_consensus) -# Storage Power Consensus + +# Renders to +Storage Power Consensus + [Storage Power](storage_power_consensus "Title to override the page original title") -# Storage Power + +# Renders to +Storage Power + [Tickets](storage_power_consensus#the-ticket-chain-and-drawing-randomness "The Ticket chain and drawing randomness") -# Tickets -``` +# Renders to +Tickets +``` ## Shortcodes +hugo shortcodes you can add to your markdown. + ### `embed` + ```md # src relative to the page -{{}} +{{}} # src relative to content folder {{}} @@ -204,7 +180,9 @@ You can override the `` title by passing a second `string` in the link defini ``` ### `listing` + The listing shortcode creates tables from externals sources, supports Go `struct`. + ```md # src relative to the page {{}} @@ -216,8 +194,10 @@ The listing shortcode creates tables from externals sources, supports Go `struct {{}} ``` -### `mermaid` +### `mermaid` + Inline mermaid syntax rendering + ```html {{< mermaid >}} graph TD @@ -231,6 +211,7 @@ graph TD ``` ### `hint` + ```md {{< hint info >}} @@ -240,9 +221,8 @@ stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa {{< /hint >}} ``` - - ## Math mode + For short snippets of math text you can just use the `{{}}` shortcode, but if you need to write lots of math in a page you can just use `math-mode` and avoid writting the katex shortcode everywhere. Parses math typesetting with [KaTeX](https://katex.org/docs/api.html) @@ -250,15 +230,18 @@ Parses math typesetting with [KaTeX](https://katex.org/docs/api.html) Check this example [example](https://deploy-preview-969--fil-spec-staging.netlify.app/math-mode/) > Some syntax like `\_` can't go through HUGO markdown parser and for that reason we need to wrap math text with code blocks, code fendes or the shortcode `{{}}`. See examples below. -### Add `math-mode` prop to the Frontmatter -```md ---- -title: Math Mode -math-mode: true ---- -``` +> +> ### Add `math-mode` prop to the Frontmatter +> +> ```md +> --- +> title: Math Mode +> math-mode: true +> --- +> ``` ### Wrap `def`, `gdef`, etc. + Math text needs to be wrapped to avoid Hugo's Markdown parser. When wrapping defs or any math block that doesn't need to be rendered the recommended option is to use the shortcode `{{