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
05df5d55
Commit
05df5d55
authored
3 weeks ago
by
Timo Koch
Committed by
Leon Keim
3 weeks ago
Browse files
Options
Downloads
Patches
Plain Diff
[doxygen] Adds and edit button to markdown file on GitLab
parent
491621b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3994
[doxygen] Adds an edit button to markdown file on GitLab
Pipeline
#56146
passed
3 weeks ago
Stage: check-status
Stage: trigger dumux pipelines
+3
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/doxygen/dumux-custom.css
+15
-0
15 additions, 0 deletions
doc/doxygen/dumux-custom.css
doc/doxygen/markdown-filter.py
+25
-0
25 additions, 0 deletions
doc/doxygen/markdown-filter.py
with
40 additions
and
0 deletions
doc/doxygen/dumux-custom.css
+
15
−
0
View file @
05df5d55
...
@@ -24,6 +24,21 @@
...
@@ -24,6 +24,21 @@
height
:
60px
;
height
:
60px
;
margin-bottom
:
-4px
margin-bottom
:
-4px
}
}
.edit-button
{
display
:
inline-block
;
padding
:
5px
10px
5px
10px
;
background
:
#ffaa16
;
border-radius
:
10px
;
color
:
black
;
vertical-align
:
middle
;
}
.edit-button
:hover
{
background
:
#ffcc1d
;
}
a
.edit-button
{
text-decoration
:
none
!important
;
color
:
black
!important
;
}
.cls-r-1
{
.cls-r-1
{
fill
:
#dd1f26
fill
:
#dd1f26
}
}
...
...
This diff is collapsed.
Click to expand it.
doc/doxygen/markdown-filter.py
+
25
−
0
View file @
05df5d55
...
@@ -16,6 +16,19 @@ MAIN_README = abspath(join(TOP_LEVEL_DIR, "README.md"))
...
@@ -16,6 +16,19 @@ MAIN_README = abspath(join(TOP_LEVEL_DIR, "README.md"))
assert
exists
(
MAIN_README
)
assert
exists
(
MAIN_README
)
def
_get_file_gitlab_url
(
path
:
str
)
->
str
:
return
(
"
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/
"
"
-/blob/master/
"
f
"
{
path
}
"
"
?ref_type=heads
"
)
def
_file_path_relative_to_top_level
(
path
:
str
)
->
str
:
return
path
.
replace
(
TOP_LEVEL_DIR
,
""
).
lstrip
(
"
/
"
)
def
_filter_characters
(
text
:
str
)
->
str
:
def
_filter_characters
(
text
:
str
)
->
str
:
return
""
.
join
(
filter
(
lambda
c
:
c
not
in
string
.
punctuation
and
c
not
in
string
.
digits
,
text
))
return
""
.
join
(
filter
(
lambda
c
:
c
not
in
string
.
punctuation
and
c
not
in
string
.
digits
,
text
))
...
@@ -69,5 +82,17 @@ for line in result.split("\n"):
...
@@ -69,5 +82,17 @@ for line in result.split("\n"):
line
if
verbatim_environment
else
_enable_doxygen_only_content
(
_add_header_label
(
line
))
line
if
verbatim_environment
else
_enable_doxygen_only_content
(
_add_header_label
(
line
))
)
)
# Tell readers that they can edit the markdown content on GitLab
markdown_file_path
=
_file_path_relative_to_top_level
(
filePath
)
file_url
=
_get_file_gitlab_url
(
markdown_file_path
)
result_lines
.
extend
(
[
"
\n
----
\n
"
,
f
'
<a class=
"
edit-button
"
href=
"
{
file_url
}
"
>
'
"
🛠 Edit above doc on GitLab
"
"
</a>
\n
"
,
]
)
# Print the final result for Doxygen to pick it up
# Print the final result for Doxygen to pick it up
print
(
"
\n
"
.
join
(
result_lines
))
print
(
"
\n
"
.
join
(
result_lines
))
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