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

Feature request: exclude certain static assets from processing #4811

Closed
cpitclaudel opened this issue Apr 3, 2018 · 7 comments
Closed

Feature request: exclude certain static assets from processing #4811

cpitclaudel opened this issue Apr 3, 2018 · 7 comments
Labels
type:proposal a feature suggestion
Milestone

Comments

@cpitclaudel
Copy link
Contributor

cpitclaudel commented Apr 3, 2018

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!

@jfbu
Copy link
Contributor

jfbu commented Apr 3, 2018

Is it needed your source files are in _static? Testing with foo.fs file in _extras/ sub-directory of config directory and html_extra_path = ['_extras'], the file foo.fs is in _build/html/ and not in _build/html/_static/.

(edited)

ah sorry I see now you said

Users copy them into their _static directory, under _static/myextensionsassets.

which was clear enough...

@jfbu
Copy link
Contributor

jfbu commented Apr 3, 2018

Why not then _myextensionassets rather than _static/myextensionassets? (and of course html_extra_path = ['_myextensionassets']

@cpitclaudel
Copy link
Contributor Author

Why not then _myextensionassets rather than _static/myextensionassets? (and of course html_extra_path = ['_myextensionassets']

The problem is that I don't want to pollute the website's root (so I want everything to be copied not to build/html, but to build/html/somefolder/. You can do this currently by creating dummyfolder/myextensionassets and adding html_extra_path = ['dummyfolder'], but it's not great to have to explain that to users.

@picbox474
Copy link

picbox474 commented Apr 4, 2018 via email

@tk0miya
Copy link
Member

tk0miya commented Apr 5, 2018

What did you mean "processing"? Scanning source files on html_static_path?
If so, I agree with you. I also feel the behavior is strange. I believe nobody wants to read source files from static directories.

@tk0miya tk0miya added the type:proposal a feature suggestion label Apr 5, 2018
@tk0miya tk0miya added this to the 1.8 milestone Apr 5, 2018
@cpitclaudel
Copy link
Contributor Author

What did you mean "processing"? Scanning source files on html_static_path?

Right, exactly; converting to HTML.

tk0miya added a commit to tk0miya/sphinx that referenced this issue Apr 27, 2018

Verified

This commit was signed with the committer’s verified signature.
szokeasaurusrex Daniel Szoke
…om source
tk0miya added a commit to tk0miya/sphinx that referenced this issue May 3, 2018
@tk0miya tk0miya closed this as completed in cbf4ee2 May 3, 2018
tk0miya added a commit that referenced this issue May 3, 2018
…c_path

Fix #4811: The files under html_static_path are excluded from source
@tk0miya
Copy link
Member

tk0miya commented May 3, 2018

Fixed by #4908.
Thank you for reporting!

kratsg added a commit to scikit-hep/pyhf that referenced this issue Mar 5, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:proposal a feature suggestion
Projects
None yet
Development

No branches or pull requests

4 participants