Skip to content

Commit 6460674

Browse files
committed
now SVG badge is generated instead of HTML/Markdown
1 parent 60ecd2c commit 6460674

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

assets/generate_badge.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as np
22
import pandas as pd
3+
import aspose.words as aw
34

45

56
path = "filedownloads?parentAlias=ntnu"
@@ -21,5 +22,17 @@
2122

2223
print("generated html line: ", ret)
2324

24-
with open("test.md", "w") as f:
25-
f.write(ret)
25+
# with open("test.html", "w") as f:
26+
# f.write(ret)
27+
28+
# create blank document
29+
doc = aw.Document()
30+
31+
# Use a document builder to add content to the document
32+
builder = aw.DocumentBuilder(doc)
33+
34+
# Write a new paragraph in the document with the text generated above into the file
35+
builder.writeln(ret)
36+
37+
# Save the document in DOCX format. Save format is automatically determined from the file extension.
38+
doc.save("test.svg")

assets/test.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<a href="https://doi.org/10.18710/TLA01U"><img src="https://img.shields.io/badge/DataverseNO%20downloads-289-orange"></a>

0 commit comments

Comments
 (0)