From 5fb3bbbac274d18d26b66e19b59fa6bc429b32eb Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Tue, 23 Aug 2022 15:20:12 +0200 Subject: [PATCH] [site/theme][s]: add table of contents support with remark-toc and use on guide page. --- guide/index.md | 61 ++------------------ site/contentlayer.config.ts | 2 + site/package-lock.json | 111 ++++++++++++++++++++++++++++++++++-- site/package.json | 3 +- 4 files changed, 116 insertions(+), 61 deletions(-) diff --git a/guide/index.md b/guide/index.md index 395cbc9..d16813e 100644 --- a/guide/index.md +++ b/guide/index.md @@ -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. -# 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) +## Table of Contents # 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) * [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 diff --git a/site/contentlayer.config.ts b/site/contentlayer.config.ts index f9da92b..6404159 100644 --- a/site/contentlayer.config.ts +++ b/site/contentlayer.config.ts @@ -5,6 +5,7 @@ import rehypeSlug from 'rehype-slug' import rehypeAutolinkHeadings from 'rehype-autolink-headings' import wikiLinkPlugin from "remark-wiki-link-plus" import rehypeToc from "@jsdevtools/rehype-toc" +import remarkToc from 'remark-toc' const isValidDate = dateObject => new Date(dateObject) .toString() !== 'Invalid Date'; @@ -64,6 +65,7 @@ export default makeSource({ mdx: { remarkPlugins: [ remarkGfm, + remarkToc, [ wikiLinkPlugin, { markdownFolder: 'content' } ] ], rehypePlugins: [ diff --git a/site/package-lock.json b/site/package-lock.json index fc3307e..6f9a2d9 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -19,6 +19,7 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "react-lite-youtube-embed": "^2.2.2", + "remark-toc": "^8.0.1", "sharp": "^0.30.5" }, "devDependencies": { @@ -1021,6 +1022,16 @@ "@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": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -2587,8 +2598,7 @@ "node_modules/github-slugger": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.4.0.tgz", - "integrity": "sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ==", - "dev": true + "integrity": "sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ==" }, "node_modules/glob": { "version": "7.2.0", @@ -3474,6 +3484,39 @@ "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": { "version": "0.0.2", "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" } }, + "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": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/remark-wiki-link-plus/-/remark-wiki-link-plus-1.0.0.tgz", @@ -6882,6 +6939,16 @@ "@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": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -7909,8 +7976,7 @@ "github-slugger": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.4.0.tgz", - "integrity": "sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ==", - "dev": true + "integrity": "sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ==" }, "glob": { "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", "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": { "version": "0.0.2", "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" } }, + "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": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/remark-wiki-link-plus/-/remark-wiki-link-plus-1.0.0.tgz", diff --git a/site/package.json b/site/package.json index bd647e9..9e5e9a7 100644 --- a/site/package.json +++ b/site/package.json @@ -22,6 +22,7 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "react-lite-youtube-embed": "^2.2.2", + "remark-toc": "^8.0.1", "sharp": "^0.30.5" }, "devDependencies": { @@ -31,8 +32,8 @@ "postcss": "^8.3.5", "prettier": "^2.6.2", "rehype-autolink-headings": "^6.1.1", - "rehype-toc": "^3.0.2", "rehype-slug": "^5.0.1", + "rehype-toc": "^3.0.2", "remark-gfm": "^3.0.0", "remark-parse": "^10.0.1", "remark-wiki-link-plus": "^1.0.0",