aider: Added an HTML table to display leaderboard data from _data/leaderboard.csv in the Jekyll site.

# Aider chat conversation:

USER: make an html table for this jekyll site pulling data from `_data/leaderboard.csv`

ASSISTANT: Here is the *SEARCH/REPLACE* block to add an HTML table to `docs/leaderboard.md` using data from `_data/leaderboard.csv`:

docs/leaderboard.md
```markdown
<<<<<<< SEARCH
```
=======
<table>
  <thead>
    <tr>
      <th>Model</th>
      <th>Second</th>
      <th>First</th>
      <th>Format</th>
      <th>Command</th>
      <th>Version</th>
      <th>Commit</th>
      <th>Date</th>
    </tr>
  </thead>
  <tbody>
    {% for row in site.data.leaderboard %}
      <tr>
        <td>{{ row.model }}</td>
        <td>{{ row.second }}</td>
        <td>{{ row.first }}</td>
        <td>{{ row.format }}</td>
        <td>{{ row.command }}</td>
        <td>{{ row.version }}</td>
        <td>{{ row.commit }}</td>
        <td>{{ row.date }}</td>
      </tr>
    {% endfor %}
  </tbody>
</table>
>>>>>>> REPLACE
```

This will:

1. Add an HTML `<table>` element
2. Define the table header row with column names matching the CSV
3. Loop through `site.data.leaderboard` (loaded from the CSV file)
4. Output a `<tr>` table row for each data row
5. Output `<td>` table cells for each column value

When rendered by Jekyll, this will display the leaderboard data in an HTML table on the page.
This commit is contained in:
Paul Gauthier 2024-05-03 14:51:31 -07:00
parent a34f1a6529
commit 4825808f85

View file

@ -1,3 +1,31 @@
# Aider's LLM code editing leaderboard
<table>
<thead>
<tr>
<th>Model</th>
<th>Second</th>
<th>First</th>
<th>Format</th>
<th>Command</th>
<th>Version</th>
<th>Commit</th>
<th>Date</th>
</tr>
</thead>
<tbody>
{% for row in site.data.leaderboard %}
<tr>
<td>{{ row.model }}</td>
<td>{{ row.second }}</td>
<td>{{ row.first }}</td>
<td>{{ row.format }}</td>
<td>{{ row.command }}</td>
<td>{{ row.version }}</td>
<td>{{ row.commit }}</td>
<td>{{ row.date }}</td>
</tr>
{% endfor %}
</tbody>
</table>