Skip to content

Commit

Permalink
DOP-5303: Handle ast file facets in postprocessor (#642)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayangler authored Jan 27, 2025
1 parent edc552d commit 2ba426b
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 2ba426b

Please sign in to comment.