Comments (16)
@2bndy5 Can you open a PR to fix it?
from sphinx-immaterial.
There is existing code intended to prevent references to material.css
being added. It sounds like that is not working for you?
from sphinx-immaterial.
Let me know how can I test it or what shall I try.
The material.css file does not exist but the html references it.
When I tried to remove the html references to material.css, the result site looked empty, like it's html without any css at all.
from sphinx-immaterial.
You have to add sphinx_immaterial
as an extension, in addition to using it as your theme.
Refer to docs/conf.py
for details.
from sphinx-immaterial.
That did solve the material.css problem but now it causes a new problem that _static/documentation_options.js is missing.
Also, the site still looks like it lacks any formatting at all, it just looks like an html file with no css.
from sphinx-immaterial.
@jbms Let me know what I should change or test :)
from sphinx-immaterial.
Can you describe exactly how to build your documentation/reproduce the problem you are seeing, starting from an empty virtualenv?
from sphinx-immaterial.
I think I accidentally reproduced this... I opened the uploaded docs (from saved artifacts of my "build docs" CI workflow), and the html files don't use any styling at all
The styling does show in the published gh-pages though. I switched my docs/conf.py from your fork of sphinx-material to this repo, and the styling no longer is applied.
From generated index.html
<link rel="stylesheet" type="text/css" href="_static/material.css" />
However, there was no material.css in the _static folder
from sphinx-immaterial.
this also happens when building the docs for this repo. Albeit, I get a lot of warnings about missing stub files for numpy.polynomial.Polynomial
class
path/to/Documents/GitHub/env/lib/python3.8/site-packages/numpy/polynomial/polynomial.py:docstring of numpy.polynomial.polynomial.Polynomial:42: WARNING: autosummary: stub file not found 'numpy.polynomial.Polynomial.__call__'. Check your autosummary_generate setting.
but that may be a problem with numpy v1.21 (looks like they're somewhat aware of it)
from sphinx-immaterial.
@2bndy5 The material.css is solved by adding "sphinx_immaterial" as an extension.
I have a different issue now, explained in my comment above.
from sphinx-immaterial.
Ok I added it to the extensions list, I'm already using it as my theme, but the material.css still does not exist. In fact, I don't even see the following line in my index.html anymore.
<link rel="stylesheet" type="text/css" href="_static/material.css" />
@jbms incremental builds is working now - I don't get that error about the search cache. Not sure if that's intended or a maybe clue. EDIT I can do incremental builds with my test docs but this repo's docs still output
Exception occurred:
File "/path/to/env/lib/python3.8/site-packages/sphinx/search/__init__.py", line 283, in load
index2fn = frozen['docnames']
KeyError: 'docnames'
from sphinx-immaterial.
@2bndy5 I think material.css shouldn't exist so now you have it working as intended (that's what I understood at least.)
Do you have the other bug I wrote about (with the documentation_options.js) or is that working for you now?
from sphinx-immaterial.
Do you have the other bug I wrote about (with the documentation_options.js) or is that working for you now?
yes. I see it specified in index.html
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
but it doesn't exist in docs/_build/_static
from sphinx-immaterial.
@naor2013 just in case you missed the question, I'll quote it again (for completeness)
Can you describe exactly how to build your documentation/reproduce the problem you are seeing, starting from an empty virtualenv?
I'm currently doing
cd docs
pip install -r requirements.txt
sphinx-build . _build
where my docs/requirements.txt contains
git+https://github.com/jbms/sphinx-immaterial
sphinx-copybutton
and conf.py contains
sys.path.insert(0, os.path.abspath(".."))
extensions = [
"sphinx.ext.autosummary",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx.ext.graphviz",
"sphinx_copybutton",
# "rst2pdf.pdfbuilder", # for local pdf builder support
"sphinx_immaterial"
]
html_theme = "sphinx_immaterial"
# Material theme options
html_theme_options = {
"features": [
"navigation.expand",
# 'navigation.tabs',
# "toc.integrate",
"navigation.sections",
"navigation.instant",
# 'header.autohide',
"navigation.top",
# 'search.highlight',
# 'search.share',
],
"palette": [
{
"media": "(prefers-color-scheme: dark)",
"scheme": "slate",
"primary": "green",
"accent": "light blue",
"toggle": {
"icon": "material/lightbulb",
"name": "Switch to light mode",
},
},
{
"media": "(prefers-color-scheme: light)",
"scheme": "default",
"primary": "green",
"accent": "light blue",
"toggle": {
"icon": "material/lightbulb-outline",
"name": "Switch to dark mode",
},
},
],
"repo_url": "https://github.com/2bndy5/check-python-sources/",
"repo_name": "check-python-sources",
"repo_type": "github",
"globaltoc_depth": -1,
"globaltoc_collapse": False,
"globaltoc_includehidden": True,
}
html_title = "check-python-sources Github Action"
html_static_path = ["_static"]
html_favicon = "_static/favicon.png"
htmlhelp_basename = "check_python_sources_action_doc"
# html_copy_source = True
# html_show_sourcelink = True
from sphinx-immaterial.
So, I found out that the following folders are generated at build-time:
- sphinx_immaterial\static\javascripts
- sphinx_immaterial\static\stylesheets
but they aren't installed (like they were on the sphinx-material fork) with the rest of the theme.
@naor2013 you're right that material.css is not supposed to exist. Rather, the css that should be <link>-ed from the html is something like main.<ver or short sha>.min.css
(there's also an accompanied .map
file).
I'm determined to keep investigating, but it looks like there's a lot about nodejs that I have to learn going forward.
from sphinx-immaterial.
Found out that the setuptools.setup()
parameter include_package_data=True
is geared towards VCS data. I think since all the minified assets are specified in .gitignore file, they weren't getting copied over during install. I commented it out and the theme.conf stop getting copied over (which wasn't specified in .gitignore). I went further and manually specified the theme.conf & minified assets as extra package data like so
setuptools.setup(
# ...
packages=["sphinx_immaterial"],
package_dir={"sphinx_immaterial": "sphinx_immaterial"},
package_data={
"sphinx_immaterial": [
".icons/*/**",
".icons/*/*/**",
"partials/*.html",
"partials/*/*.html",
"partials/*/*/*.html",
"partials/*/*/*/*.html",
"static/*/**",
"*.html",
"theme.conf"
]
},
# include_package_data=True, # doesn't handle gitignored stuff at all
)
This put the proper files in with the installed pkg. Built the my docs again, and we're back in business!
from sphinx-immaterial.
Related Issues (20)
- Error when inherit a class that is inherited from pydantic.BaseModel HOT 7
- Referenced targets defined in docstrings are unresolved in summaries HOT 8
- Can `python.apigen` be used for documenting global variables? HOT 10
- Usage question: Automatic generation of one page per member HOT 3
- Site language selector HOT 7
- 0.11.7: pytest is failing on missing `sphinx_immaterial_pybind11_issue_134` module HOT 7
- Error while following sphinx tutorial about creating a todo ext HOT 8
- `@overload` expands common type unions HOT 5
- pydantic 2.5.0 release just broke this package HOT 6
- "Edit this page" on RTD HOT 9
- use libgit2 directly in merge script HOT 2
- Extra whitespace for rendered footnotes/citations HOT 10
- Rendering of :kbd: role is a bit off HOT 7
- document the `theme_result` extension
- Feature request: Mermaid js 10.x
- genindex / modindex seems broken HOT 1
- [jupiter-book] Missing Table of Contents HOT 1
- Google Fonts API key invalid? HOT 16
- "Copy to clipboard" and "Back to top" Buttons Disappear After Adjusting Theme Settings HOT 7
- Broken link to fontawesome/brands icons HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx-immaterial.