Skip to content

Consensys/doc.linea

Repository files navigation

Note

Linea recently announced that it is targeting a token generation event (TGE) in Q1 2025, as part of its decentralization. While we welcome contributions to the documentation from anyone, please note that contributions will not entitle you to any potential token airdrop(s).

Linea documentation

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.

See more information about how Consensys uses Docusaurus.

Contribute

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

Alternatively, help us improve our documentation! Fork our repo, create a pull request, and tag us for review. (For help on this, see below).

Alternatively, get in touch via the community forum or the Linea Discord if you have an issue or question.

Please follow these steps if you wish to contribute:

  1. Please make an issue describing the change you wish to make before you start working on it, and link to it in your pull request. This is particularly important if you are an ecosystem contributor — submitting your details in an issue first will make it much easier for our docs team to process your contributions.
  2. Fork our repo so that you're able to work on it.
  3. Make your changes, paying attention to our contribution guidelines.
  4. Review your changes locally. See our guide on previewing your changes locally.
  5. Submit your changes as a pull request. New pull requests are reviewed regularly.

Contribution guidelines

The style of the documentation is based on the Consensys style guide, other than for images and other media, for which we have specific guidelines.

Additionally, please adhere to these rules:

  • Use .mdx files. The docs site is standardized to use .mdx files rather than .md files to ensure that React components and other elements can be rendered properly.
  • Use HTML-like formatting rather than traditional Markdown formatting. For example, create a <table> rather than using the Markdown syntax with dashes and vertical lines. In many cases, HTML syntax is easier to maintain. Standardization also applies here: some elements we frequently use, such as <Tabs>, must use HTMl syntax, so applying HTML universally helps to avoid the site containing a mix of both styles.

Please return to any submitted PRs regularly to help us work through feedback and comments and merge as soon as we can. If you do not return to your PR for edits within three months of us reviewing, we will close the PR.

Guidance for ecosystem contributions

By "ecosystem contributions", we mean contributions from projects in the Linea ecosystem, such as dapps, libraries, or tooling. If your submission is in this category, please keep the following guidelines in mind:

  • Your contribution should be informative above all; the docs are not a marketing tool for your project. We may request edits to adjust your writing style if we feel it falls on the wrong side of this line. We encourage you to write about your project's features and benefits, but please avoid superlatives or selling your project.
  • You are responsible for maintaining the information about your project. Out-of-date docs will be an inconvenience for users at best, or leave a negative impression of your project at worst. This includes keeping links to external sites up-to-date and returning for updates as your project matures.

Contribute to the Zero-Knowledge Glossary

Diving into zero-knowledge rollups and getting stumped by the technical jargon? We've started an open source Zero-Knowledge glossary to define some common terms you might encounter as you dive into the L2 landscape.

Fork our repo, and add a term in alphabetical order to docs/zero-knowledge-glossary/index.mdx. Then, make a pull request and tag us for review!

Additional resources

View the Consensys doc contribution guidelines for information on how to:

Running locally

You will need to have Node.js installed to run the live previews of the docs locally.

It is highly recommended that you use a tool like nvm to manage Node.js versions on your machine.

Installing recommended Node.js version with nvm

  1. Follow the above instructions to install nvm on your machine, or go here.
  2. Go to the root folder of this project in your terminal.
  3. Run nvm install followed by nvm use. This will install the version specified by this project in the .nvmrc file.

Running this project

  1. Navigate to root folder of the project after installing Node.js

  2. Run the following in sequence, which only needs to be done once:

    npm install
  3. To preview and for every time afterwards:

    npm run start

Build

npm run build

This command generates static content into the build directory and can be served using any static contents hosting service.

To run the local build you created, run:

npm run serve

Check spelling and style

This repository includes multiple linters, which you can think of as spell-checks that also inspect code formatting and standards, and a lot more. It's possible that you might use an unrecognized word, style your Markdown incorrectly, or otherwise format your content in a way that conflicts with style guides.

The main linter, Vale, is run through Github Actions and checks spelling, formatting, and adherence to various style guides. Please pay attention to its suggestions and error warnings in the check that runs on your PR. These errors will not prevent your PR from building, but you should address them nevertheless.

See our guidance on using Vale for more information.

You can run other linters for code style (CSS, JavaScript) and link formatting any time with the command npm run lint.

Adding images to articles

Add image files

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.

Format image files

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, adjust the size class to one of the following:

img-xsmall, img-small, img-medium, img-large

Adhere to using these predefined sizings where possible.

Format svg files

Use the following formatting 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 outlined above, you can adjust the display size of the svg by changing the class applied.

Social cards

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