Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alvarez, Gonzalo
PsimagLite
Commits
6309d541
Commit
6309d541
authored
Oct 03, 2020
by
Alvarez, Gonzalo
Browse files
doc.pl for code sections
parent
d204be72
Changes
3
Hide whitespace changes
Inline
Side-by-side
doc/tutorial.ptex
View file @
6309d541
...
...
@@ -117,7 +117,9 @@ again the example should be able to compile without it; it won't run
though, but display a message saying that the GSL is needed.
\ptexPaste
{
InputNg
_
Intro
}
\begin{lstlisting}
\ptexPaste
{
InputNg
_
Includes
}
\end{lstlisting}
\end{document}
drivers/testInputNg.cpp
View file @
6309d541
...
...
@@ -29,10 +29,10 @@ PsimagLite files are usually under src, but in some
cases subdirectories are used. Here are the includes.
*/
/* PSIDOC_CODE_START InputNg_Includes */
/* PSIDOC_CODE_START InputNg_Includes
nocapture
*/
#include
"InputNg.h"
#include
"InputCheckBase.h"
/* PSI
CODE
_CODE_END */
/* PSI
DOC
_CODE_END */
class
MyInputCheck
:
public
PsimagLite
::
InputCheckBase
{
...
...
scripts/doc.pl
View file @
6309d541
...
...
@@ -111,6 +111,7 @@ sub loadLabels
my
$nlines
=
scalar
(
@$lines
);
my
$inCodeBlock
=
0
;
my
$codeBuffer
=
"";
my
$capture
=
1
;
for
(
my
$i
=
0
;
$i
<
$nlines
;
++
$i
)
{
$_
=
$lines
->
[
$i
];
...
...
@@ -118,6 +119,8 @@ sub loadLabels
my
$rest
=
$
1
;
chomp
(
$rest
);
(
$label
,
$additional
)
=
procPsidocName
(
$rest
);
$capture
=
1
;
my
$txt
=
$labels
{"
$label
"};
if
(
defined
(
$txt
))
{
die
"
$0: ERROR: Label
$label
is duplicate
\n
";
...
...
@@ -136,7 +139,8 @@ sub loadLabels
(
$label
,
$additional
)
=
procPsidocName
(
$rest
);
$label
=~
s/ //g
;
print
STDERR
"
ADDING *
$label
*
\n
";
$capture
=
(
$additional
eq
"
nocapture
")
?
0
:
1
;
my
$txt
=
$labels
{"
$label
"};
if
(
defined
(
$txt
))
{
die
"
$0: ERROR: Label
$label
is duplicate
\n
";
...
...
@@ -151,14 +155,14 @@ sub loadLabels
die
"
$0: Closing code block while none is open
\n
";
}
$labels
{"
$label
"}
=
$codeBuffer
;
$labels
{"
$label
"}
=
[
$codeBuffer
]
;
$codeBuffer
=
"";
$inCodeBlock
=
0
;
next
;
}
if
(
/\*\//
)
{
if
(
$label
ne
"
!DISABLED
")
{
if
(
$label
ne
"
!DISABLED
"
and
$capture
)
{
my
$inlabel
=
$label
.
"
::
";
$buffer
=~
s/PSIDOCCOPY \$/PSIDOCCOPY ${inlabel}/g
;
my
@temp
=
(
$buffer
);
...
...
@@ -184,6 +188,7 @@ sub loadLabels
$buffer
=
"";
$label
=
"
!DISABLED
";
$capture
=
1
;
$additional
=
"";
}
elsif
(
$inCodeBlock
)
{
$codeBuffer
.=
$_
.
"
\n
";
...
...
@@ -195,6 +200,10 @@ sub loadLabels
}
}
if
(
$inCodeBlock
)
{
die
"
$0: Code block was not closed for label
$label
\n
";
}
my
$n
=
scalar
(
%labels
);
print
STDERR
"
$0:
$n
labels found
\n
";
...
...
@@ -261,7 +270,7 @@ sub captureFirstFunctionBelow
last
if
(
$line
=~
/\/\*/
);
next
if
(
$line
=~
/^ *\/\//
);
$buffer
.=
"
$line
\n
";
$markContent
.=
"
$line
\n
"
if
(
$markName
ne
"");
my
$plus
=
()
=
$line
=~
/\{/g
;
my
$minus
=
()
=
$line
=~
/\}/g
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment