Skip to content

Commit

Permalink
Convert YAML file paths to abspath (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewu63 committed Apr 7, 2022
1 parent d0796f5 commit 68b971b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sphinx_mdolab_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sphinx


__version__ = "1.3.10"
__version__ = "1.3.11"
__version_full__ = __version__


Expand Down
2 changes: 2 additions & 0 deletions sphinx_mdolab_theme/ext/optionslist.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def get_options_from_yaml(self):
def get_descriptions(self):
if "filename" in self.options:
self.filename = self.options["filename"]
source_file = self.state.document.attributes["source"]
self.filename = os.path.join(os.path.dirname(source_file), self.filename)
if not os.path.isfile(self.filename):
raise FileNotFoundError(f"The file {self.filename} must exist! Failed module is {self.member_name}.")

Expand Down
2 changes: 2 additions & 0 deletions sphinx_mdolab_theme/ext/optionstable.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def get_options_informs(self):
def get_descriptions(self):
if "filename" in self.options:
self.filename = self.options["filename"]
source_file = self.state.document.attributes["source"]
self.filename = os.path.join(os.path.dirname(source_file), self.filename)
if not os.path.isfile(self.filename):
raise FileNotFoundError(f"The file {self.filename} must exist! Failed module is {self.member_name}.")

Expand Down

0 comments on commit 68b971b

Please sign in to comment.