Skip to content
Snippets Groups Projects
Commit 377e9c68 authored by Martyn Gigg's avatar Martyn Gigg
Browse files

Add link to source document in mantiddoc directives

Stop warnings/errors coming out with no source information.
parent 9db47a8f
No related branches found
No related tags found
No related merge requests found
...@@ -73,9 +73,15 @@ class BaseDirective(Directive): ...@@ -73,9 +73,15 @@ class BaseDirective(Directive):
""" """
Inserts the currently tracked rst lines into the state_machine Inserts the currently tracked rst lines into the state_machine
""" """
self.state_machine.insert_input(self.rst_lines, "") self.state_machine.insert_input(self.rst_lines, self.source())
self.rst_lines = [] self.rst_lines = []
def source(self):
"""
Returns the full path to the source document
"""
return self.state.document.settings.env.docname
def make_header(self, name, pagetitle=False): def make_header(self, name, pagetitle=False):
""" """
Makes a ReStructuredText title from the algorithm's name. Makes a ReStructuredText title from the algorithm's name.
...@@ -207,5 +213,4 @@ class AlgorithmBaseDirective(BaseDirective): ...@@ -207,5 +213,4 @@ class AlgorithmBaseDirective(BaseDirective):
document. The expected name of the document is "AlgorithmName-v?", which document. The expected name of the document is "AlgorithmName-v?", which
is the name of the file with the extension removed is the name of the file with the extension removed
""" """
env = self.state.document.settings.env (self.algm_name, self.algm_version) = algorithm_name_and_version(self.source())
(self.algm_name, self.algm_version) = algorithm_name_and_version(env.docname)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment