diff --git a/.gitignore b/.gitignore index feb1e22a7..fb2ff2865 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,8 @@ Thumbs.db :Zone.Identifier **/:Zone.Identifier lychee* +_book/ +_book_temp/ +node_modules/ +package-lock.json +.gitbook/cli/ \ No newline at end of file diff --git a/README.md b/README.md index 4e46324a1..5faa919cb 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ - [About this repo](#about-this-repo) - [Contributing](#contributing) + - [Local Development](#local-development) - [Link checking](#link-checking) - [Issues](#issues) - [Backlog](#backlog) @@ -32,6 +33,47 @@ PRs also generate preview links so one can preview the site before merging. Per Want to help out? Pull requests (PRs) are always welcome! If you want to help out but aren't sure where to start, check out the [issues board](https://github.com/filecoin-project/filecoin-docs/issues). +### Local Development + +You can build and preview the documentation locally using the custom CLI wrapper. This setup automatically manages the legacy Node.js v10 environment required by GitBook. + +#### Prerequisites + +- [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) + + **macOS/Linux:** + + ```bash + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash + ``` + + **Windows:** Use [nvm-windows](https://github.com/coreybutler/nvm-windows) or WSL + +#### Quick Start + +1. **Setup**: Installs dependencies and prepares the environment. + + ```bash + npm run setup + ``` + +2. **Develop**: Builds and serves the site with live reload. + ```bash + npm run dev + ``` + +#### Commands + +| Command | Description | +| ----------------- | ----------------------------------------------------------------------------------------------------- | +| `npm run setup` | Installs dependencies and configures the legacy GitBook environment (runs automatically on first use) | +| `npm run dev` | Builds and serves the documentation with live reload (default port: 4003) | +| `npm run build` | Builds the static site to the `_book/` directory | +| `npm run preview` | Serves the existing `_book/` directory without rebuilding | +| `npm run stop` | Stops any running GitBook server instances | +| `npm run clean` | Removes build artifacts and dependencies | + + ### Link checking Links are checked using [lychee-action](https://github.com/lycheeverse/lychee-action) as configured by [check-external-links.yml](.github/workflows/check-external-links.yml). Working links are required before merging. If you have a link that should be excluded from checking: diff --git a/basics/what-is-filecoin/README.md b/basics/what-is-filecoin/README.md index c8f6d6869..f8b5378fc 100644 --- a/basics/what-is-filecoin/README.md +++ b/basics/what-is-filecoin/README.md @@ -5,7 +5,7 @@ description: >- -# Introduction to Filecoin +## Introduction to Filecoin Filecoin is a peer-to-peer network that enables reliable, decentralized file storage through built-in economic incentives and cryptographic proofs. Clients, or users, pay any number of storage providers, or data centers, to store the client's data --storage providers then provide cryptographic proofs daily as evidence to the clients that the data is still at the data center. Storage providers lock a certain amount of Filecoin as collateral --should they repeatedly fail to provide a proof, their collateral gets burned, serving as a strong deterrent from the data center losing the data. diff --git a/book.json b/book.json new file mode 100644 index 000000000..d732a3117 --- /dev/null +++ b/book.json @@ -0,0 +1,7 @@ +{ + "gitbook": "3.2.3", + "plugins": ["filecoin"], + "structure": { + "readme": "WELCOME.md" + } +} diff --git a/networks/local-testnet/README.md b/networks/local-testnet/README.md index d3a0bed72..7fbdf6617 100644 --- a/networks/local-testnet/README.md +++ b/networks/local-testnet/README.md @@ -215,8 +215,8 @@ Before we can build the Lotus binaries, there’s some setup we need to do. We This will output something like:\\ ```plaintext - sector-id: {{1000 1} 5}, piece info: {2048 baga6ea4seaqf7ovs6euxa4ktencg2gza7lua32l2ugqu76uqgvnjocek6gtoufi} - 2023-01-31T10:49:46.562-0400 WARN preseal seed/seed.go:175 PreCommitOutput: {{1000 1} 5} bagboea4b5abcamxkzmzcciabqqk3xuuvj3k23nfuojboopyw3kg2mblhj6mzipii baga6ea4seaqf7ovs6euxa4ktencg2gza7lua32l2ugqu76uqgvnjocek6gtoufi + sector-id: ({1000 1} 5), piece info: {2048 baga6ea4seaqf7ovs6euxa4ktencg2gza7lua32l2ugqu76uqgvnjocek6gtoufi} + 2023-01-31T10:49:46.562-0400 WARN preseal seed/seed.go:175 PreCommitOutput: ({1000 1} 5) bagboea4b5abcamxkzmzcciabqqk3xuuvj3k23nfuojboopyw3kg2mblhj6mzipii baga6ea4seaqf7ovs6euxa4ktencg2gza7lua32l2ugqu76uqgvnjocek6gtoufi 2023-01-31T10:49:46.562-0400 WARN preseal seed/seed.go:100 PeerID not specified, generating dummy ... diff --git a/package.json b/package.json index 6faa6b3f6..374c062f7 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,16 @@ "main": "update-versions.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "update-versions": "node update-versions.js" + "setup": "npm install && gitbook-cli setup", + "build": "gitbook-cli build", + "dev": "gitbook-cli serve", + "preview": "gitbook-cli preview", + "build:verbose": "gitbook-cli build --verbose", + "dev:verbose": "gitbook-cli serve --verbose", + "preview:verbose": "gitbook-cli preview --verbose", + "stop": "gitbook-cli stop", + "help": "gitbook-cli help", + "clean": "rm -rf _book _book_temp node_modules package-lock.json" }, "repository": { "type": "git", @@ -17,5 +26,8 @@ "bugs": { "url": "https://github.com/filecoin-project/filecoin-docs/issues" }, - "homepage": "https://github.com/filecoin-project/filecoin-docs#readme" + "homepage": "https://github.com/filecoin-project/filecoin-docs#readme", + "devDependencies": { + "gitbook-plugin-filecoin": "^1.0.5" + } }