<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gabe the Bear</title>
    <description>The latest articles on DEV Community by Gabe the Bear (@gabethebear).</description>
    <link>https://dev.to/gabethebear</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2925728%2Fa5a7c15a-2e88-4031-80a6-a0c25524e42c.jpg</url>
      <title>DEV Community: Gabe the Bear</title>
      <link>https://dev.to/gabethebear</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gabethebear"/>
    <language>en</language>
    <item>
      <title>Redesigning the Reference Component on Gabe the Bear Blog</title>
      <dc:creator>Gabe the Bear</dc:creator>
      <pubDate>Sun, 23 Mar 2025 09:00:00 +0000</pubDate>
      <link>https://dev.to/gabethebear/redesigning-the-reference-component-on-gabe-the-bear-blog-1bi</link>
      <guid>https://dev.to/gabethebear/redesigning-the-reference-component-on-gabe-the-bear-blog-1bi</guid>
      <description>&lt;p&gt;The reference component is one thing on Gabe the Bear Blog I'm most proud of. It doesn't look pretty, but it offers a place for reference and attachments (GitHub repos, relevant links, etc). Few blogs I see have such a pronounced component for reference. Most websites have a "See Also" component with a list of links below it. Some websites haven't even got a "See Also" section, in which case it is just another heading under the content. Some websites do not reference anything, even when the text says "according to a report", which is amazing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7srxuiyizjvf6x07fz9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7srxuiyizjvf6x07fz9.png" alt="A screenshot of a Gabe the Bear blog post. The reference component is each item listed under the " width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have not noticed, the reference component is each item listed under the "Reference" heading on a blog post (see above), on the right on a wide screen and at the bottom on a narrow one. It looks nothing more than a list item, except the icon is determined by the reference kind. For some kinds, there might be extra text before the link.&lt;/p&gt;

&lt;p&gt;I have always used this component to add links to the material I referred to on Gabe the Bear blog posts. It worked really well until this Pi Day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem on the Blog
&lt;/h2&gt;

&lt;p&gt;If you look at the reference section on &lt;a href="https://gabe-the-bear.app/projects/pi-day-2025/2025/what-others-did" rel="noopener noreferrer"&gt;one of the Pi Day posts&lt;/a&gt; this year, you will find their text looks rather bizarre.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fndbr0lc68x4dsvpdisw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fndbr0lc68x4dsvpdisw8.png" alt="The text under the paper title spanned 14 lines, while the title only three lines" width="377" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The text under the title is much longer than my other posts. It also appears to be a machine-readable format rather than one meant for bears. In fact, it was in a format called BibTeX. It is a reference format used in academia to cite materials, used together with LaTeX.&lt;/p&gt;

&lt;p&gt;When I was writing the posts (actually, Jupyter Notebooks) for Pi Day 2025 celebration, I didn't expect the citations to look like that. That's when I realised that the component was initially designed for documentation pages and GitHub repos, and not academic papers. Since Pi Day celebration is important for bears, I expect to cite more papers in the future. Therefore, the component will need a change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Structure
&lt;/h2&gt;

&lt;p&gt;Currently, the prop data structure for the reference component is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Reference&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ReferenceKind&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// Enum for deciding the icon, details omitted&lt;/span&gt;
    &lt;span class="nl"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;          &lt;span class="c1"&gt;// Title of the page/video/paper etc.&lt;/span&gt;
    &lt;span class="nl"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;           &lt;span class="c1"&gt;// URL&lt;/span&gt;
    &lt;span class="nl"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// Why this reference was added&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My first question was whether I needed to change this. In other words, whether there are other fields that are important, but I never listed on my posts. The description stating why this reference was added always feels slightly weird to me. Maybe it needs a replacement.&lt;/p&gt;

&lt;p&gt;As a tangent, I attempted to apply for several PhD programmes over the past year, most of which asked for a research proposal. While writing those, I learned of a citation management tool called Zotero. It generates citation based on a URL, and converts it to citation text based on a specified format. It also has a browser extension to be used with their desktop tool. The fields it collects from pages can be useful for this problem.&lt;/p&gt;

&lt;p&gt;So I listed all the kinds of things I think I will ever refer to in my posts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A paper (like &lt;a href="http://arxiv.org/abs/2502.08033" rel="noopener noreferrer"&gt;this one&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;A documentation page (like &lt;a href="https://panel.holoviz.org/tutorials/basic/index.html" rel="noopener noreferrer"&gt;this one&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;A Kaggle dataset (like &lt;a href="https://www.kaggle.com/datasets/adilshamim8/student-depression-dataset" rel="noopener noreferrer"&gt;this one&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;A web-based game (like &lt;a href="https://www.getbadnews.com/books/english/" rel="noopener noreferrer"&gt;this one&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;A conference talk on YouTube (like &lt;a href="https://www.youtube.com/watch?v=wiGkV37Kbxk" rel="noopener noreferrer"&gt;this one&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;A GitHub repository (like &lt;a href="https://github.com/panda3d/panda3d" rel="noopener noreferrer"&gt;this one&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;A song (like &lt;a href="https://music.youtube.com/watch?v=Dt0CYNAYfNY" rel="noopener noreferrer"&gt;this one&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I then saved them to Zotero and checked what information it saved for each. I also checked the citation it generated to see which of the fields it collected are more important. I chose IEEE as the reference format, only because I'm more familiar with it. For example, for the YouTube video I chose, Zotero generated the citation in IEEE format as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[1] PyData, Raymond Hettinger: Numerical Marvels Inside Python - Keynote | PyData Tel Aviv 2022, (Jan. 11, 2023). Accessed: Mar. 17, 2025. [Online Video]. Available: https://www.youtube.com/watch?v=wiGkV37Kbxk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although Zotero collected many more fields, it seemed only the channel, title and URL were important to the IEEE format.&lt;/p&gt;

&lt;p&gt;I did this for all the seven items above. Here are the results. Note that the fields are not all possible fields Zotero can collect, but rather, all fields that were not empty in my experiment.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For the paper, Zotero collected the item as "Preprint". It also collected the title, authors, repository (Arxiv, in this case), DOI (Digital Object Identifier) and the URL.&lt;/li&gt;
&lt;li&gt;For the documentation page, dataset, the game and the song, Zotero collected all of them as "Web Page", with their title, author, website title and URL. In particular, because the song was collected from YouTube Music, which was both a complex web application and a Premium-only feature, the URL was incorrect.&lt;/li&gt;
&lt;li&gt;For the conference talk, Zotero collected it as "Video Recording", with title, director, URL, date and running time. Surprisingly, it seemed to list the name of the YouTube channel as "Director".&lt;/li&gt;
&lt;li&gt;For the GitHub repository, Zotero collected it as "Software", with the repo title, library catalogue ("GitHub"), programming language. It also somehow collected Panda3D as "Company" and the repo description as "Abstract". I needed to wait until the page loaded completely, otherwise it would be collected as a "Web Page".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note that on the Kaggle dataset page, there is a section under "Metadata" called "DOI Citation", which might give how the dataset should be cited. Look at this &lt;a href="https://www.kaggle.com/datasets/grassknoted/asl-alphabet" rel="noopener noreferrer"&gt;ASL Alphabet dataset&lt;/a&gt;, for example.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fykw9zuuwsh2zp2dd8imr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fykw9zuuwsh2zp2dd8imr.png" alt="DOI Citation section of an ASL Alphabet image dataset on Kaggle, showing the DOI, following a selection of whether to use BibTex or APA citation, and a box for generated citation text and a copy button" width="800" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The "About Dataset" section might also specify how the dataset should be cited.&lt;/p&gt;

&lt;p&gt;Given what information Zotero and IEEE format think is important for each of these resources, I will change the data structure to the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Reference&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ReferenceKind&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// Enum for deciding the icon, details omitted&lt;/span&gt;
    &lt;span class="nl"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;          &lt;span class="c1"&gt;// Title of the page/video/paper etc.&lt;/span&gt;
    &lt;span class="nl"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;           &lt;span class="c1"&gt;// URL&lt;/span&gt;
    &lt;span class="nl"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="cm"&gt;/**
     * "S -&amp;gt; T" means "S if S is not None else T" in Python
     *
     * For papers: archive ID -&amp;gt; DOI
     * For web pages: website title -&amp;gt; host name
     * For conference talks: library catalogue + channel title ("director") -&amp;gt; library catalogue
     * For code repositories: library catalogue + author ("company")
     */&lt;/span&gt;
    &lt;span class="nl"&gt;dates&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Accessed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Published&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;
    &lt;span class="p"&gt;}[];&lt;/span&gt;                   &lt;span class="c1"&gt;// Dates of access and publish, as available&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I do not consider changing the component's appearance other than adding dates at the bottom.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intermezzo: Metadata
&lt;/h2&gt;

&lt;p&gt;One interesting observation was that, of all the "Web Page" type resources, only the game page had "Author" and "Website Title" fields filled in correctly. In particular, for Kaggle datasets, the page must be accessed by putting the URL into the address bar for Zotero to collect "Title" (page title) correctly, and not from navigation on Kaggle search page. Otherwise, the page title will be collected as "Find Open Dataset and Machine Learning Projects | Kaggle".&lt;/p&gt;

&lt;p&gt;Why is this? I looked into the page source of the game page above.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Author came from &lt;code&gt;author&lt;/code&gt; meta tag&lt;/li&gt;
&lt;li&gt;Website title came from &lt;code&gt;og:site_name&lt;/code&gt; meta tag&lt;/li&gt;
&lt;li&gt;Also, the page's &lt;code&gt;og:type&lt;/code&gt; meta tag states it's an &lt;code&gt;article&lt;/code&gt;; while a more proper option should be "game", there's no such type in the &lt;a href="https://ogp.me/#types" rel="noopener noreferrer"&gt;Open Graph protocol&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, the GitHub repo's description came from the &lt;code&gt;description&lt;/code&gt; meta tag. This is also the description when creating a repository. I didn't find where the "Company" field came from, though. This might require reading the source code of Zotero.&lt;/p&gt;

&lt;p&gt;All this shows the importance of writing correct metadata for the page. It's not just search engine engines any more. It's also the reference management tools like Zotero, which many PhD students use, that can get messed up without correct metadata.&lt;/p&gt;

&lt;p&gt;The quirk of Kaggle website was because when navigating, the page only updated the content &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; element, but not the &lt;code&gt;og:title&lt;/code&gt; property in the &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; element. Hopefully this is fixed when you're browsing this site in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw4exyc77mgf5fjyqt4qy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw4exyc77mgf5fjyqt4qy.png" alt="On the left, the page title has been updated correctly. On the right in the console, when meta tags were printed, one tag with " value="" width="800" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Citations Across the Page
&lt;/h2&gt;

&lt;p&gt;Another thing I want to be able to do is to associate each link with its corresponding citation. I had thought this was impossible, until I found a page that did this. It was the Python documentation page. See &lt;a href="https://docs.python.org/3/extending/extending.html" rel="noopener noreferrer"&gt;this page&lt;/a&gt;, for example. The "Footnotes" section has reference to the text, with a link that can link back to the location where the notes were made.&lt;/p&gt;

&lt;p&gt;There's nothing special about the HTML used to implement this feature, other than the numbers "[1]" to "[4]" in the "Footnotes" section had IDs of &lt;code&gt;id1&lt;/code&gt; to &lt;code&gt;id4&lt;/code&gt;, while the corresponding items in the text had IDs of &lt;code&gt;id5&lt;/code&gt; to &lt;code&gt;id8&lt;/code&gt;. The &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; tags for those labels simply linked to the correct IDs. For citation, however, links should only be from the text to the reference section, as a same citation can be at many places in the text.&lt;/p&gt;

&lt;p&gt;The Python documentation is built from a markup format called reStructuredText. In this format, there are explicit &lt;a href="https://docutils.sourceforge.io/docs/user/rst/quickref.html#footnotes" rel="noopener noreferrer"&gt;syntax constructs for footnotes and citations&lt;/a&gt;. For Markdown documents, no footnote or citation syntax is supported, but there seem to be Remark and Rehype plugins. I have yet to try any of them. My idea of an ideal plugin that supports citation in Markdown is one such that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I won't need to type the numbers manually; these numbers should be updated according to their location in the text&lt;/li&gt;
&lt;li&gt;I am able to style the bibliography, including its position&lt;/li&gt;
&lt;li&gt;I am able to put custom data structure in the reference, i.e., reference style&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As another tangent, the idea of collecting URLs in the page and showing them as reference came from a web scraping project of mine. At the time, I wanted to see whether a news article was referring to information only from one site, and therefore is likely biased and unreliable. The link sources could also reveal most popular sites to find relevant information.&lt;/p&gt;

&lt;p&gt;It might be useful to borrow a similar idea, to collect URLs from the post, then generate citations for them. Because this process happens after compiling Markdown to HTML, this is more likely a Rehype thing. Zotero seems to support custom reference formats, so it might be possible to generate a mapping from the URL to the data needed for the component.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I have been writing a conference talk this week so unable to finish all my experiments, test all my hyphotheses, implement the redesign, or read Zotero source code to understand what fields it collects and how it collects them. But I think this was a good reflection of my Pi Day 2025 celebration. My intension is to show that, a citation is more than a link. It is a description of the materials I built my post on top of. The description also lets me and every bear who sees the post decide whether this post is reliable or trustworthy.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>design</category>
      <category>writing</category>
    </item>
    <item>
      <title>Roar! You've Found Me Here!</title>
      <dc:creator>Gabe the Bear</dc:creator>
      <pubDate>Sun, 16 Mar 2025 02:34:14 +0000</pubDate>
      <link>https://dev.to/gabethebear/roar-youve-found-me-here-34c1</link>
      <guid>https://dev.to/gabethebear/roar-youve-found-me-here-34c1</guid>
      <description>&lt;p&gt;Hello bears. Starting this week I will be reworking the structure of Gabe the Bear Blog website, so while that happens, I will be posting here instead.&lt;/p&gt;

&lt;p&gt;Currently, Gabe the Bear Blog is organised into projects (Yes, there are other sections, but I'm going to remove all of them), each having their own "Dev Log", listed on the side of the project page. Because they were nested deep under each project, I would have to write a separate post on the home page as a "Change Log" to tell the readers where the new content were. Soon this became tiring, and even with that, there can only be one post on the home page, so earlier posts would still have to be found under each project.&lt;/p&gt;

&lt;p&gt;Also, if you've seen the projects on Gabe the Bear Blog, you'll find they're not really software projects. But rather, they are really different kinds of activities that bears on this island do. For example, "Japanese Playlist" is more about the music and the postcards about them than the "postcard machine" that powers the postcards. I don't consider myself a software developer either. Therefore, the use of the word "project" is inappropriate. In fact, in a sense, "project" is a stopword that doesn't mean anything.&lt;/p&gt;

&lt;p&gt;In the future, this will be the place where I write about the development of Gabe the Bear Blog itself. Things that I do with the bears on this island will remain on Gabe the Bear Blog.&lt;/p&gt;

&lt;p&gt;Roar. There's another important reason why this blog is opened:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Come feed the little bears&lt;br&gt;
Show them you care&lt;br&gt;
-- "Feed the Birds" parody&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;OK OK you know where I'm going. But while we bears can just catch fish or exchange projects for them, the human behind all this comes from a different universe, and their economy works completely differently. So, 🤷‍♂️.&lt;/p&gt;

</description>
      <category>welcome</category>
    </item>
  </channel>
</rss>
