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
f5492008
Commit
f5492008
authored
5 years ago
by
Dennis Gläser
Browse files
Options
Downloads
Patches
Plain Diff
[docgen][code_to_md] rename taggedContent()
parent
4a8b6ceb
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/convert_code_to_doc.py
+3
-3
3 additions, 3 deletions
examples/convert_code_to_doc.py
with
3 additions
and
3 deletions
examples/convert_code_to_doc.py
+
3
−
3
View file @
f5492008
...
@@ -10,7 +10,7 @@ from pyparsing import *
...
@@ -10,7 +10,7 @@ from pyparsing import *
# tell pyparsing to never ignore white space characters
# tell pyparsing to never ignore white space characters
ParserElement
.
setDefaultWhitespaceChars
(
''
)
ParserElement
.
setDefaultWhitespaceChars
(
''
)
def
t
aggedContent
(
keyname
,
action
,
open
=
"
[[
"
,
close
=
"
]]
"
,
endTag
=
"
/
"
):
def
parseT
aggedContent
(
keyname
,
action
,
open
=
"
[[
"
,
close
=
"
]]
"
,
endTag
=
"
/
"
):
"""
"""
Match content between [[keyname]] and [[/keyname]] and apply the action on it
Match content between [[keyname]] and [[/keyname]] and apply the action on it
"""
"""
...
@@ -39,11 +39,11 @@ def cppRules():
...
@@ -39,11 +39,11 @@ def cppRules():
endHeaderGuard
=
Suppress
(
Literal
(
"
#endif
"
)
+
Optional
(
restOfLine
))
endHeaderGuard
=
Suppress
(
Literal
(
"
#endif
"
)
+
Optional
(
restOfLine
))
# exclude stuff between [[exclude]] and [[/exclude]]
# exclude stuff between [[exclude]] and [[/exclude]]
exclude
=
t
aggedContent
(
"
exclude
"
,
action
=
replaceWith
(
""
))
exclude
=
parseT
aggedContent
(
"
exclude
"
,
action
=
replaceWith
(
""
))
# make a code block (possibly containing comments) between [[codeblock]] and [[/codeblock]]
# make a code block (possibly containing comments) between [[codeblock]] and [[/codeblock]]
action
=
createMarkdownCode
(
"
cpp
"
)
action
=
createMarkdownCode
(
"
cpp
"
)
codeblock
=
t
aggedContent
(
"
codeblock
"
,
action
=
action
)
codeblock
=
parseT
aggedContent
(
"
codeblock
"
,
action
=
action
)
# treat doc and code line
# treat doc and code line
doc
=
LineStart
()
+
Suppress
(
ZeroOrMore
(
"
"
)
+
Literal
(
"
//
"
)
+
ZeroOrMore
(
"
"
))
+
Optional
(
restOfLine
)
doc
=
LineStart
()
+
Suppress
(
ZeroOrMore
(
"
"
)
+
Literal
(
"
//
"
)
+
ZeroOrMore
(
"
"
))
+
Optional
(
restOfLine
)
...
...
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