[SPARK-46437][DOCS] Add custom tags for conditional Jekyll includes #44630
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Add custom Jekyll tags to enable us to conditionally include files in our documentation build in a more user-friendly manner. This example demonstrates how a custom tag can build on one of Jekyll's built-in tags.
Without this change, files have to be included as follows:
With this change, they can be included more intuitively in one of two ways:
include_relative_if_exists
includes a file if it exists and substitutes an HTML comment if not. Use this tag when it's always OK for an include not to exist.include_api_gen
includes a file if it exists. If it doesn't, it tolerates the missing file only if one of theSKIP_
flags is set. Otherwise it raises an error. Use this tag for includes that are generated for the language APIs. These files are required to generate complete documentation, but we tolerate their absence during development---i.e. when a skip flag is set.include_api_gen
will place a visible text placeholder in the document and post a warning to the console to indicate that missing API files are being tolerated.This PR supersedes #44393.
Why are the changes needed?
Jekyll does not have a succinct way to check if a file exists, so the required directives to implement such functionality are very cumbersome.
We need the ability to do this so that we can build the docs successfully with
SKIP_API=1
, since many includes reference files that are only generated whenSKIP_API
is not set.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Manually building and reviewing the docs, both with and without
SKIP_API=1
.Was this patch authored or co-authored using generative AI tooling?
No.