annikwag commited on
Commit
ff11e76
·
verified ·
1 Parent(s): 53d69f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -22
app.py CHANGED
@@ -122,17 +122,7 @@ if button:
122
  project_name = res.payload['metadata'].get('project_name', 'Project Link')
123
  url = res.payload['metadata'].get('url', '#')
124
  st.markdown(f"#### [{project_name}]({url})")
125
- # Show only the first 4 lines of text by default
126
- page_content = res.payload['page_content']
127
- lines = page_content.split('\n') # Split into lines
128
- first_4_lines = '\n'.join(lines[:4]) # Get the first 4 lines
129
-
130
- # Use expander for the rest of the content
131
- st.write(first_4_lines) # Display the first 4 lines
132
- if len(lines) > 4:
133
- with st.expander("Read more"):
134
- st.write('\n'.join(lines[4:])) # Display the remaining content
135
-
136
  # Additional text below the content
137
  metadata = res.payload.get('metadata', {})
138
  countries = metadata.get('countries', "[]")
@@ -167,17 +157,7 @@ if button:
167
  project_name = res.payload['metadata'].get('project_name', 'Project Link')
168
  url = res.payload['metadata'].get('url', '#')
169
  st.markdown(f"#### [{project_name}]({url})")
170
- # Show only the first 4 lines of text by default
171
- page_content = res.payload['page_content']
172
- lines = page_content.split('\n') # Split into lines
173
- first_4_lines = '\n'.join(lines[:4]) # Get the first 4 lines
174
-
175
- # Use expander for the rest of the content
176
- st.write(first_4_lines) # Display the first 4 lines
177
- if len(lines) > 4:
178
- with st.expander("Read more"):
179
- st.write('\n'.join(lines[4:])) # Display the remaining content
180
-
181
  # Additional text below the content
182
  metadata = res.payload.get('metadata', {})
183
  countries = metadata.get('countries', "[]")
 
122
  project_name = res.payload['metadata'].get('project_name', 'Project Link')
123
  url = res.payload['metadata'].get('url', '#')
124
  st.markdown(f"#### [{project_name}]({url})")
125
+ st.write(res.payload['page_content'])
 
 
 
 
 
 
 
 
 
 
126
  # Additional text below the content
127
  metadata = res.payload.get('metadata', {})
128
  countries = metadata.get('countries', "[]")
 
157
  project_name = res.payload['metadata'].get('project_name', 'Project Link')
158
  url = res.payload['metadata'].get('url', '#')
159
  st.markdown(f"#### [{project_name}]({url})")
160
+ st.write(res.payload['page_content'])
 
 
 
 
 
 
 
 
 
 
161
  # Additional text below the content
162
  metadata = res.payload.get('metadata', {})
163
  countries = metadata.get('countries', "[]")