feat: Improved todo list
This commit is contained in:
parent
1b2cc5338f
commit
ca044d3786
37 changed files with 180 additions and 42 deletions
42
scripts/MetaPrograms/TODO_to_yml.lean
Normal file
42
scripts/MetaPrograms/TODO_to_yml.lean
Normal file
|
@ -0,0 +1,42 @@
|
|||
/-
|
||||
Copyright (c) 2024 Joseph Tooby-Smith. All rights reserved.
|
||||
Released under Apache 2.0 license.
|
||||
Authors: Joseph Tooby-Smith
|
||||
-/
|
||||
import HepLean.Meta.Basic
|
||||
import HepLean.Meta.TODO.Basic
|
||||
/-!
|
||||
|
||||
# Turning TODOs into YAML
|
||||
|
||||
-/
|
||||
|
||||
open Lean System Meta HepLean
|
||||
|
||||
|
||||
unsafe def getTodoInfo : MetaM (List todoInfo) := do
|
||||
let env ← getEnv
|
||||
let todoInfo := (todoExtension.getState env)
|
||||
pure (todoInfo.qsort (fun x y => x.fileName.toString < y.fileName.toString)).toList
|
||||
|
||||
def todoToYAML (todo : todoInfo) : MetaM String := do
|
||||
return s!"
|
||||
- content: \"{todo.content}\"
|
||||
file: {todo.fileName}
|
||||
githubLink: {← Name.toGitHubLink todo.fileName todo.line}
|
||||
line: {todo.line}"
|
||||
|
||||
unsafe def todosToYAML : MetaM String := do
|
||||
let todos ← getTodoInfo
|
||||
let todosYAML ← todos.mapM todoToYAML
|
||||
return String.intercalate "\n" todosYAML
|
||||
|
||||
unsafe def main (args : List String) : IO UInt32 := do
|
||||
initSearchPath (← findSysroot)
|
||||
let ymlString ← CoreM.withImportModules #[`HepLean] (todosToYAML).run'
|
||||
println! ymlString
|
||||
let fileOut : System.FilePath := {toString := "./docs/_data/TODO.yml"}
|
||||
if "mkFile" ∈ args then
|
||||
IO.println (s!"TODOList file made.")
|
||||
IO.FS.writeFile fileOut ymlString
|
||||
pure 0
|
|
@ -18,6 +18,7 @@ def pertubationTheory : NoteFile where
|
|||
abstract := "Notes on perturbation theory in quantum field theory."
|
||||
authors := ["Joseph Tooby-Smith"]
|
||||
files := [
|
||||
|
||||
]
|
||||
|
||||
unsafe def main (_ : List String) : IO UInt32 := do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue