Home

Awesome

Uniswap Documentation

This web application contains all documentation for Uniswap products. It is built using Docusaurus 2, a modern static website generator.

Project Layout

Uniswap documentation is broken down into four sections:

Each item in a section should include the following:

Adding Documentation

After deploying your change, please make sure you update the search indices if a new file was added as part of the change

Overview

A product overview should address points such as:

A good example is the V3 Smart Contracts.

Guides

Guides should follow the Principles of a Good Guide:

By implementing these consistent principles Uniswap will have docs that are easy to understand and produce reusable code for its community.

A good example is the V3 SDK Guides.

Technical References

This should contain the technical reference for the exported interfaces. A good example is the V3 SDK. These files can be created using the guides below.

Contributing to Uniswap Docs

Guidelines

Contributing to the docs site is a great way to get involved in the dev community and help other developers along the way! Check out our guidelines here.

Checklist for adding a new product

Checklist example

Let's walk through an example by considering the Permit2 smart contract:

How to create a Technical Reference

How to generate markdown files from solidity Natspec comments

Install solidity doc gen npm install solidity-docgen

Get the correct compiler version npm install -D solc-0.7@npm:solc@0.7.6

Put the updated template contract.hbs in a /templates folder under the same directory as /contracts that you want to generate

Run npx solidity-docgen --solc-module solc-0.7 -t ./templates

How to generate markdown files from typescript comments

npm install --save-dev typedoc typedoc-plugin-markdown

Depending on how your project was created, you might have to install Typescript: npm install --save-dev typescript

npx typedoc --out <docs> src/index.ts

You might have to use the --skipErrorChecking flag to the typedoc command for cases where types are fetched during transpile time, such as contract ABIs.

See https://www.npmjs.com/package/typedoc-plugin-markdown for details.

How to Update search indices with algolia

Installation

yarn install

Local Development

yarn run start

This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.

Clear cache

yarn docusaurus clear

Build

yarn build

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

Deployment

The application automatically deployed to production using Vercel upon merge into main.