Closed jameslamb closed 3 weeks ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Unfortunately that doesn't look happy either
hmmm yeah, so I guess this:
must run on the generated HTML, after it's already been rendered from markdown?
Because this is what I see in the page source for view-source:https://rapids-deployment--403.org.readthedocs.build/en/403/tools/kubernetes/dask-helm-chart/
[<code class="docutils literal notranslate"><span class="pre">dask_cuda_worker</span></code>](https://docs.rapids.ai/api/dask-cuda/nightly/index.html)
Would it be too weird to introduce some other, valid-in-a-URL, templating character for these cases? Like this?
https://docs.rapids.ai/api/dask-cuda/~~~rapids_api_docs_version~~~/index.html
And then modifying the replacement code to also replace that? I'm gonna try that.
I like that idea! But maybe it looks like that implementation still needs the spaces.
Got pulled away from this near the end of the day, it is not ready to merge. I'll get the templating working tomorrow.
No worries, I've moved it back to draft. Let me know when it's ready.
Ok @jacobtomlinson , I think I got this working!
As it turns out, none of these were correct:
These URLs weren't being templated because the docutils
code in this project was not processing URLs at all!
The use of docutils.nodes.SparseNodeVisitor
here...
... tells docutils
"only visit document nodes for which the visitor has a corresponding visit_{node_class}()
method defined". In our case here, that meant only Text
nodes, because that was the only visit_{node_class}()
method defined:
docutils
stored links (like those that in HTML would be <a href="..."></a>
) as a docutils.nodes.reference
instance. I added a visit_reference()
method on the class doing the templating, and implemented that method in a way that works with how docutils
stores URLs.
Other changes I made, to hopefully make this easier for the next person:
TextNodeVisitor -> RapidsCustomNodeVisitor
, to make it clearer that that name doesn't affect anything about how docutils
chooses which nodes to processI think we still want the use of a URL-valid templating string like `~~~, so that:
docutils
will correctly parse those links as docutils.nodes.reference
objectspre-commit
hooks that lint markdown will not complain about bare URLs
Contributes to #402.
dask-cuda
docs were moved from readthedocs todocs.rapids.ai
over a year ago (https://github.com/rapidsai/dask-cuda/pull/1211).This removes the remaining links to that readthedocs site, in favor of directing to the new official home of
dask-cuda
docs.While doing this, I also noticed that there are many places with hard-coded
/stable
or/nightly
references todocs.rapids.ai/api
. This proposes using templating to ensure that on the/nightly
version of the deployment docs, those point to the/nightly
version of RAPIDS docs.cc @charlesbluca for awareness