Lean files can use elaborators that read files at compile time. For example include_str in doc-gen4 reads the specified file during compilation and inserts the file's contents as a string literal. The Base.lean file contains this:
def styleCss : String := include_str "../../static/style.css"
If static/style.css changes, then Base.lean needs to be recompiled.
leanprover/lake#58 suggested adding an environment extension which stores the referenced files. Then include_str would add the filename to the environment extension. Lake could then read the referenced files from the .olean file, which contains the serialized environment extension.
Lean files can use elaborators that read files at compile time. For example
include_strin doc-gen4 reads the specified file during compilation and inserts the file's contents as a string literal. TheBase.leanfile contains this:If
static/style.csschanges, thenBase.leanneeds to be recompiled.leanprover/lake#58 suggested adding an environment extension which stores the referenced files. Then
include_strwould add the filename to the environment extension. Lake could then read the referenced files from the.oleanfile, which contains the serialized environment extension.