Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
2a696d58
Commit
2a696d58
authored
5 years ago
by
Dennis Gläser
Browse files
Options
Downloads
Patches
Plain Diff
[bin][doc] remove obsolete cpp_to_md.sh
parent
773dd358
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1914
[examples] Implement Python-only doc generator using pyparsing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/doc/cpp_to_md.sh
+0
-86
0 additions, 86 deletions
bin/doc/cpp_to_md.sh
with
0 additions
and
86 deletions
bin/doc/cpp_to_md.sh
deleted
100644 → 0
+
0
−
86
View file @
773dd358
#!/bin/sh
# check if help is needed
if
test
"
$1
"
=
"--help"
||
test
"
$1
"
=
"-help"
\
||
test
"
$1
"
=
"help"
||
test
"
$1
"
=
""
;
then
echo
""
echo
"USAGE:
$0
FILENAME"
echo
""
echo
"The argument should be a C++ header or source file."
echo
"The file is converted to Markdown and forwarded to stdout."
echo
"In particular, a C++ comment is converted to its content,"
echo
"while normal code is put into corresponding Markdown code blocks."
echo
"Supposed to be called by the script merge_cpp_and_md.sh."
exit
0
fi
if
[[
${
1
:
-3
}
==
".hh"
]]
;
then
sed
'1,/#define/d'
$1
>
tmpfile
isheader
=
true
else
sed
'1,/\*\*\*\*\*\//d'
$1
>
tmpfile
isheader
=
false
fi
insidecodeblock
=
false
lastline
=
""
strippedlastline
=
""
firstline
=
true
while
IFS
=
read
-r
line
do
strippedline
=
$(
echo
$line
|
sed
"s/^[
\t
]*//"
)
if
[[
$firstline
==
false
]]
;
then
if
[[
${
strippedline
:0:2
}
==
"//"
]]
;
then
if
[[
$insidecodeblock
==
true
]]
;
then
if
[[
$lastline
!=
""
]]
;
then
echo
"
$lastline
"
fi
echo
"
\`\`\`
"
insidecodeblock
=
false
else
linetoprint
=
$(
echo
${
strippedlastline
:2
}
|
sed
"s/^[
\t
]*//"
)
echo
"
$linetoprint
"
fi
else
if
[[
$insidecodeblock
==
false
]]
;
then
linetoprint
=
$(
echo
${
strippedlastline
:2
}
|
sed
"s/^[
\t
]*//"
)
echo
"
$linetoprint
"
echo
"
\`\`\`
cpp"
insidecodeblock
=
true
else
echo
"
$lastline
"
fi
fi
else
if
[[
${
strippedline
:0:2
}
!=
"//"
&&
$line
!=
""
]]
;
then
echo
"
\`\`\`
cpp"
insidecodeblock
=
true
fi
firstline
=
false
fi
lastline
=
"
$line
"
strippedlastline
=
"
$strippedline
"
done
< tmpfile
if
[[
$isheader
==
false
]]
;
then
if
[[
${
strippedlastline
:0:2
}
==
"//"
]]
;
then
if
[[
$insidecodeblock
==
true
]]
;
then
echo
"
\`\`\`
"
insidecodeblock
=
false
fi
linetoprint
=
$(
echo
${
strippedlastline
:2
}
|
sed
"s/^[
\t
]*//"
)
echo
"
$linetoprint
"
else
if
[[
$insidecodeblock
==
false
]]
;
then
echo
"
\`\`\`
cpp"
insidecodeblock
=
true
fi
echo
"
$lastline
"
fi
fi
if
[[
$insidecodeblock
==
true
]]
;
then
echo
"
\`\`\`
"
insidecodeblock
=
false
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment