[site/theme][s]: add table of contents support with remark-toc and use on guide page.

This commit is contained in:
Rufus Pollock 2022-08-23 15:20:12 +02:00
parent 7020714c26
commit 5fb3bbbac2
4 changed files with 116 additions and 61 deletions

View File

@ -12,59 +12,7 @@ This main part of the guide is organized by aspiration. Under each aspiration ca
It is important that we make good choices about crypto and web3. Ultimately, we must decide whether to support, improve or restrict them. And to do so in as constructive, intersectional and depolarizing way as possible. This guide is a resource for doing so. It is important that we make good choices about crypto and web3. Ultimately, we must decide whether to support, improve or restrict them. And to do so in as constructive, intersectional and depolarizing way as possible. This guide is a resource for doing so.
# Contents ## Table of Contents
[Introduction](#introduction)
[Foundational Concepts](#foundational-concepts)
[Foundational FAQs](#foundational-faqs)
[Aspiration 1: A more stable, more efficient, and more transparent economy](#aspiration-1-a-more-stable-more-efficient-and-more-transparent-economy)
[Claim 1.1: Blockchain technology can facilitate the reduction of state intervention in the money supply](#claim-blockchain-technology-can-facilitate-the-reduction-of-state-intervention-in-the-money-supply)
[Claim 1.2: Blockchain based financial innovation will create more efficient markets](#claim-blockchain-based-financial-innovation-will-create-more-efficient-markets)
[Aspiration 2: A fairer and freer society](#aspiration-2-a-fairer-and-freer-society)
[Claim 2.1: The state can and should be hollowed out and blockchain technology can facilitate this](#claim-the-state-can-and-should-be-hollowed-out-and-blockchain-technology-can-facilitate-this)
[Claim 2.2: Web3 can facilitate financial inclusion](#claim-web3-can-facilitate-financial-inclusion)
[Claim 2.3: Crypto is an anti authoritarian force](#claim-crypto-is-an-anti-authoritarian-force)
[Claim 2.4: Web3 is a means to accelerate the collapse of capitalism and rebuild the global financial system](#claim-web3-is-a-means-to-accelerate-the-collapse-of-capitalism-and-rebuild-the-global-financial-system)
[Claim 2.5: NFTs are good for artists](#claim-nfts-are-good-for-artists)
[Claim 2.6: Web3 is a means to dismantle the American tech hegemony](#claim-web3-is-a-means-to-dismantle-the-american-tech-hegemony)
[Aspiration 3: Financial Gain Through Financial Liberty](#aspiration-3-financial-gain-through-financial-liberty)
[Claim 3.1: Traders and investors can make large financial gains in free, unregulated crypto-markets](#claim-traders-and-investors-can-make-large-financial-gains-in-free-unregulated-crypto-markets)
[Aspiration 4: Overcoming governance problems](#aspiration-4-overcoming-governance-problems)
[Claim 4.1: Web3 can revolutionize systems of governance](#claim-web3-can-revolutionize-systems-of-governance)
[Claim 4.2: Web3 can facilitate the resourcing of public goods and the commons](#claim-web3-can-facilitate-the-resourcing-of-public-goods-and-the-commons)
[Aspiration 5: Innovation and Progress](#aspiration-5-innovation-and-progress)
[Claim 5.1: Web3 is an inevitable paradigm shift akin to the Industrial Revolution](#claim-web3-is-an-inevitable-paradigm-shift-akin-to-the-industrial-revolution)
# Foundational Concepts # Foundational Concepts
@ -86,9 +34,10 @@ It is important that we make good choices about crypto and web3. Ultimately, we
* [What type of assets are crypto tokens?](/claims/is-type-of-asset) * [What type of assets are crypto tokens?](/claims/is-type-of-asset)
* [Is crypto mining harmful to the environment?](/claims/is-environmental-footprint) * [Is crypto mining harmful to the environment?](/claims/is-environmental-footprint)
---
# Aspiration 1: A more stable, more efficient, and more transparent economy # Aspiration 1: a better economy
---
A more stable, more efficient, and more transparent economy.
## Claim: Blockchain technology can facilitate the reduction of state intervention in the money supply ## Claim: Blockchain technology can facilitate the reduction of state intervention in the money supply

View File

@ -5,6 +5,7 @@ import rehypeSlug from 'rehype-slug'
import rehypeAutolinkHeadings from 'rehype-autolink-headings' import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import wikiLinkPlugin from "remark-wiki-link-plus" import wikiLinkPlugin from "remark-wiki-link-plus"
import rehypeToc from "@jsdevtools/rehype-toc" import rehypeToc from "@jsdevtools/rehype-toc"
import remarkToc from 'remark-toc'
const isValidDate = dateObject => new Date(dateObject) const isValidDate = dateObject => new Date(dateObject)
.toString() !== 'Invalid Date'; .toString() !== 'Invalid Date';
@ -64,6 +65,7 @@ export default makeSource({
mdx: { mdx: {
remarkPlugins: [ remarkPlugins: [
remarkGfm, remarkGfm,
remarkToc,
[ wikiLinkPlugin, { markdownFolder: 'content' } ] [ wikiLinkPlugin, { markdownFolder: 'content' } ]
], ],
rehypePlugins: [ rehypePlugins: [

111
site/package-lock.json generated
View File

@ -19,6 +19,7 @@
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-lite-youtube-embed": "^2.2.2", "react-lite-youtube-embed": "^2.2.2",
"remark-toc": "^8.0.1",
"sharp": "^0.30.5" "sharp": "^0.30.5"
}, },
"devDependencies": { "devDependencies": {
@ -1021,6 +1022,16 @@
"@types/estree": "*" "@types/estree": "*"
} }
}, },
"node_modules/@types/extend": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/extend/-/extend-3.0.1.tgz",
"integrity": "sha512-R1g/VyKFFI2HLC1QGAeTtCBWCo6n75l41OnsVYNbmKG+kempOESaodf6BeJyUM3Q0rKa/NQcTHbB2+66lNnxLw=="
},
"node_modules/@types/github-slugger": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@types/github-slugger/-/github-slugger-1.3.0.tgz",
"integrity": "sha512-J/rMZa7RqiH/rT29TEVZO4nBoDP9XJOjnbbIofg7GQKs4JIduEO3WLpte+6WeUz/TcrXKlY+bM7FYrp8yFB+3g=="
},
"node_modules/@types/glob": { "node_modules/@types/glob": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
@ -2587,8 +2598,7 @@
"node_modules/github-slugger": { "node_modules/github-slugger": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.4.0.tgz", "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.4.0.tgz",
"integrity": "sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ==", "integrity": "sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ=="
"dev": true
}, },
"node_modules/glob": { "node_modules/glob": {
"version": "7.2.0", "version": "7.2.0",
@ -3474,6 +3484,39 @@
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/mdast-util-toc": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/mdast-util-toc/-/mdast-util-toc-6.1.0.tgz",
"integrity": "sha512-0PuqZELXZl4ms1sF7Lqigrqik4Ll3UhbI+jdTrfw7pZ9QPawgl7LD4GQ8MkU7bT/EwiVqChNTbifa2jLLKo76A==",
"dependencies": {
"@types/extend": "^3.0.0",
"@types/github-slugger": "^1.0.0",
"@types/mdast": "^3.0.0",
"extend": "^3.0.0",
"github-slugger": "^1.0.0",
"mdast-util-to-string": "^3.1.0",
"unist-util-is": "^5.0.0",
"unist-util-visit": "^3.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-toc/node_modules/unist-util-visit": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz",
"integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==",
"dependencies": {
"@types/unist": "^2.0.0",
"unist-util-is": "^5.0.0",
"unist-util-visit-parents": "^4.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-wiki-link": { "node_modules/mdast-util-wiki-link": {
"version": "0.0.2", "version": "0.0.2",
"resolved": "https://registry.npmjs.org/mdast-util-wiki-link/-/mdast-util-wiki-link-0.0.2.tgz", "resolved": "https://registry.npmjs.org/mdast-util-wiki-link/-/mdast-util-wiki-link-0.0.2.tgz",
@ -5252,6 +5295,20 @@
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/remark-toc": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/remark-toc/-/remark-toc-8.0.1.tgz",
"integrity": "sha512-7he2VOm/cy13zilnOTZcyAoyoolV26ULlon6XyCFU+vG54Z/LWJnwphj/xKIDLOt66QmJUgTyUvLVHi2aAElyg==",
"dependencies": {
"@types/mdast": "^3.0.0",
"mdast-util-toc": "^6.0.0",
"unified": "^10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-wiki-link-plus": { "node_modules/remark-wiki-link-plus": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/remark-wiki-link-plus/-/remark-wiki-link-plus-1.0.0.tgz", "resolved": "https://registry.npmjs.org/remark-wiki-link-plus/-/remark-wiki-link-plus-1.0.0.tgz",
@ -6882,6 +6939,16 @@
"@types/estree": "*" "@types/estree": "*"
} }
}, },
"@types/extend": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/extend/-/extend-3.0.1.tgz",
"integrity": "sha512-R1g/VyKFFI2HLC1QGAeTtCBWCo6n75l41OnsVYNbmKG+kempOESaodf6BeJyUM3Q0rKa/NQcTHbB2+66lNnxLw=="
},
"@types/github-slugger": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@types/github-slugger/-/github-slugger-1.3.0.tgz",
"integrity": "sha512-J/rMZa7RqiH/rT29TEVZO4nBoDP9XJOjnbbIofg7GQKs4JIduEO3WLpte+6WeUz/TcrXKlY+bM7FYrp8yFB+3g=="
},
"@types/glob": { "@types/glob": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
@ -7909,8 +7976,7 @@
"github-slugger": { "github-slugger": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.4.0.tgz", "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.4.0.tgz",
"integrity": "sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ==", "integrity": "sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ=="
"dev": true
}, },
"glob": { "glob": {
"version": "7.2.0", "version": "7.2.0",
@ -8545,6 +8611,33 @@
"resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz", "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz",
"integrity": "sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA==" "integrity": "sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA=="
}, },
"mdast-util-toc": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/mdast-util-toc/-/mdast-util-toc-6.1.0.tgz",
"integrity": "sha512-0PuqZELXZl4ms1sF7Lqigrqik4Ll3UhbI+jdTrfw7pZ9QPawgl7LD4GQ8MkU7bT/EwiVqChNTbifa2jLLKo76A==",
"requires": {
"@types/extend": "^3.0.0",
"@types/github-slugger": "^1.0.0",
"@types/mdast": "^3.0.0",
"extend": "^3.0.0",
"github-slugger": "^1.0.0",
"mdast-util-to-string": "^3.1.0",
"unist-util-is": "^5.0.0",
"unist-util-visit": "^3.0.0"
},
"dependencies": {
"unist-util-visit": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz",
"integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==",
"requires": {
"@types/unist": "^2.0.0",
"unist-util-is": "^5.0.0",
"unist-util-visit-parents": "^4.0.0"
}
}
}
},
"mdast-util-wiki-link": { "mdast-util-wiki-link": {
"version": "0.0.2", "version": "0.0.2",
"resolved": "https://registry.npmjs.org/mdast-util-wiki-link/-/mdast-util-wiki-link-0.0.2.tgz", "resolved": "https://registry.npmjs.org/mdast-util-wiki-link/-/mdast-util-wiki-link-0.0.2.tgz",
@ -9701,6 +9794,16 @@
"unified": "^10.0.0" "unified": "^10.0.0"
} }
}, },
"remark-toc": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/remark-toc/-/remark-toc-8.0.1.tgz",
"integrity": "sha512-7he2VOm/cy13zilnOTZcyAoyoolV26ULlon6XyCFU+vG54Z/LWJnwphj/xKIDLOt66QmJUgTyUvLVHi2aAElyg==",
"requires": {
"@types/mdast": "^3.0.0",
"mdast-util-toc": "^6.0.0",
"unified": "^10.0.0"
}
},
"remark-wiki-link-plus": { "remark-wiki-link-plus": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/remark-wiki-link-plus/-/remark-wiki-link-plus-1.0.0.tgz", "resolved": "https://registry.npmjs.org/remark-wiki-link-plus/-/remark-wiki-link-plus-1.0.0.tgz",

View File

@ -22,6 +22,7 @@
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-lite-youtube-embed": "^2.2.2", "react-lite-youtube-embed": "^2.2.2",
"remark-toc": "^8.0.1",
"sharp": "^0.30.5" "sharp": "^0.30.5"
}, },
"devDependencies": { "devDependencies": {
@ -31,8 +32,8 @@
"postcss": "^8.3.5", "postcss": "^8.3.5",
"prettier": "^2.6.2", "prettier": "^2.6.2",
"rehype-autolink-headings": "^6.1.1", "rehype-autolink-headings": "^6.1.1",
"rehype-toc": "^3.0.2",
"rehype-slug": "^5.0.1", "rehype-slug": "^5.0.1",
"rehype-toc": "^3.0.2",
"remark-gfm": "^3.0.0", "remark-gfm": "^3.0.0",
"remark-parse": "^10.0.1", "remark-parse": "^10.0.1",
"remark-wiki-link-plus": "^1.0.0", "remark-wiki-link-plus": "^1.0.0",