You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to leave the comment header of fortran blocks as raw text without interpreting it as ReST please ?
A possible fix is adding the following lines,
in the function scan_container of file fortran_autodoc.f90. The new variable raw_desc should be True if such option was selected when processing the fortran blocks.
Or perhaps, is there another way of achiving this behavior?
Thanks in advance for your kind attention.
The text was updated successfully, but these errors were encountered:
In the definition of F90toRst.scan_container, you can add these following lines:
# Comment
block['desc'] = self.get_comment(subsrc, aslist=True)
indent = ''
in_codeblock = False
i = 0
while i < len(block['desc']):
line = block['desc'][i]
if not in_codeblock:
if line.startswith(' '): # get current indent
indent = re.split(r'[^\s]', line)[0]
if line == '*': # code-block starts with !*
in_codeblock = True
block['desc'][i] = indent + '.. code-block::'
block['desc'].insert(i, '') # insert empty line before directive
i += 2
block['desc'].insert(i, '') # insert empty line after directive
else:
if line == '*': # code-block ends with !*
in_codeblock = False
block['desc'][i] = ''
continue
block['desc'][i] = indent + ' ' + line
i += 1
Please note that a code-block directive will start and end with !*. Here's a MWE:
Hello,
Is it possible to leave the comment header of fortran blocks as raw text without interpreting it as ReST please ?
A possible fix is adding the following lines,
right after,
in the function scan_container of file
fortran_autodoc.f90
. The new variable raw_desc should be True if such option was selected when processing the fortran blocks.Or perhaps, is there another way of achiving this behavior?
Thanks in advance for your kind attention.
The text was updated successfully, but these errors were encountered: