Update pages/reader.py
Browse files- pages/reader.py +12 -8
pages/reader.py
CHANGED
|
@@ -35,11 +35,16 @@ st.write(paramx)
|
|
| 35 |
filtered_df = df[df['ID'] == paramx]
|
| 36 |
|
| 37 |
with st.sidebar:
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
if not filtered_df.empty:
|
| 42 |
-
filtered_df = filtered_df.
|
| 43 |
row = filtered_df.iloc[0]
|
| 44 |
|
| 45 |
# Get and clean values
|
|
@@ -55,8 +60,7 @@ if not filtered_df.empty:
|
|
| 55 |
discussion = format_html(row.get("Discussion", ""))
|
| 56 |
rnd = format_html(row.get("Result & Discussion", ""))
|
| 57 |
conclusion = format_html(row.get("Conclusion", ""))
|
| 58 |
-
|
| 59 |
-
|
| 60 |
# CSS styles for individual sections (no container)
|
| 61 |
html_output = f"""
|
| 62 |
<style>
|
|
@@ -64,7 +68,7 @@ if not filtered_df.empty:
|
|
| 64 |
text-align: center;
|
| 65 |
font-size: 28px;
|
| 66 |
font-weight: bold;
|
| 67 |
-
font-family:
|
| 68 |
color: #222;
|
| 69 |
margin-bottom: 5px;
|
| 70 |
}}
|
|
@@ -86,7 +90,7 @@ if not filtered_df.empty:
|
|
| 86 |
.section-meta {{
|
| 87 |
text-align: center;
|
| 88 |
font-size: {fontsize}px;
|
| 89 |
-
font-family:
|
| 90 |
line-height: 1.8;
|
| 91 |
color: #333;
|
| 92 |
font-style: italic;
|
|
@@ -96,7 +100,7 @@ if not filtered_df.empty:
|
|
| 96 |
column-gap: 40px;
|
| 97 |
text-align: justify;
|
| 98 |
font-size: {fontsize}px;
|
| 99 |
-
font-family:
|
| 100 |
line-height: 1.8;
|
| 101 |
color: #333;
|
| 102 |
}}
|
|
|
|
| 35 |
filtered_df = df[df['ID'] == paramx]
|
| 36 |
|
| 37 |
with st.sidebar:
|
| 38 |
+
st.write("Atur Tampilan")
|
| 39 |
+
|
| 40 |
+
font_options = ["Baskerville", "Cambria", "Charter", "Garamond", "Georgia", "Palatino Linotype", "Times New Roman"]
|
| 41 |
+
font_selected = st.selectbox("Gaya kata", font_options)
|
| 42 |
+
|
| 43 |
+
fontsize = st.number_input("Ukuran kata", min_value=5, value=16, step=1)
|
| 44 |
+
no_columns = st.number_input("Jumlah kolom", min_value=1, max_value=4, value=1, step=1)
|
| 45 |
|
| 46 |
if not filtered_df.empty:
|
| 47 |
+
filtered_df = filtered_df.replace("NaN", "Tidak tersedia")
|
| 48 |
row = filtered_df.iloc[0]
|
| 49 |
|
| 50 |
# Get and clean values
|
|
|
|
| 60 |
discussion = format_html(row.get("Discussion", ""))
|
| 61 |
rnd = format_html(row.get("Result & Discussion", ""))
|
| 62 |
conclusion = format_html(row.get("Conclusion", ""))
|
| 63 |
+
|
|
|
|
| 64 |
# CSS styles for individual sections (no container)
|
| 65 |
html_output = f"""
|
| 66 |
<style>
|
|
|
|
| 68 |
text-align: center;
|
| 69 |
font-size: 28px;
|
| 70 |
font-weight: bold;
|
| 71 |
+
font-family: {font_selected}, serif;
|
| 72 |
color: #222;
|
| 73 |
margin-bottom: 5px;
|
| 74 |
}}
|
|
|
|
| 90 |
.section-meta {{
|
| 91 |
text-align: center;
|
| 92 |
font-size: {fontsize}px;
|
| 93 |
+
font-family: {font_selected}, serif;
|
| 94 |
line-height: 1.8;
|
| 95 |
color: #333;
|
| 96 |
font-style: italic;
|
|
|
|
| 100 |
column-gap: 40px;
|
| 101 |
text-align: justify;
|
| 102 |
font-size: {fontsize}px;
|
| 103 |
+
font-family: {font_selected}, serif;
|
| 104 |
line-height: 1.8;
|
| 105 |
color: #333;
|
| 106 |
}}
|