Skip to content

Commit f1b3806

Browse files
committed
0.3.3
Same as previous commit, now for module variables
1 parent faf49bc commit f1b3806

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = 'sphinxfortran_ng'
3-
version = '0.3.2'
3+
version = '0.3.3'
44
authors = [{name = "Lorenzo Crippa", email="[email protected]"}]
55
description = "An improved version of the sphinx-fortran python module"
66
readme = "README.md"

src/sphinxfortran_ng/fortran_autodoc.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,21 @@ def scan(self):
352352
self.strip_blocksrc(
353353
block, [
354354
'type', 'function', 'subroutine', 'interface'], src=modsrc)
355+
nameold = None
355356
if modsrc and 'vardescsearch' in block:
356357
for line in modsrc:
357-
if line.strip().startswith('!'):
358-
continue
358+
if not line.strip().startswith('!') or line.strip() == '!':
359+
nameold = None
360+
else:
361+
if nameold is not None:
362+
block['vars'][nameold]['desc'] +=line.lstrip()[1:]
363+
continue
364+
else:
365+
continue
359366
m = block['vardescsearch'](line)
360367
if m:
361-
block['vars'][m.group('varname').lower()]['desc'] = m.group(
368+
nameold = m.group('varname').lower()
369+
block['vars'][nameold]['desc'] = m.group(
362370
'vardesc')
363371
for bvar in list(block['vars'].values()):
364372
bvar.setdefault('desc', '')

0 commit comments

Comments
 (0)