Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check

on:
pull_request:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read

jobs:
links:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Build site
run: npm run build

- name: Check links
uses: lycheeverse/lychee-action@v2
with:
args: --verbose --no-progress README.md dist/index.html
fail: true
46 changes: 46 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy Pages

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Build site
run: npm run build

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist/
node_modules/

.DS_Store
.env
.env.*
*.log
58 changes: 37 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
# Awesome IPFS [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)
# Awesome Libp2p [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)


This is a community list of awesome projects, protocols, networks, apps, tools, and services related to libp2p.


## Implementations

- [go-libp2p](https://github.com/libp2p/go-libp2p)
- [js-libp2p](https://github.com/libp2p/js-libp2p)
- [rust-libp2p](https://github.com/libp2p/rust-libp2p)
- [py-libp2p](https://github.com/libp2p/py-libp2p)
- [nim-libp2p](https://github.com/vacp2p/nim-libp2p)
- [zig-libp2p](https://github.com/zen-eth/zig-libp2p)
- [cpp-libp2p](https://github.com/libp2p/cpp-libp2p)
- [swift-libp2p](https://github.com/swift-libp2p/swift-libp2p)
- [jvm-libp2p](https://github.com/libp2p/jvm-libp2p)
- [dotnet-libp2p](https://github.com/NethermindEth/dotnet-libp2p)
- [c-libp2p](https://github.com/Pier-Two/c-libp2p)
- [litep2p](https://github.com/paritytech/litep2p)

## Networks / Blockchains

Expand All @@ -14,30 +26,34 @@ This is a community list of awesome projects, protocols, networks, apps, tools,
- [Venus](https://github.com/filecoin-project/venus)
- [Forest](https://github.com/ChainSafe/forest)
- Ethereum
- https://github.com/sigp/lighthouse
- https://github.com/ChainSafe/lodestar
- [Lighthouse](https://github.com/sigp/lighthouse)
- [lodestar](https://github.com/ChainSafe/lodestar)
- Polkadot
- https://github.com/paritytech/polkadot-sdk
- https://github.com/smol-dot/smoldot
- https://github.com/ChainSafe/gossamer
- [polkadot-sdk](https://github.com/paritytech/polkadot-sdk)
- [smoldot](https://github.com/smol-dot/smoldot)
- [gossamer](https://github.com/ChainSafe/gossamer)
- [Flow](https://github.com/onflow/flow-go)
- Celestia - https://github.com/celestiaorg/celestia-node
- Starknet - https://github.com/eqlabs/pathfinder
- Pactus - https://github.com/pactus-project/pactus
- Fuel - https://github.com/FuelLabs/fuel-core
- Madara - https://github.com/keep-starknet-strange/madara
- Avail - https://github.com/availproject/avail
- Starcoin - https://github.com/starcoinorg/starcoin
- Magi - https://github.com/a16z/magi
- Spacemesh - https://github.com/spacemeshos/go-spacemesh
- Optimism - https://github.com/ethereum-optimism/optimism
- Mantle - https://github.com/mantlenetworkio/mantle-v2
- Algorand - https://github.com/algorand/go-algorand
- [Celestia](https://github.com/celestiaorg/celestia-node)
- [Starknet](https://github.com/eqlabs/pathfinder)
- [Pactus](https://github.com/pactus-project/pactus)
- [Fuel](https://github.com/FuelLabs/fuel-core)
- [Madara](https://github.com/keep-starknet-strange/madara)
- [Avail](https://github.com/availproject/avail)
- [Starcoin](https://github.com/starcoinorg/starcoin)
- [Optimism](https://github.com/ethereum-optimism/optimism)
- [Mantle](https://github.com/mantlenetworkio/mantle-v2)
- [Algorand](https://github.com/algorand/go-algorand)

## Apps

- [IPFS Kubo](https://github.com/ipfs/kubo)
- [IPFS Helia](https://github.com/ipfs/helia)
- [Gnosis VPN](https://github.com/gnosis/gnosis_vpn-client/)
- [OrbitDB](https://github.com/orbitdb/orbitdb)
- [Peerbit](https://github.com/dao-xyz/peerbit)
- [Ceramic](https://github.com/ceramicnetwork/js-ceramic)
- [Peergos](https://github.com/Peergos/Peergos)
- [Berty](https://github.com/berty/berty)
- [Hopr](https://github.com/hoprnet/hoprnet)
- [Seed Hypermedia](https://github.com/seed-hypermedia/seed)

## Application Developer Tools

- [Canvas](https://canvas.xyz/)
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "awesome-libp2p",
"private": true,
"type": "module",
"scripts": {
"build": "node scripts/build-site.mjs"
},
"engines": {
"node": ">=20"
}
}
165 changes: 165 additions & 0 deletions scripts/build-site.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
import { cp, mkdir, readFile, rm, writeFile } from "node:fs/promises";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";

const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const source = resolve(root, "site");
const output = resolve(root, "dist");
const readmePath = resolve(root, "README.md");
const indexPath = resolve(output, "index.html");

await rm(output, { force: true, recursive: true });
await mkdir(output, { recursive: true });
await cp(source, output, { recursive: true });

const readme = await readFile(readmePath, "utf8");
const index = await readFile(indexPath, "utf8");
const { description, title, sections } = parseReadme(readme);
const projectsHtml = renderProjects(sections);

await writeFile(
indexPath,
index
.replace(/<title>.*?<\/title>/, `<title>${escapeHtml(title)}</title>`)
.replace(/<h1>.*?<\/h1>/, `<h1>${escapeHtml(title)}</h1>`)
.replace(
/<p class="lede">[\s\S]*?<\/p>/,
`<p class="lede">\n ${escapeHtml(description)}\n </p>`,
)
.replace(
/<!-- README_PROJECTS_START -->[\s\S]*<!-- README_PROJECTS_END -->/,
`<!-- README_PROJECTS_START -->\n${projectsHtml}\n <!-- README_PROJECTS_END -->`,
),
);

console.log(`Built site: ${source} -> ${output}`);

function parseReadme(markdown) {
const lines = markdown.split(/\r?\n/);
const titleLine = lines.find((line) => line.startsWith("# ")) ?? "# Awesome libp2p";
const title = stripMarkdown(titleLine.replace(/^#\s+/, "")).trim();
const description = lines.find((line) => line.trim() && !line.startsWith("#"))?.trim() ?? "";
const sections = [];
let currentSection = null;
let currentItem = null;

for (const line of lines) {
const heading = line.match(/^##\s+(.+)$/);

if (heading) {
currentSection = { items: [], title: heading[1].trim() };
sections.push(currentSection);
currentItem = null;
continue;
}

const item = line.match(/^(\s*)-\s+(.+)$/);

if (!item || !currentSection) {
continue;
}

const indent = item[1].length;
const text = item[2].trim();

if (indent === 0) {
currentItem = { children: [], text };
currentSection.items.push(currentItem);
continue;
}

if (currentItem) {
currentItem.children.push(text);
}
}

return { description, sections, title };
}

function renderProjects(sections) {
const renderedSections = sections
.filter((section) => section.items.length > 0)
.map((section, index) => {
const number = String(index + 1).padStart(2, "0");
const items = section.items.map(renderItem).join("\n");

return ` <h3><span>${number}</span> ${escapeHtml(section.title)}</h3>\n <ul class="project-list">\n${items}\n </ul>`;
})
.join("\n\n");

return ` <section id="projects" aria-labelledby="projects-title">\n <h2 id="projects-title">Projects</h2>\n\n${renderedSections}\n </section>`;
}

function renderItem(item) {
if (item.children.length === 0) {
return ` <li>${renderInline(item.text)}</li>`;
}

return ` <li>${renderInline(item.text)}: ${item.children.map(renderInline).join(", ")}</li>`;
}

function renderInline(markdown) {
const namedUrl = markdown.match(/^(.+?)\s+-\s+(https?:\/\/\S+)$/);

if (namedUrl) {
return `<a href="${escapeAttribute(namedUrl[2])}">${escapeHtml(namedUrl[1])}</a>`;
}

const parts = [];
let remaining = markdown;
const linkPattern = /\[([^\]]+)\]\(([^)]+)\)|(https?:\/\/[^\s)]+)/;

while (remaining) {
const match = remaining.match(linkPattern);

if (!match) {
parts.push(escapeHtml(remaining));
break;
}

parts.push(escapeHtml(remaining.slice(0, match.index)));

const label = match[1] ?? linkLabel(match[3]);
const url = match[2] ?? match[3];
parts.push(`<a href="${escapeAttribute(url)}">${escapeHtml(label)}</a>`);
remaining = remaining.slice(match.index + match[0].length);
}

return parts.join("");
}

function linkLabel(url) {
try {
const parsed = new URL(url);
const segments = parsed.pathname.split("/").filter(Boolean);
return humanizeLabel(segments.at(-1) ?? parsed.hostname);
} catch {
return url;
}
}

function humanizeLabel(value) {
return value
.split(/[-_]/)
.map((part) => (part.length <= 3 ? part.toUpperCase() : `${part[0].toUpperCase()}${part.slice(1)}`))
.join(" ");
}

function stripMarkdown(markdown) {
return markdown
.replace(/\[!\[[^\]]*\]\([^)]+\)\]\([^)]+\)/g, "")
.replace(/!\[[^\]]*\]\([^)]+\)/g, "")
.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1");
}

function escapeHtml(value) {
return value
.replaceAll("&", "&amp;")
.replaceAll("<", "&lt;")
.replaceAll(">", "&gt;")
.replaceAll('"', "&quot;");
}

function escapeAttribute(value) {
return escapeHtml(value);
}
Binary file added site/assets/libp2p-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading