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
c011e9a8
Commit
c011e9a8
authored
5 years ago
by
Bernd Flemisch
Browse files
Options
Downloads
Patches
Plain Diff
[doc] add script for converting commented c++ files to markdown with code blocks
parent
d9efb9d8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1683
Automatically create READMEs for examples
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/doc/cpp_to_md.sh
+32
-0
32 additions, 0 deletions
bin/doc/cpp_to_md.sh
with
32 additions
and
0 deletions
bin/doc/cpp_to_md.sh
0 → 100644
+
32
−
0
View file @
c011e9a8
#!/bin/sh
if
[[
${
1
:
-3
}
==
".hh"
]]
;
then
sed
'1,/define/d'
$1
>
tmpfile
else
sed
'1,/\*\*\*\*\*/d'
$1
>
tmpfile
fi
insidecodeblock
=
false
while
IFS
=
read
-r
line
do
strippedline
=
$(
echo
$line
|
sed
"s/^[
\t
]*//"
)
if
[[
${
strippedline
:0:2
}
==
"//"
]]
;
then
if
[[
$insidecodeblock
==
true
]]
;
then
echo
"
\`\`\`
"
insidecodeblock
=
false
fi
echo
"
${
strippedline
:2
}
"
else
if
[[
$insidecodeblock
==
false
]]
;
then
echo
"
\`\`\`
cpp"
insidecodeblock
=
true
fi
echo
"
$line
"
fi
done
< tmpfile
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