refactor: Split note file
This commit is contained in:
parent
bc2e0ee222
commit
b1bbd272da
4 changed files with 51 additions and 28 deletions
|
@ -10,7 +10,17 @@ import Mathlib.Lean.CoreM
|
|||
import ImportGraph.RequiredModules
|
||||
/-!
|
||||
|
||||
## Basic Lean meta programming commands
|
||||
## Underlying structure for notes
|
||||
|
||||
This file contains the necessary structures that must be imported into a file
|
||||
for it to be turned into a Lean note.
|
||||
|
||||
It allows for the
|
||||
- `note ...` command to be used to add notes to a Lean file
|
||||
- `note_attr` attribute to be used to display formally verified commands within a note.
|
||||
- `note_attr_informal` attribute to be used to display informal commands within a note.
|
||||
|
||||
Other results relating to notes are in other files.
|
||||
|
||||
-/
|
||||
|
||||
|
@ -100,30 +110,4 @@ initialize noteInformalAttribute : Unit ←
|
|||
modifyEnv fun env => noteInformalDeclExtension.addEntry env declName
|
||||
}
|
||||
|
||||
/-!
|
||||
|
||||
## Notes
|
||||
|
||||
-/
|
||||
|
||||
/-- A note consists of a title and a list of Lean files which make up the note. -/
|
||||
structure NoteFile where
|
||||
/-- The overall title of the note. -/
|
||||
title : String
|
||||
/-- The abstract of the note. -/
|
||||
abstract : String
|
||||
/-- A list of authors. -/
|
||||
authors : List String
|
||||
/-- The files making up the note in the order in which they should appear. -/
|
||||
files : List Name
|
||||
|
||||
namespace NoteFile
|
||||
|
||||
variable (N : NoteFile)
|
||||
|
||||
/-- All imports associated to a note. -/
|
||||
def imports : Array Import := (N.files.map fun f => {module := f}).toArray
|
||||
|
||||
end NoteFile
|
||||
|
||||
end HepLean
|
||||
|
|
|
@ -3,7 +3,7 @@ Copyright (c) 2024 Joseph Tooby-Smith. All rights reserved.
|
|||
Released under Apache 2.0 license.
|
||||
Authors: Joseph Tooby-Smith
|
||||
-/
|
||||
import HepLean.Meta.Notes.Basic
|
||||
import HepLean.Meta.Notes.NoteFile
|
||||
import HepLean.Meta.Basic
|
||||
import HepLean.Meta.Informal
|
||||
/-!
|
||||
|
|
38
HepLean/Meta/Notes/NoteFile.lean
Normal file
38
HepLean/Meta/Notes/NoteFile.lean
Normal file
|
@ -0,0 +1,38 @@
|
|||
/-
|
||||
Copyright (c) 2024 Joseph Tooby-Smith. All rights reserved.
|
||||
Released under Apache 2.0 license.
|
||||
Authors: Joseph Tooby-Smith
|
||||
-/
|
||||
import HepLean.Meta.Notes.Basic
|
||||
/-!
|
||||
|
||||
# Note file
|
||||
|
||||
A note file is a structure which contains the information to go into a note.
|
||||
|
||||
-/
|
||||
|
||||
namespace HepLean
|
||||
open Lean System Meta
|
||||
|
||||
/-- A note consists of a title and a list of Lean files which make up the note. -/
|
||||
structure NoteFile where
|
||||
/-- The overall title of the note. -/
|
||||
title : String
|
||||
/-- The abstract of the note. -/
|
||||
abstract : String
|
||||
/-- A list of authors. -/
|
||||
authors : List String
|
||||
/-- The files making up the note in the order in which they should appear. -/
|
||||
files : List Name
|
||||
|
||||
namespace NoteFile
|
||||
|
||||
variable (N : NoteFile)
|
||||
|
||||
/-- All imports associated to a note. -/
|
||||
def imports : Array Import := (N.files.map fun f => {module := f}).toArray
|
||||
|
||||
end NoteFile
|
||||
|
||||
end HepLean
|
Loading…
Add table
Add a link
Reference in a new issue