chore: disable automatic latex build

currently the PDF will not re-generate if an image is updated
This commit is contained in:
relikd
2023-03-03 23:14:29 +01:00
parent 2911bfe705
commit 542f2d1987
3 changed files with 16 additions and 16 deletions

View File

@@ -64,7 +64,7 @@ server-v:
# --buildstate-path is relative to current working directory
.PHONY: build
build: dist
@$(LEKTOR) build --output-path ../bin --buildstate-path build-state -f ENABLE_PDF_EXPORT
@$(LEKTOR) build --output-path ../bin --buildstate-path build-state # -f ENABLE_PDF_EXPORT
.PHONY: deploy
deploy:

View File

@@ -27,7 +27,7 @@ Install
3. Run `make dev server` to run a local server and preview the page.
4. For distribution run `make build deploy` and add an [official deploy](https://www.getlektor.com/docs/deployment/).
4. For distribution run `make build pdf deploy` and add an [official deploy](https://www.getlektor.com/docs/deployment/).
### Modify

View File

@@ -45,22 +45,22 @@ class MainPlugin(Plugin):
# 'len': len,
# 'now': datetime.now
# })
# Latex -> PDF Build program
make_pdf = extra.get('extra_flags', {}).get('ENABLE_PDF_EXPORT', False)
TexSources.registerBuilder(self.env, enabled=make_pdf)
# # Latex -> PDF Build program
# make_pdf = extra.get('extra_flags', {}).get('ENABLE_PDF_EXPORT', False)
# TexSources.registerBuilder(self.env, enabled=make_pdf)
def on_after_build(
self, builder: 'Builder', source: 'Record', **extra: Any
) -> None:
if not isinstance(source, Page):
return # ignore Asset, Directory, etc.
if source.path.endswith('.tex'): # type: ignore[attr-defined]
TexSources.add(builder, source)
# def on_after_build(
# self, builder: 'Builder', source: 'Record', **extra: Any
# ) -> None:
# if not isinstance(source, Page):
# return # ignore Asset, Directory, etc.
# if source.path.endswith('.tex'): # type: ignore[attr-defined]
# TexSources.add(builder, source)
def on_after_build_all(self, builder: 'Builder', **extra: Any) -> None:
# must run after all sources are built
# or else latex fails because it cannot find referenced images
TexSources.build(builder)
# def on_after_build_all(self, builder: 'Builder', **extra: Any) -> None:
# # must run after all sources are built
# # or else latex fails because it cannot find referenced images
# TexSources.build(builder)
def on_after_prune(self, builder: 'Builder', **extra: Any) -> None:
root = self.env.root_path # type: str