Skip to content

feat: Add ability to read from file and find start point#14

Open
joelostblom wants to merge 1 commit intomainfrom
feat/read-file
Open

feat: Add ability to read from file and find start point#14
joelostblom wants to merge 1 commit intomainfrom
feat/read-file

Conversation

@joelostblom
Copy link
Copy Markdown

@joelostblom joelostblom commented Apr 8, 2026

This is mainly for inlining gallery examples in the user docs, avoid code duplication, and improve discoverability (via vega/altair#4002). The idea is to use it as such for gallery examples:

.. altair-plot:: gallery_example.py
    :start-after: # category:

The start-after option allows us to just grab the code of each gallery example, without the title and text which would be disturbing the flow of the user docs.

This is mainly for reading gallery examples into the user docs
and avoid code duplication.

- altair-plot now stores code_source_file metadata on the generated altair_plot node when a file argument is used.
- Kept inline behavior intact.
- Added safer file-arg detection so normal inline code isn’t misinterpreted as a path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant