Skip to content

Add option to skip Katla syntax highlighting in build-book script #4

@gemmaro

Description

@gemmaro

Hello, thank you for maintaining this project!

Summary

Add an option to the build-book script to skip Katla syntax highlighting execution, allowing for faster setup and preview of mdBook documentation.

Background

I'm currently working on updating translation of this project from the original project (ref). During the translation process, both Pack compilation of the Idris project and Katla execution via the build-book script are performed. However, for translation work, I only need mdBook setup and execution to review the content.

Being able to skip Katla processing would significantly speed up the feedback loop when reviewing translation progress, as I can focus on the text content without waiting for syntax highlighting to complete.

Proposed Solution

Add support for skipping Katla execution through either:

  1. Environment variable (e.g., SKIP_KATLA=yes)
  2. Command-line argument (e.g., --skip-katla)

This would allow users to quickly preview their work while still being able to enable full Katla processing for final builds.

Current Workaround

I'm currently using this temporary patch to skip Katla processing:

diff --git a/scripts/build-book b/scripts/build-book
index 965bb86..2e512f5 100755
--- a/scripts/build-book
+++ b/scripts/build-book
@@ -45,6 +45,11 @@ for paths("src").race(batch => 1, degree => Kernel.cpu-cores * 16) -> $path {
     my $ttc-path = $ttc.add($path.IO.relative: "src").extension: "ttm";
     given $path.IO.extension {
         when "md" {
+            if %*ENV<SKIP_KATLA> {
+                say "Skip Katla for ", $rel-path;
+                copy-to-dest $rel-path;
+                next;
+            }
             # Use the presense of a ttm file to detect if this markdown file was a regular
             # markdown file or a literate idris document
             if $ttc-path ~~ :e {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions