Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable a more aggressive caching of conversion results #85

Merged
merged 2 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion template.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
ROOT_DIRECTORY = Path(__file__).parent.resolve()
SCHEMA_DIRECTORY = ROOT_DIRECTORY / 'schema'
ROOT_COPY_DIRECTORY = CURRENT_DIRECTORY / 'istqb_product_base'
EXAMPLE_DOCUMENT = CURRENT_DIRECTORY / 'example-document.tex'

CURRENT_REPOSITORY: Optional[Repo]
try:
Expand Down Expand Up @@ -472,7 +473,7 @@ def _compile_tex_file_to_pdf(input_path: Path) -> Optional[Path]:
if not _should_compile_tex_file_to_pdf(input_path):
return
_run_command('latexmk', '-gg', '-r', f'{LATEXMKRC}', f'{input_path}')
if input_path.name != 'example-document.tex':
if input_path != EXAMPLE_DOCUMENT:
with input_path.with_suffix('.istqb_project_name').open('rt') as f:
project_name = f.read().strip()
output_path = Path(f'{project_name}.pdf')
Expand Down Expand Up @@ -563,6 +564,9 @@ def _compile_fn(args: Tuple['CompilationFunction', Path, Tuple[Any], Dict[Any, A
def _should_compile_tex_file(input_path: Path) -> bool:
if _should_do_full_compile():
return True
if input_path == EXAMPLE_DOCUMENT:
return True

changed_paths = set(_changed_paths())
referenced_paths = set(chain([input_path], _get_references_from_tex_file([input_path])))
return bool(referenced_paths & changed_paths)
Expand Down
6 changes: 6 additions & 0 deletions template/markdownthemeistqb_common.sty
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
{1.0.0}%
{LaTeX theme for the Markdown Package that contains common code for different types of ISTQB documents}

% General setup
\markdownSetup
{
eagerCache,
}

% Hybrid Markdown + LaTeX text
\markdownSetup
{
Expand Down
Loading