Helping with documentation
Graph controls: Use mouse to pan, use scroll or two fingers to zoom in/out. Click on nodes to navigate to their GitHub entry.
Eventually we want to turn all the nodes in this graph green by adding documentation. To help follow the steps below!
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
- Fork the PhysLean GitHub repository. (Copy the master branch only)
- Clone your forked repository to your local machine. (Optional, you can also edit directly on GitHub)
Phase 2: Choose a File to Document
- Use the graph above to identify an undocumented file (a red node) where you think you could help.
- In your local copy of PhysLean, open the file
./scripts/MetaPrograms/module_doc_no_lint.txt. - Remove the line corresponding to the file you want to document.
- Navigate to the file you want to document.
Phase 3: Write the Documentation
You can write the documentation manually or use a helper script if you have Lean installed. See any of the green nodes in the graph for examples of good documentation.
Option A: Without Lean
Edit the .lean file you chose and add the following sections:
- Module Title: Add a title heading at the top of the file, starting with
#. - Overview: Add an
## i. Overviewsection after the title, explaining the physical content of the module. - Key Results: Add a
## ii. Key resultssection. This should list the key definitions, theorems, and lemmas with brief explanations. - Table of Contents: Add a
## iii. Table of contentssection. This can be left blank and will be filled in automatically later. - References: Add a
## iv. Referencessection for any relevant literature. - Structure the Code: Organize the rest of the file with section and subsection headings (e.g.,
## A.,### A.1.,#### A.1.2).
Option B: With Lean
If you have Lean installed, a script can help you structure the documentation.
- Run
lake exe module_doc_lintin your terminal. - Follow the interactive steps, using existing documented files as a guide.
Phase 4: Submit Your Changes
- Commit your changes to your forked repository.
- Create a pull request to the main PhysLean repository for review.