Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Bielefeld-CeBiTec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
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
2024 Competition
Bielefeld-CeBiTec
Commits
7cf3f06b
Commit
7cf3f06b
authored
6 months ago
by
Liliana Sanfilippo
Browse files
Options
Downloads
Patches
Plain Diff
cit
parent
61382afc
No related branches found
No related tags found
No related merge requests found
Pipeline
#445541
failed
6 months ago
Stage: build
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
code/cit.py
+24
-19
24 additions, 19 deletions
code/cit.py
code/output.txt
+140
-139
140 additions, 139 deletions
code/output.txt
src/contents/safety.tsx
+142
-143
142 additions, 143 deletions
src/contents/safety.tsx
with
306 additions
and
301 deletions
code/cit.py
+
24
−
19
View file @
7cf3f06b
...
...
@@ -96,20 +96,11 @@ def main():
else
:
print
(
"
DONE
"
)
def
articleHTML
(
dictio
,
x
,
out
):
print
(
"
Writing html code for article
"
+
str
(
x
)
+
"
...
"
)
out
.
write
(
"
{/*<!-- Citation num
"
+
str
(
x
)
+
"
--> */}
"
+
"
\n
"
)
out
.
write
(
"
<li typeof=
\"
schema:ScolarlyArticle
\"
role=
\"
doc-biblioentry
\"
property=
\"
schema:citation
\"
id=
\"
desc-
"
+
str
(
x
)
+
"
\"
>
"
+
"
\n
"
)
out
.
write
(
"
\t
"
+
"
<span property=
\"
schema:author
\"
typeof=
\"
schema:Person
\"
>
"
+
"
\n
"
)
print
(
"
Just a sec, separating authors...
"
)
authors
=
dictio
[
'
author
'
]
def
makeauthors
(
authors
,
out
):
authors
=
authors
.
replace
(
"
and
"
,
"
|
"
)
list
e
=
authors
.
split
(
"
|
"
)
for
i
,
a
in
enumerate
(
list
e
):
aut
list
=
authors
.
split
(
"
|
"
)
for
i
,
a
in
enumerate
(
aut
list
):
try
:
first
=
None
last
=
None
...
...
@@ -140,13 +131,24 @@ def articleHTML(dictio, x, out):
name
=
last
+
"
,
"
+
first
# Wenn es der letzte Autor ist, kein Semikolon am Ende
if
i
==
len
(
list
e
)
-
1
:
if
i
==
len
(
aut
list
)
-
1
:
out
.
write
(
"
\t
"
+
"
\t
"
+
"
<span property=
\"
schema:Name
\"
>
"
+
name
+
"
</span>
"
+
"
\n
"
)
else
:
out
.
write
(
"
\t
"
+
"
\t
"
+
"
<span property=
\"
schema:Name
\"
>
"
+
name
+
"
</span>
;
"
+
"
\n
"
)
out
.
write
(
"
\t
"
+
"
\t
"
+
"
<span property=
\"
schema:Name
\"
>
"
+
name
+
"
</span>
,
"
+
"
\n
"
)
except
Exception
as
e
:
print
(
f
"
An unexpected error occurred:
{
e
}
see
"
+
a
)
def
articleHTML
(
dictio
,
x
,
out
):
print
(
"
Writing html code for article
"
+
str
(
x
)
+
"
...
"
)
out
.
write
(
"
{/*<!-- Citation num
"
+
str
(
x
)
+
"
--> */}
"
+
"
\n
"
)
out
.
write
(
"
<li typeof=
\"
schema:ScolarlyArticle
\"
role=
\"
doc-biblioentry
\"
property=
\"
schema:citation
\"
id=
\"
desc-
"
+
str
(
x
)
+
"
\"
>
"
+
"
\n
"
)
out
.
write
(
"
\t
"
+
"
<span property=
\"
schema:author
\"
typeof=
\"
schema:Person
\"
>
"
+
"
\n
"
)
print
(
"
Just a sec, separating authors...
"
)
authors
=
dictio
[
'
author
'
]
makeauthors
(
authors
,
out
)
out
.
write
(
"
\t
"
+
"
</span>
"
+
"
\n
"
)
title
=
dictio
[
'
title
'
].
replace
(
'
{
'
,
''
).
replace
(
'
}
'
,
''
)
...
...
@@ -179,7 +181,7 @@ def articleHTML(dictio, x, out):
year
=
dictio
[
'
year
'
]
out
.
write
(
"
\t
"
+
"
(<time property=
\"
schema:datePublished
\"
datatype=
\"
xsd:gYear
\"
dateTime=
\"
"
+
year
+
"
\"
>
"
+
year
+
"
</time>).
"
+
"
\n
"
)
out
.
write
(
"
\t
"
+
"
(<time property=
\"
schema:datePublished
\"
datatype=
\"
xsd:gYear
\"
dateTime=
\"
"
+
year
+
"
\"
>
"
+
year
+
"
</time>).
"
+
"
\n
"
)
try
:
doi
=
dictio
[
'
doi
'
]
...
...
@@ -208,10 +210,12 @@ def miscHTML(dictio, x, out):
def
bookHTML
(
dictio
,
x
,
out
):
print
(
"
Writing html code for entry
"
+
str
(
x
)
+
"
...
"
)
out
.
write
(
"
{/*<!-- Citation num
"
+
str
(
x
)
+
"
--> */}
"
+
"
\n
"
)
out
.
write
(
"
<li typeof=
\"
schema:
WebPage
\"
role=
\"
doc-biblioentry
\"
property=
\"
schema:citation
\"
id=
\"
desc-
"
+
str
(
x
)
+
"
\"
>
"
+
"
\n
"
)
out
.
write
(
"
<li typeof=
\"
schema:
Book
\"
role=
\"
doc-biblioentry
\"
property=
\"
schema:citation
\"
id=
\"
desc-
"
+
str
(
x
)
+
"
\"
>
"
+
"
\n
"
)
out
.
write
(
"
\t
"
+
"
<span property=
\"
schema:author
\"
typeof=
\"
schema:Organisation
\"
>
"
+
"
\n
"
)
aut
=
dictio
[
'
author
'
]
out
.
write
(
"
\t
"
+
"
\t
"
+
"
<span property=
\"
schema:Name
\"
>
"
+
aut
+
"
</span>.
"
+
"
\n
"
)
print
(
"
Just a sec, separating authors...
"
)
authors
=
dictio
[
'
author
'
]
makeauthors
(
authors
,
out
)
# out.write("\t" + "\t" +"<span property=\"schema:Name\"> " + aut + "</span>."+ "\n")
out
.
write
(
"
\t
"
+
"
</span>
"
+
"
\n
"
)
if
'
title
'
in
dictio
:
out
.
write
(
"
\t
"
+
"
<span property=
\"
schema:name
\"
>
"
+
dictio
[
'
title
'
]
+
"
.</span>
"
+
"
\n
"
)
...
...
@@ -227,4 +231,5 @@ def bookHTML(dictio, x, out):
out
.
write
(
"
</li>
"
+
"
\n
"
+
"
\n
"
)
main
()
\ No newline at end of file
main
()
This diff is collapsed.
Click to expand it.
code/output.txt
+
140
−
139
View file @
7cf3f06b
This diff is collapsed.
Click to expand it.
src/contents/safety.tsx
+
142
−
143
View file @
7cf3f06b
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