sethfischer / sphinxcontrib-cadquery Goto Github PK
View Code? Open in Web Editor NEWSphinx extension for rendering CadQuery models with VTK.js.
Home Page: https://sphinxcontrib-cadquery.readthedocs.io/
License: Other
Sphinx extension for rendering CadQuery models with VTK.js.
Home Page: https://sphinxcontrib-cadquery.readthedocs.io/
License: Other
First of all THANKS! I was using cadquery-server to generate a static site with my models. While it works very well it is quite hard to customize. Sphinx makes that MUCH easier. One feature I miss though is the ability to export links to the models for download.
When I present my models I like to provide a download link to the part. Like below:
Right now I just have my pipeline run the export before the sphinx round and throw them in the _static
directory. It would be cool to have a directive like this:
.. cadquery-export::
:format: stl
:caption: 3D print
:name: front.stl
result = cadquery.Workplane("front").box(2, 2, 0.5)
Where :format:
is optional and the :name:
would be used similarly to the cadquery export behavior.
That would present a link for download similar to the download directive below:
:download:`3D print <front.stl>`
Theoretically, the export function of the cqgi interface could be used. I have never written a directive before, so maybe that won't work for generating a file.
One other choice (while IMHO less flexible) could be to add a parameter like :export: file.stl
that can add a download link next to the image like the image above.
.. cadquery-svg::
:export: file.3mf
result = cadquery.Workplane("front").box(2, 2, 0.5)
show_object(result)
Read the Docs build fails with ModuleNotFoundError: No module named 'sphinxcontrib.cadquery'
:
python -m sphinx -T -E -b html -d _build/doctrees -D language=en . $READTHEDOCS_OUTPUT/html
⋮
Configuration error:
There is a programmable error in your configuration file:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinxcontrib-cadquery/envs/39/lib/python3.9/site-packages/sphinx/config.py", line 350, in eval_config_file
exec(code, namespace)
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinxcontrib-cadquery/checkouts/39/docs/conf.py", line 7, in <module>
import sphinxcontrib.cadquery
ModuleNotFoundError: No module named 'sphinxcontrib.cadquery'
When added to .readthedocs.yaml
: build.jobs.post-install
the following also fails:
python -c "import sphinxcontrib.cadquery; print(sphinxcontrib.cadquery.__version__)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'sphinxcontrib.cadquery'
Last successful build: Build #19376393 dated Feb. 4, 2023. 1:54 a.m.
First failed build: Build #19562383 dated Feb. 22, 2023. 9:39 a.m.
The poetry install
command reports successful installation of the project package:
poetry install
⋮
Installing the current project: sphinxcontrib-cadquery (0.4.0)
Dependencies installed with poetry install
are available for import e.g cadquery
, just not the current (root) project.
Build 19088114 is expected to use Sphinx 5.3.0, rather it uses Sphinx 6.1.1.
Build 19088114 uses Poetry to install dependencies with a post_create_environment
user-defined job, in a manner recommended by RTD.
As expected poetry install
installs Sphinx 5.3.0. This is confirmed with poetry show sphinx
in post_create_environment
.
However, when the following is run by RTD:
/home/docs/checkouts/readthedocs.org/user_builds/sphinxcontrib-cadquery/envs/1/bin/python -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
The output shows that Sphinx 6.1.1 is being used:
Running Sphinx v6.1.1
WARNING: html_static_path entry '_static' does not exist
building [mo]: targets for 0 po files that are out of date
writing output...
⋮
.readthedocs.yaml
:
version: 2
build:
os: ubuntu-20.04
tools:
nodejs: "19"
python: "3.9"
jobs:
post_create_environment:
# install Poetry
- pip install poetry
- poetry config virtualenvs.create false
# install Python dependencies
- poetry install
- poetry show sphinx
post_install:
# install Node.js dependencies
- npm clean-install
# build
- npm run build
sphinx:
configuration: docs/conf.py
In pyproject.toml
ipython is specified as a dependency.
This should not be required as ipython is a dependency of cadquery.
In sphinxcontrib-cadquery's pyproject.toml
:
[tool.poetry.dependencies]
python = ">=3.9,<3.11"
Sphinx = "^5.3.0"
ipython = ">=7.31.1"
jinja2 = ">=3.0"
Embedded VTK XML is indexed by Sphinx search.
https://rover.fischer.nz/en/latest/search.html?q=VTK&check_keywords=yes&area=default
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.