File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed
swagger_plugin_for_sphinx Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 5.0.1
4+
5+ * Fix some errors when the spec is in a subdirectory
6+
37## 5.0.0
48
59This release combines the previous three way into one directive streamlining the project
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44
55[project ]
66name = " swagger-plugin-for-sphinx"
7- version = " 5.0.0 "
7+ version = " 5.0.1 "
88description = " Sphinx plugin which renders a OpenAPI specification with Swagger"
99authors = [{
name =
" Kai Harder" ,
email =
" [email protected] " }]
1010readme = " README.md"
Original file line number Diff line number Diff line change @@ -55,14 +55,14 @@ def run(self) -> list[nodes.Node]:
5555 )
5656
5757 rel_parts = Path (relpath ).parts
58- static = Path ( app . srcdir ). joinpath ( rel_parts [ 0 ] )
59- logger . info ( f"Adding to html_static_path: { static } ." )
60- app . config . html_static_path . extend ([ static ])
61-
62- # If the relative path does not start with _static/, add it.
63- url_path = self . arguments [ 0 ]
64- if not url_path . startswith ( "_static/" ):
65- url_path = "_static/" + url_path
58+ logger . info ( f"Adding to html_static_path: { spec } ." )
59+ app . config . html_static_path . extend ([ spec ] )
60+
61+ url_path = (
62+ "../" . join ([ "" for _ in range ( len ( rel_parts ))])
63+ + "_static/"
64+ + self . arguments [ 0 ]
65+ )
6666
6767 config = {
6868 "full_page" : "full-page" in self .options ,
You can’t perform that action at this time.
0 commit comments