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

DOP-5303: Handle ast file facets in postprocessor #642

Merged
merged 3 commits into from
Jan 27, 2025
Merged
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 snooty/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,16 @@ def propagate_facets(pages: Dict[FileId, Page], context: Context) -> None:
if parent_facets:
for file in files:
ext = os.path.splitext(file)[1]
if ext not in util.RST_EXTENSIONS:
if ext not in util.RST_EXTENSIONS and ext != ".ast":
continue

file_path = Path(os.path.join(base, file))
fileid = config.get_fileid(file_path)

if ext == ".ast":
# .ast files have their .txt fileids spoofed
fileid = FileId(fileid.as_posix().replace(".ast", ".txt"))

page = pages[fileid]
page.facets = parent_facets

Expand Down