Skip to content

Feature request: exclude certain static assets from processing  #4811

@cpitclaudel

Description

@cpitclaudel

Hi there,

If I understand correctly, there is no way at the moment to tell Sphinx to not process certain source files (but still include them in the output). In my case I have source files in _static, and I don't want Sphinx to touch them — they are just there to be downloaded.

Using exclude_patterns, Sphinx will ignore the files entirely and omit them from the output. Using html_extra_path, Sphinx will copy the files twice (once is html/_static and once in html).

Is there a way to tell Sphinx to not process certain documents, but still include them in the output directories? I know one trick (add _static/<folder name> to the exclusion list, which will work because the document finder uses full paths whereas copy_assets uses paths rooted at _static), but I'm not sure if it's intended to work that way.

Background: I have a Sphinx extension that turns source files (extension: .fs) with special comments into a reST document. To work well, this extensions needs extra javascript and CSS files, but also WebAssembly files (.wasm) and other source files (.fs). There extra files are large, so they are distributed separately from the extension. Users copy them into their _static directory, under _static/myextensionsassets. Unfortunately, Sphinx tries to process all the .fs files in _static, which takes a long time and isn't useful.

Environment info

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions