Comments (10)
Edit: It turns out I am getting search terms from the sphinx_rtd_theme
versions of the webpage. https://galois.readthedocs.io/en/v0.0.24/index.html
I confirmed it with the "inspect" network tool
and with the realtime results from the GA dashboard
I think it would be valuable if sphinx-immaterial
could emit a ?q=
tag when searching. 👍
from sphinx-immaterial.
The normal sphinx search uses a separate webpage (search.html) with a ?q= query parameter to display search results and therefore works by default I suppose.
Sphinx immaterial has a custom search implementation designed to be similar to mkdocs-material that displays results directly on the same page in a drop-down menu and the query string ?q= parameter is not added, just like mkdocs-material. Perhaps you can see what is causing the q= events to be emitted in mkdocs-material using browser dev tools.
from sphinx-immaterial.
The normal sphinx search uses a separate webpage (search.html) with a ?q= query parameter to display search results and therefore works by default I suppose.
Yes, that is my understanding too.
Perhaps you can see what is causing the q= events to be emitted in mkdocs-material using browser dev tools.
Yes, I will try. I am very much out of my depth when it comes to web dev, though. I'll report back any successes or failures.
from sphinx-immaterial.
I discovered GA search support was added in squidfunk/mkdocs-material@c829555.
I believe this functionality currently corresponds to this code:
sphinx-immaterial/src/partials/integrations/analytics/google.html
Lines 40 to 46 in 6ceccff
@jbms I know you previously said (#34 (comment)):
I have made a lot of changes to the search code, so if there are any upstream changes to the search code, it may take some significant effort to resolve.
Where can I find the files that diverge from upstream regarding search? I'll try to determine if something is different that could be causing the issue.
from sphinx-immaterial.
I believe this file in upstream is important too. I cannot find it in our copy.
In fact, it seems the entire material/
directory is not included in our version. Is this intentional?
from sphinx-immaterial.
The material/
directory just contains automatically generated files derived from the other source files in the repository and its dependencies. In this theme we don't check those generated files into the repository; instead they are generated automatically as part of the build process.
The material/partials/integrations/analytics/google.html
file is just derived from the src/partials/integrations/analytics/google.html
file that you already found.
To see the files that diverge you can do a diff
against the src/
sub-directory.
from sphinx-immaterial.
I would like to (blindly) try things to resolve this, however I'm struggling "developing" with this theme.
@jbms and @2bndy5 how do you make and test changes to this theme?
Normally, I will install a Python package in "editable" mode pip3 install -e .
so that immediate changes in source are seen upon next import
. However, I get a permission error when I try that with sphinx-immaterial
. Currently, I'm making a change and then running pip3 install .
, which takes minutes to build the wheel. Any help/advice would be appreciated.
Editable install errors
matt@DESKTOP-I79NAGP:/mnt/c/Users/matth/repos/sphinx-immaterial$ pip3 install -e .
Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///mnt/c/Users/matth/repos/sphinx-immaterial
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: markupsafe in /usr/lib/python3/dist-packages (from sphinx-immaterial==0.2.post1.dev12) (1.1.0)
Requirement already satisfied: sphinx>=4.0 in /home/matt/.local/lib/python3.8/site-packages (from sphinx-immaterial==0.2.post1.dev12) (4.4.0)
Requirement already satisfied: sphinxcontrib-qthelp in /home/matt/.local/lib/python3.8/site-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (1.0.3)
Requirement already satisfied: Pygments>=2.0 in /home/matt/.local/lib/python3.8/site-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (2.10.0)
Requirement already satisfied: Jinja2>=2.3 in /usr/lib/python3/dist-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (2.10.1)
Requirement already satisfied: sphinxcontrib-devhelp in /home/matt/.local/lib/python3.8/site-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (1.0.2)
Requirement already satisfied: sphinxcontrib-serializinghtml>=1.1.5 in /home/matt/.local/lib/python3.8/site-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (1.1.5)
Requirement already satisfied: requests>=2.5.0 in /usr/lib/python3/dist-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (2.22.0)
Requirement already satisfied: importlib-metadata>=4.4 in /home/matt/.local/lib/python3.8/site-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (4.11.1)
Requirement already satisfied: imagesize in /usr/lib/python3/dist-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (1.2.0)
Requirement already satisfied: packaging in /usr/lib/python3/dist-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (20.3)
Requirement already satisfied: alabaster<0.8,>=0.7 in /usr/lib/python3/dist-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (0.7.8)
Requirement already satisfied: babel>=1.3 in /usr/lib/python3/dist-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (2.6.0)
Requirement already satisfied: sphinxcontrib-htmlhelp>=2.0.0 in /home/matt/.local/lib/python3.8/site-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (2.0.0)
Requirement already satisfied: docutils<0.18,>=0.14 in /usr/lib/python3/dist-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (0.16)
Requirement already satisfied: snowballstemmer>=1.1 in /usr/lib/python3/dist-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (2.0.0)
Requirement already satisfied: sphinxcontrib-jsmath in /home/matt/.local/lib/python3.8/site-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (1.0.1)
Requirement already satisfied: sphinxcontrib-applehelp in /home/matt/.local/lib/python3.8/site-packages (from sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (1.0.2)
Requirement already satisfied: zipp>=0.5 in /usr/lib/python3/dist-packages (from importlib-metadata>=4.4->sphinx>=4.0->sphinx-immaterial==0.2.post1.dev12) (1.0.0)
Installing collected packages: sphinx-immaterial
Running setup.py develop for sphinx-immaterial
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [32 lines of output]
running develop
/tmp/pip-build-env-5ch1rbpo/overlay/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
WARNING: The user site-packages directory is disabled.
/tmp/pip-build-env-5ch1rbpo/overlay/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build
and pip and other standards-based tools.
warnings.warn(
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/lib/python3.8/site-packages/test-easy-install-857.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/lib/python3.8/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://setuptools.pypa.io/en/latest/deprecated/easy_install.html
Please make the appropriate changes for your system and try again.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [32 lines of output]
running develop
/tmp/pip-build-env-5ch1rbpo/overlay/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
WARNING: The user site-packages directory is disabled.
/tmp/pip-build-env-5ch1rbpo/overlay/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and
pip and other standards-based tools.
warnings.warn(
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/lib/python3.8/site-packages/test-easy-install-857.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/lib/python3.8/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://setuptools.pypa.io/en/latest/deprecated/easy_install.html
Please make the appropriate changes for your system and try again.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
from sphinx-immaterial.
I'm not sure about the permission issues --- maybe there is something we need to fix --- but I'd recommend using a virtualenv, which I think may fix the permission issues.
In addition to using pip install -e .
, after doing that, you can run: npm run start
. That will incrementally rebuild after any changes to the CSS or Javascript.
You will still need to re-run sphinx-build -a
after any changes though to generate your documentation.
from sphinx-immaterial.
My workflow has become
- Build in WSL Ubuntu bash (from windows)
python setup.py bdist_wheel
- Install the wheel on windows
pip install dist/sphinx-immaterial.0.x.x-devx.postx.whl
- If I want to make changes without rebuilding, I do it in the site-packages install folder (no
-e
needed).
All of this I do from within python venv(on Linux and Windows).
python -m venv env
source env/bin/activate
Command is a bit different to activate venv on Windows, but Windows terminal runs faster than Ubuntu bash on Windows. The theme has to be packaged from Linux though, otherwise the built CSS and JS bundles are named incorrectly.
from sphinx-immaterial.
Thank you both. I will give that a try.
from sphinx-immaterial.
Related Issues (20)
- documentation build fails with manpage sphinx builder HOT 16
- 0.11.3: pytest is failing HOT 6
- BUG/ENH: Common Sphinx directives have no style applied HOT 26
- Glossary directive produces 2 permalinks HOT 1
- Editable install no longer runs nodejs build step HOT 4
- Create `myst-example` directive and change documentation to use it HOT 2
- `repo_type` not used and `repo_name` can be intuitive
- New Social Media Card extension HOT 16
- Search missing results HOT 1
- thoughts about a theme logo? HOT 4
- Sphinx will have better support for multi-line python signatures. HOT 4
- pydantic v2.0 breaking custom admonitions HOT 1
- Support for `numpy.typing` HOT 7
- Line block does not preserve indent HOT 5
- Is there a way to internationalize json domain titles ? HOT 1
- `Literal` inconsistent processing HOT 9
- Document `versions.json` workaround when a server doesn't automatically forward to `index.html` HOT 1
- Issue with self.css_files attributes? HOT 13
- Enabling MathJax extensions breaks it completely HOT 3
- sphinx_immaterial.custom_admonitions always flagged as "changed" HOT 13
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.