File tree Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ examples/%/_site: examples/%/_quarto.yml
5
5
cd examples/$* \
6
6
&& quarto add --no-prompt ../.. \
7
7
&& quarto add --no-prompt quarto-ext/shinylive
8
- cd examples/$* && python -m quartodoc build _quarto.yml --verbose
9
- cd examples/$* && python -m quartodoc interlinks
8
+ cd examples/$* && quartodoc build _quarto.yml --verbose
9
+ cd examples/$* && quartodoc interlinks
10
10
quarto render $(dir $< )
11
11
12
12
docs/examples/% : examples/% /_site
@@ -17,8 +17,8 @@ docs-build-examples: docs/examples/single-page docs/examples/pkgdown docs/exampl
17
17
18
18
docs-build : docs-build-examples
19
19
cd docs && quarto add --no-prompt ..
20
- cd docs && python -m quartodoc build
21
- cd docs && python -m quartodoc interlinks
20
+ cd docs && quartodoc build
21
+ cd docs && quartodoc interlinks
22
22
quarto render docs
23
23
24
24
requirements-dev.txt :
Original file line number Diff line number Diff line change @@ -74,10 +74,22 @@ def from_config(cls, cfg: "dict | Renderer | str"):
74
74
raise TypeError (type (cfg ))
75
75
76
76
if style .endswith (".py" ):
77
+ import os
78
+ import sys
77
79
import importlib
78
80
79
- mod = importlib .import_module (style .rsplit ("." , 1 )[0 ])
80
- return mod .Renderer (** cfg )
81
+ # temporarily add the current directory to sys path and import
82
+ # this ensures that even if we're executing the quartodoc cli,
83
+ # we can import a custom _renderer.py file.
84
+ # it probably isn't ideal, but seems like a more convenient
85
+ # option than requiring users to register entrypoints.
86
+ sys .path .append (os .getcwd ())
87
+
88
+ try :
89
+ mod = importlib .import_module (style .rsplit ("." , 1 )[0 ])
90
+ return mod .Renderer (** cfg )
91
+ finally :
92
+ sys .path .pop ()
81
93
82
94
subclass = cls ._registry [style ]
83
95
return subclass (** cfg )
Original file line number Diff line number Diff line change 39
39
jupyterlab
40
40
jupytext
41
41
42
+ [options.entry_points]
43
+ console_scripts =
44
+ quartodoc = quartodoc.__main__:cli
45
+
42
46
43
47
[project.scripts]
44
48
quartodoc = " quartodoc.cli:main"
You can’t perform that action at this time.
0 commit comments