Physlib
Ways to Contribute

Learn

Documentation Guide

Use this guide to add module documentation to a Lean file in Physlib.

Steps to Help with Documentation

This whole process can be done without downloading Lean, but having it installed provides helpful tools.

Phase 1: Get the Code

  1. Fork the Physlib GitHub repository (copy the master branch only). The GitHub Guide has the commands.
  2. Clone your forked repository to your local machine. (Optional — you can also edit directly on GitHub.)

Phase 2: Choose a File to Document

  1. Choose a file from the Documentation task list, or select a red node in the import graph.
  2. In your local copy of Physlib, open the file ./scripts/lint/exemptions/module_doc_no_lint.txt.
  3. Remove the line corresponding to the file you want to document.
  4. Navigate to the file you want to document.

Phase 3: Write the Documentation

  1. Add a title heading at the top of the file, starting with # .
  2. Add a ## i. Overview section explaining the physical content.
  3. Add a ## ii. Key results section listing key definitions, theorems, and lemmas.
  4. Add a ## iii. Table of contents section listing the lettered sections of the file, as - A. ….
  5. Add a ## iv. References section for relevant literature.
  6. Organize the rest of the file with lettered section and subsection headings: ## A. …, ### A.1. …. No heading may end in a full stop.
  7. If you have Lean installed, check the layout with lake exe module_doc_lint.

Phase 4: Submit Your Changes

  1. Commit your changes to your forked repository.
  2. Create a pull request to the main Physlib repository for review, as described in the GitHub Guide.

Import graph

See which Lean files import each other. An arrow from A to B means B imports A.

Loading graph…