Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,292 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linea documentation

Build Security scan License

Source for docs.linea.build, the official Linea documentation site. The site is built with Docusaurus v3 and deployed on Vercel.

Quick links

What is Linea?

Linea is a developer-ready layer 2 network, scaling Ethereum by providing an Ethereum-equivalent environment in which to execute transactions, which are then submitted to Ethereum Mainnet through a zero-knowledge rollup.

This documentation repository is built using Docusaurus, and the site itself is published at docs.linea.build.

What this repo documents

This repository is the source for docs.linea.build, which documents both Linea and Lineth:

  • Linea is the public, permissionless zkEVM Layer 2 network, along with its brand, token, tokenomics, and governance.
  • Lineth (formerly the Linea Stack) is the open-source ZK-rollup stack and technical protocol that powers Linea Mainnet and other networks built on it. Lineth is an enterprise-grade EVM layer 2 framework for developing public, permissioned or private networks.

Linea Mainnet is built on Lineth. For the authoritative distinction, see Linea and Lineth. The Lineth source code lives in the LFDT-Lineth monorepo.

The site is organized into four documentation tabs plus a changelog, each mapping to a top-level directory under docs/:

Tab Documents Audience Directory
Linea Mainnet Linea Users and app builders transacting on and building for Linea Mainnet and Sepolia docs/network
Lineth Stack Lineth Operators deploying and running their own networks on Lineth docs/stack
Protocol Lineth Readers learning how the Lineth protocol works (zero-knowledge proofs, prover, architecture, contracts) docs/protocol
Reference Linea and Lineth Developers using the Linea JSON-RPC API, smart contract reference, Linea SDK, and Token API docs/api
Changelog Linea and Lineth Releases, upgrades, and tooling updates across the Lineth stack and protocol and the Linea network, plus the Linea Security Council record docs/changelog

Repository structure

The directories you are most likely to touch:

doc.linea/
├── docs/
│   ├── network/         # Linea Mainnet tab
│   ├── protocol/        # Protocol tab: the Lineth protocol (includes linea-vs-lineth.mdx and the glossary)
│   ├── stack/           # Lineth Stack tab: the open-source stack operators deploy
│   ├── api/             # Reference tab: Linea (linea-smart-contracts/ is auto-generated, don't edit)
│   └── changelog/       # Releases across Lineth and the Linea network, plus the security council record
├── static/img/          # Images and SVGs, mirroring the docs/ structure
└── src/                 # Site components, theme, and CSS (see "Working with AI agents")

Build configuration, the scripts/ codegen helpers (social cards, categories, the llms.txt pipeline), the api/ Vercel serverless functions (the docs feedback endpoint), sidebars.js, redirects.json, vercel.json, and the agent tooling (AGENTS.md, .cursor/rules/, .agents/skills/) all live at the repo root.

Requirements

  • Node.js 24.18.0 (pinned in .nvmrc and engines in package.json).
  • npm as the package manager.

It is highly recommended that you use a tool like nvm to manage Node.js versions. From the root of the project, run nvm install followed by nvm use to install and select the version specified in .nvmrc.

Running locally

You need Node.js installed to run live previews of the docs locally. See Requirements above.

  1. Install dependencies (only needed once, or when dependencies change):

    npm install
  2. Start the dev server with hot reload:

    npm run start
  3. To produce and preview a production build:

    npm run build
    npm run serve

    npm run build generates static content into the build directory, which can be served by any static host.

If you hit stale cache or build issues, npm run clear clears the Docusaurus cache, and npm run clean-slate performs a fuller reset.

Common commands

Command Description
npm run start Start the local dev server with hot reload
npm run build Build the static site into build/
npm run serve Serve a local production build
npm run clear Clear the Docusaurus cache
npm run clean-slate Full local reset
npm run lint Run all linters (lint:js + lint:style)
npm run lint:js Lint JavaScript and TypeScript with ESLint (lint:js:fix to autofix)
npm run lint:style Lint CSS with Stylelint (lint:style:fix to autofix)
npm run format Format files with Prettier
npm run typecheck Type-check with TypeScript
npm run agent-docs:check Validate the generated agent / LLM docs
npm run agent-docs:verify-preview Verify agent docs against a preview deployment
npm run agent-docs:test Run the agent-docs script tests

Writing conventions

This documentation applies the Consensys style guide, other than for images and other media, for which we have specific guidelines.

Detailed, machine-readable writing and formatting conventions (voice, terminology, Markdown/MDX syntax, page structure) live in AGENTS.md and .cursor/rules/. They apply to human and AI contributors alike, and Cursor auto-applies them when you edit a matching file.

Adding images

Any images for articles should be added to the /static/img/ directory. Here, the /img folder structure mirrors that of the docs, and images are stored in the corresponding subdirectory. If you have added a new article in /docs, create the new subdirectory in /img according to this structure.

Use the following JSX formatting to add an image into an article:

<div class="center-container">
  <div class="img-medium">
      <img
        src="/img/path-to-file/image.png"
        alt="alt text here"
      />
  </div>
</div>

To adjust the display size of the image, change the size class to one of: img-xsmall, img-small, img-medium, img-large. Adhere to these predefined sizings where possible.

For SVG files, place the import statement at the top of the file, beneath the front matter:

import MySVGGraphic from "/img/path-to-file/image.svg";
<div className="img-large">
  <MySVGGraphic />
</div>

As above, you can adjust the display size of the SVG by changing the class applied.

A social card for any new article will be generated and applied when the site builds, so there is no need to manually create or add one.

See CONTRIBUTING.md for the full contribution workflow, including how to contribute to the glossary and additional Consensys docs resources.

Quality checks before pushing

Run these locally before opening or updating a PR, to mirror what CI runs:

npm run lint        # ESLint + Stylelint
npm run lint:style  # CSS only
npm run typecheck   # TypeScript

Spelling and style (Vale) and link checking run automatically in CI on your PR. The main linter, Vale, checks spelling, formatting, and adherence to various style guides. Please pay attention to its suggestions and warnings: these will not prevent your PR from building, but you should address them nevertheless. See our guidance on using Vale for more information.

Continuous integration

The following GitHub Actions workflows run on pull requests:

Workflow Trigger Description
build PR and push to main Builds the Docusaurus site
lint PR to main Runs ESLint and Stylelint
spelling PR to main Vale spelling and style check (advisory, won't block the build)
links PR to main Link checking with Linkspector
case PR to main (on docs/**) Enforces filename and casing conventions
nightly Daily schedule and manual dispatch Scheduled checks
security-code-scanner PR and push to main Security code scanning

Commit conventions

This repo follows Conventional Commits. Use a standard type and a short, imperative description, for example:

docs: clarify bridging guide

The repo configures commitlint (@commitlint/config-conventional, standard types) and uses lint-staged with Prettier for formatting. Run npm run lint and npm run format locally before pushing so your changes are clean. Published release notes live as documentation content under docs/changelog.

Deployment and previews

The site is deployed on Vercel:

  • Every pull request gets a unique Vercel preview URL so you can review your changes in context.
  • Production deploys automatically from the main branch.

Working with AI agents

AGENTS.md at the repo root is the canonical guidance for AI coding agents and human contributors alike: critical rules, plus an index of the detailed rule files in .cursor/rules/ (editorial voice, terminology, content structure, Markdown formatting, contributor workflow, CSS/design tokens) and the packaged skills in .agents/skills/ (authoring a new page, pre-PR content review, dependency maintenance).

Machine-readable docs (llms.txt)

Separately from the rules above, the site publishes a machine-readable copy of itself for LLM consumers. On build, the postbuild step (scripts/agent-docs/generate.js) emits an llms.txt index and a Markdown version of each route. Vercel serves these via content negotiation: a request with an Accept: text/markdown header receives the Markdown variant of a page rather than HTML. The llms.txt file and a /.well-known/api-catalog are advertised through response Link headers (see vercel.json).

Validate this pipeline locally with npm run agent-docs:check and npm run agent-docs:verify-preview.

Contributing

See something missing? Error in our documentation? Create an issue.

Alternatively, help us improve our documentation. See CONTRIBUTING.md for the full contribution workflow (including guidance for ecosystem contributions), or get in touch via the community forum or Linea Support.

License

This project is licensed under the terms of the LICENSE file.

About

Linea documentation

Topics

Resources

Contributing

Stars

475 stars

Watchers

11 watching

Forks

Used by

Contributors

Languages