diff --git a/.gitignore b/.gitignore index 62066d1d..942a5249 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ resources .netlify /src/pages/awesome-swarm.mdx /static/openapi.yaml +/static/cheatsheets test docs/references/awesome-list.mdx *.zip diff --git a/docs/develop/introduction.md b/docs/develop/introduction.md index edfcfe1b..49073bd9 100644 --- a/docs/develop/introduction.md +++ b/docs/develop/introduction.md @@ -44,6 +44,15 @@ This is the go-to starting point for web3 developers who want to build with Swar Start with AI +
  • + +

    Swarm Cheatsheet

    +

    + A dense, printable quick-reference for building on Swarm — what it is, its limits, and curated links to get started fast. +

    + View cheatsheet +
    +
  • diff --git a/docs/develop/tools-and-features/cheatsheets.md b/docs/develop/tools-and-features/cheatsheets.md new file mode 100644 index 00000000..05edf6fa --- /dev/null +++ b/docs/develop/tools-and-features/cheatsheets.md @@ -0,0 +1,46 @@ +--- +title: Swarm Cheatsheet +id: cheatsheets +description: A dense printable quick-reference for building on Swarm — what it is, its limits, and curated links to get started. +hide_table_of_contents: true +--- + +The Swarm Cheatsheet is a dense, two-page quick-reference for building on Swarm. + +It's designed to print cleanly to A4, so you can keep it beside you at a hackathon or on your desk — use the **Download PDF** link below to grab a copy. + +
    + +
    + +Download PDF diff --git a/package.json b/package.json index 70f7a42f..8379aaff 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "docusaurus": "docusaurus", "start": "docusaurus start", - "prebuild": "node -e \"require('fs').copyFileSync('openapi/Swarm.yaml', 'static/openapi.yaml')\" && node scripts/fetch-awesome-swarm.mjs && node scripts/validate-llms-txt.mjs", + "prebuild": "node -e \"require('fs').copyFileSync('openapi/Swarm.yaml', 'static/openapi.yaml')\" && node scripts/fetch-awesome-swarm.mjs && node scripts/fetch-cheatsheets.mjs && node scripts/validate-llms-txt.mjs", "build": "docusaurus build", "build:quiet": "cross-env NODE_OPTIONS=\"--disable-warning=DEP0040 --disable-warning=DEP0169\" docusaurus build", "swizzle": "docusaurus swizzle", diff --git a/scripts/fetch-cheatsheets.mjs b/scripts/fetch-cheatsheets.mjs new file mode 100644 index 00000000..8d5f65e5 --- /dev/null +++ b/scripts/fetch-cheatsheets.mjs @@ -0,0 +1,103 @@ +// Mirror the Swarm cheatsheet(s) from the swarm-cheatsheets repo into static/, +// so they are served from our own domain (docs.ethswarm.org/cheatsheets/…) and +// embedded in a doc page via