mabuseif commited on
Commit
446b48e
·
verified ·
1 Parent(s): 236a59c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -16
app.py CHANGED
@@ -111,7 +111,6 @@ def check_for_fragment(url):
111
  return '#:~:text=' in url
112
 
113
  def parse_citation_text(citation_text):
114
- # Match both "Author (Year)" and "(Author, Year)"
115
  match = re.match(r'^(?:(\w[\w\s.,&et al]+)\s*\((\d{4})\)|\((\w[\w\s.,&et al]+),\s*(\d{4})\))$', citation_text.strip())
116
  if match:
117
  author = match.group(1) or match.group(3)
@@ -211,10 +210,8 @@ with st.expander("About SCC and Example Citation"):
211
 
212
  <h4>Technical Legitimacy</h4>
213
  <p>The SCC style leverages the <a href="https://wicg.github.io/scroll-to-text-fragment/" target="_blank">W3C Text Fragments specification</a>, enabling precise linking to specific text within web pages. This ensures citations are contextually accurate and verifiable, aligning with modern web standards.</p>
214
- </div>
215
-
216
- <div class="info-card">
217
- <h3>Example Citation</h3>
218
  <p><strong>Inputs:</strong></p>
219
  <ul>
220
  <li><strong>Username:</strong> jdoe</li>
@@ -226,14 +223,14 @@ with st.expander("About SCC and Example Citation"):
226
  </ul>
227
  <p><strong>Outputs:</strong></p>
228
  <ul>
229
- <li><strong>Citation (Start of Text):</strong> <span style="font-size: 1.2rem;">Abuseif et al. (2025)</span> (hyperlinked to the source URL with text fragment)</li>
230
- <li><strong>Citation (End of Text):</strong> <span style="font-size: 1.2rem;">(Abuseif et al., 2025)</span> (hyperlinked to the source URL with text fragment)</li>
231
- <li><strong>SCC Index:</strong> <span style="font-size: 0.85rem;">Abuseif et al. (2025). &lt;64-character SHA-256 hash&gt;</span> (hyperlinked to the source URL with metadata)</li>
232
  </ul>
233
  </div>
234
  """, unsafe_allow_html=True)
235
 
236
- # Expandable section for SCC Guidelines
237
  with st.expander("SCC Style Guidelines"):
238
  st.markdown("""
239
  <div class="info-card">
@@ -260,9 +257,9 @@ with st.expander("SCC Style Guidelines"):
260
  <li><strong>Generate Citation:</strong> Click the "Generate Citation" button.</li>
261
  <li><strong>Copy Outputs:</strong>
262
  <ul>
263
- <li><strong>Citation (Start of Text):</strong> Use "Author (Year)" for the start of a sentence.</li>
264
- <li><strong>Citation (End of Text):</strong> Use "(Author, Year)" for in-text citations.</li>
265
- <li><strong>SCC Index:</strong> Copy the hash link (e.g., "Abuseif et al. (2025). &lt;hash&gt;") for verification.</li>
266
  <li>Right-click each link to copy the "Link Address" for verification.</li>
267
  </ul>
268
  </li>
@@ -273,14 +270,14 @@ with st.expander("SCC Style Guidelines"):
273
  <li><strong>Access the Tool:</strong> Open the "Verify Citation" tab.</li>
274
  <li><strong>Enter Citation Information:</strong>
275
  <ul>
276
- <li><strong>Citation Text:</strong> Paste the citation text (e.g., "Abuseif et al. (2025)" or "(Abuseif et al., 2025)").</li>
277
  <li><strong>Citation URL:</strong> Paste the hyperlink URL from the citation (right-click and select "Copy Link Address").</li>
278
  </ul>
279
  </li>
280
  <li><strong>Enter SCC Index Information:</strong>
281
  <ul>
282
- <li><strong>SCC Index Text:</strong> Paste the hash text (e.g., "Abuseif et al. (2025). &lt;hash&gt;").</li>
283
- <li><strong>SCC Index URL:</strong> Paste the hyperlink URL from the hash (right-click and select "Copy Link Address").</li>
284
  </ul>
285
  </li>
286
  <li><strong>Verify Citation:</strong> Click the "Verify Citation" button.</li>
@@ -366,7 +363,7 @@ with tabs[0]:
366
  st.markdown(citation_link_end, unsafe_allow_html=True)
367
  st.markdown('</div>', unsafe_allow_html=True)
368
 
369
- # SCC Ledger
370
  st.markdown("### SCC Index")
371
  st.markdown('<div class="hash-display">', unsafe_allow_html=True)
372
  st.markdown(metadata_link, unsafe_allow_html=True)
 
111
  return '#:~:text=' in url
112
 
113
  def parse_citation_text(citation_text):
 
114
  match = re.match(r'^(?:(\w[\w\s.,&et al]+)\s*\((\d{4})\)|\((\w[\w\s.,&et al]+),\s*(\d{4})\))$', citation_text.strip())
115
  if match:
116
  author = match.group(1) or match.group(3)
 
210
 
211
  <h4>Technical Legitimacy</h4>
212
  <p>The SCC style leverages the <a href="https://wicg.github.io/scroll-to-text-fragment/" target="_blank">W3C Text Fragments specification</a>, enabling precise linking to specific text within web pages. This ensures citations are contextually accurate and verifiable, aligning with modern web standards.</p>
213
+
214
+ <h4>Example Citation</h4>
 
 
215
  <p><strong>Inputs:</strong></p>
216
  <ul>
217
  <li><strong>Username:</strong> jdoe</li>
 
223
  </ul>
224
  <p><strong>Outputs:</strong></p>
225
  <ul>
226
+ <li><strong>Citation (Start of Text):</strong> <span style="font-size: 1.2rem;">Abuseif et al. (2025)</span> (hyperlinked to <code>https://www.sciencedirect.com/science/article/pii/S2772411523000046#:~:text=A%20proposed%20design%20framework</code>)</li>
227
+ <li><strong>Citation (End of Text):</strong> <span style="font-size: 1.2rem;">(Abuseif et al., 2025)</span> (hyperlinked to <code>https://www.sciencedirect.com/science/article/pii/S2772411523000046#:~:text=A%20proposed%20design%20framework</code>)</li>
228
+ <li><strong>SCC Index:</strong> <span style="font-size: 0.85rem;">Abuseif et al. (2025). a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890</span> (hyperlinked to <code>https://www.sciencedirect.com/science/article/pii/S2772411523000046#:~:text=jdoe—Urban%20Design%20Thesis—2025-08-06—19:23:45</code>)</li>
229
  </ul>
230
  </div>
231
  """, unsafe_allow_html=True)
232
 
233
+ # Expandable section for SCC Style Guidelines
234
  with st.expander("SCC Style Guidelines"):
235
  st.markdown("""
236
  <div class="info-card">
 
257
  <li><strong>Generate Citation:</strong> Click the "Generate Citation" button.</li>
258
  <li><strong>Copy Outputs:</strong>
259
  <ul>
260
+ <li><strong>Citation (Start of Text):</strong> Use "Author (Year)" for the start of a sentence (e.g., Abuseif et al. (2025)).</li>
261
+ <li><strong>Citation (End of Text):</strong> Use "(Author, Year)" for in-text citations (e.g., (Abuseif et al., 2025)).</li>
262
+ <li><strong>SCC Index:</strong> Copy the index link (e.g., Abuseif et al. (2025). a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890) for verification.</li>
263
  <li>Right-click each link to copy the "Link Address" for verification.</li>
264
  </ul>
265
  </li>
 
270
  <li><strong>Access the Tool:</strong> Open the "Verify Citation" tab.</li>
271
  <li><strong>Enter Citation Information:</strong>
272
  <ul>
273
+ <li><strong>Citation Text:</strong> Paste the citation text (e.g., Abuseif et al. (2025) or (Abuseif et al., 2025)).</li>
274
  <li><strong>Citation URL:</strong> Paste the hyperlink URL from the citation (right-click and select "Copy Link Address").</li>
275
  </ul>
276
  </li>
277
  <li><strong>Enter SCC Index Information:</strong>
278
  <ul>
279
+ <li><strong>SCC Index Text:</strong> Paste the index text (e.g., Abuseif et al. (2025). a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4e5f67890).</li>
280
+ <li><strong>SCC Index URL:</strong> Paste the hyperlink URL from the index (right-click and select "Copy Link Address").</li>
281
  </ul>
282
  </li>
283
  <li><strong>Verify Citation:</strong> Click the "Verify Citation" button.</li>
 
363
  st.markdown(citation_link_end, unsafe_allow_html=True)
364
  st.markdown('</div>', unsafe_allow_html=True)
365
 
366
+ # SCC Index
367
  st.markdown("### SCC Index")
368
  st.markdown('<div class="hash-display">', unsafe_allow_html=True)
369
  st.markdown(metadata_link, unsafe_allow_html=True)