Update pages/reader.py
Browse files- pages/reader.py +19 -18
pages/reader.py
CHANGED
|
@@ -149,6 +149,23 @@ selection = st.pills("Pilihan", opt_result, selection_mode="single", default="Ba
|
|
| 149 |
|
| 150 |
#tab1, tab2 = st.tabs(["π Baca Artikel", "π Analisis Artikel"])
|
| 151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
if selection == "Baca Artikel":
|
| 153 |
|
| 154 |
with st.sidebar:
|
|
@@ -162,30 +179,14 @@ if selection == "Baca Artikel":
|
|
| 162 |
|
| 163 |
pdf_buffer = create_pdf()
|
| 164 |
st.download_button(
|
| 165 |
-
label="π Download
|
| 166 |
data=pdf_buffer,
|
| 167 |
file_name="article.pdf",
|
| 168 |
mime="application/pdf"
|
| 169 |
)
|
| 170 |
|
| 171 |
if not filtered_df.empty:
|
| 172 |
-
|
| 173 |
-
row = filtered_df.iloc[0]
|
| 174 |
-
|
| 175 |
-
# Get and clean values
|
| 176 |
-
title = format_html(row.get("Title", ""))
|
| 177 |
-
author = format_html(row.get("Authors", ""))
|
| 178 |
-
intro = format_html(row.get("Introduction", ""))
|
| 179 |
-
method = format_html(row.get("Method", ""))
|
| 180 |
-
abstracten = format_html(row.get("Abstract (en)", ""))
|
| 181 |
-
abstractid = format_html(row.get("Abstract (id)", ""))
|
| 182 |
-
keywords = format_html(row.get("Keywords", ""))
|
| 183 |
-
affiliation = format_html(row.get("Institution", ""))
|
| 184 |
-
result = format_html(row.get("Result", ""))
|
| 185 |
-
discussion = format_html(row.get("Discussion", ""))
|
| 186 |
-
rnd = format_html(row.get("Result & Discussion", ""))
|
| 187 |
-
conclusion = format_html(row.get("Conclusion", ""))
|
| 188 |
-
|
| 189 |
# CSS styles for individual sections (no container)
|
| 190 |
html_output = f"""
|
| 191 |
<style>
|
|
|
|
| 149 |
|
| 150 |
#tab1, tab2 = st.tabs(["π Baca Artikel", "π Analisis Artikel"])
|
| 151 |
|
| 152 |
+
filtered_df = filtered_df.replace("NaN", "Tidak tersedia")
|
| 153 |
+
row = filtered_df.iloc[0]
|
| 154 |
+
|
| 155 |
+
# Get and clean values
|
| 156 |
+
title = format_html(row.get("Title", ""))
|
| 157 |
+
author = format_html(row.get("Authors", ""))
|
| 158 |
+
intro = format_html(row.get("Introduction", ""))
|
| 159 |
+
method = format_html(row.get("Method", ""))
|
| 160 |
+
abstracten = format_html(row.get("Abstract (en)", ""))
|
| 161 |
+
abstractid = format_html(row.get("Abstract (id)", ""))
|
| 162 |
+
keywords = format_html(row.get("Keywords", ""))
|
| 163 |
+
affiliation = format_html(row.get("Institution", ""))
|
| 164 |
+
result = format_html(row.get("Result", ""))
|
| 165 |
+
discussion = format_html(row.get("Discussion", ""))
|
| 166 |
+
rnd = format_html(row.get("Result & Discussion", ""))
|
| 167 |
+
conclusion = format_html(row.get("Conclusion", ""))
|
| 168 |
+
|
| 169 |
if selection == "Baca Artikel":
|
| 170 |
|
| 171 |
with st.sidebar:
|
|
|
|
| 179 |
|
| 180 |
pdf_buffer = create_pdf()
|
| 181 |
st.download_button(
|
| 182 |
+
label="π Download dalam PDF",
|
| 183 |
data=pdf_buffer,
|
| 184 |
file_name="article.pdf",
|
| 185 |
mime="application/pdf"
|
| 186 |
)
|
| 187 |
|
| 188 |
if not filtered_df.empty:
|
| 189 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
# CSS styles for individual sections (no container)
|
| 191 |
html_output = f"""
|
| 192 |
<style>
|