Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Macao Legacy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MACAO
Macao Legacy
Commits
73b9c55a
Commit
73b9c55a
authored
2 months ago
by
David Rouquet
Browse files
Options
Downloads
Patches
Plain Diff
fix infoboxes by putting html instead of md
parent
1d5bc166
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tetras_extraction/script/src/transform.py
+4
-2
4 additions, 2 deletions
tetras_extraction/script/src/transform.py
with
4 additions
and
2 deletions
tetras_extraction/script/src/transform.py
+
4
−
2
View file @
73b9c55a
...
@@ -2,6 +2,7 @@ from rdflib import OWL, RDF, Graph, Literal
...
@@ -2,6 +2,7 @@ from rdflib import OWL, RDF, Graph, Literal
from
lxml
import
html
from
lxml
import
html
#import pandoc
#import pandoc
from
markitdown
import
MarkItDown
from
markitdown
import
MarkItDown
from
markdown
import
markdown
import
tempfile
import
tempfile
import
re
import
re
from
glob
import
glob
from
glob
import
glob
...
@@ -48,6 +49,7 @@ def markFileDown(filepath):
...
@@ -48,6 +49,7 @@ def markFileDown(filepath):
def
prepareHTMLforMD
(
str
):
def
prepareHTMLforMD
(
str
):
str
=
str
.
replace
(
"
\r
"
,
"
"
)
# Identify audio content and add markups to identify them in the MD
# Identify audio content and add markups to identify them in the MD
regexAV
=
re
.
compile
(
r
"
.*?PF_clipAV\(
'
.*?
'
,
'
(.*?).swf
'
,.*
"
)
regexAV
=
re
.
compile
(
r
"
.*?PF_clipAV\(
'
.*?
'
,
'
(.*?).swf
'
,.*
"
)
str
=
regexAV
.
sub
(
r
"
@AUDIOSTART\1@AUDIOEND
"
,
str
)
str
=
regexAV
.
sub
(
r
"
@AUDIOSTART\1@AUDIOEND
"
,
str
)
...
@@ -106,8 +108,8 @@ def postEditMD(str1):
...
@@ -106,8 +108,8 @@ def postEditMD(str1):
try
:
try
:
file
=
open
(
filepath
,
'
r
'
,
encoding
=
'
utf-8
'
)
file
=
open
(
filepath
,
'
r
'
,
encoding
=
'
utf-8
'
)
file
.
close
()
file
.
close
()
md
=
markFileDown
(
filepath
)
simpleHtml
=
markdown
(
markFileDown
(
filepath
)
)
commentaireInfo_md
=
'
<div class=
"
commentaireInfo
"
commentaireId=
"'
+
str
(
i
)
+
'"
>
'
+
md
+
'
</div>
'
commentaireInfo_md
=
'
<div class=
"
commentaireInfo
"
commentaireId=
"'
+
str
(
i
)
+
'"
>
'
+
simpleHtml
+
'
</div>
'
str1
=
str1
.
replace
(
match
,
str
(
i
))
str1
=
str1
.
replace
(
match
,
str
(
i
))
except
FileNotFoundError
:
except
FileNotFoundError
:
pass
pass
...
...
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