Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
53
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Wiki
Commits
afb47983
Commit
afb47983
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
write in tmp file instead
parent
becb59c2
No related branches found
No related tags found
3 merge requests
!229
Draft: Modify all articles with article struct
,
!228
Uniq molstar plugin per page
,
!226
Resolve "Design of the structure section in a system's page"
Pipeline
#127264
canceled with stages
in 3 minutes and 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/df-wiki-cli/df_wiki_cli/content/main.py
+11
-14
11 additions, 14 deletions
packages/df-wiki-cli/df_wiki_cli/content/main.py
with
11 additions
and
14 deletions
packages/df-wiki-cli/df_wiki_cli/content/main.py
+
11
−
14
View file @
afb47983
...
...
@@ -4,6 +4,7 @@ import json
import
pandas
as
pd
import
shutil
import
csv
import
tempfile
import
matplotlib.pyplot
as
plt
from
pandas.errors
import
ParserError
from
typing_extensions
import
Annotated
...
...
@@ -426,30 +427,26 @@ def markdown(
help
=
"
Dir where all systems article are
"
,
),
],
# output: Annotated[
# Path,
# typer.Option(
# file_okay=True,
# dir_okay=False,
# writable=True,
# resolve_path=True,
# ),
# ],
):
for
file
in
dir
.
iterdir
():
if
file
.
suffix
==
"
.md
"
:
console
.
rule
(
f
"
[bold blue]
{
file
.
name
}
"
,
style
=
"
blue
"
)
with
open
(
file
,
"
r+
"
)
as
f
:
# make a copy of file
_
,
tmp_path
=
tempfile
.
mkstemp
()
# with open(dst, "w") as tmp_f:
dst
=
Path
(
tmp_path
)
dst
.
write_bytes
(
file
.
read_bytes
())
with
open
(
dst
,
"
r+
"
)
as
f
:
new_f
=
re
.
sub
(
r
"
##\s+Structure\n.
+
##\s+Experimental\s+validation
"
,
r
"
##\s+Structure\n.
*
##\s+Experimental\s+validation
"
,
"
## Structure
\n\n
::article-structure
\n
::
\n\n
## Experimental validation
"
,
f
.
read
(),
flags
=
re
.
DOTALL
,
)
f
.
seek
(
0
,
0
)
f
.
write
(
new_f
)
with
open
(
file
,
"
w
"
)
as
f_out
:
f_out
.
write
(
new_f
)
def
remove_version
(
assembly
):
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment