omardelarosa / obsidian-mtg

A plugin for managing Magic: The Gathering decks and card lists as Obsidian notes
MIT License
30 stars 5 forks source link

Display as obsidian table #21

Open JoshKasap opened 1 year ago

JoshKasap commented 1 year ago

Could you update the plugin so that it displays as a table instead of the custom setup you have.

I'm using the Faded theme which can be found in community themes. This theme has various custom things including custom bullet point styles. However, whatever html you're using to create the current list has three issues.

  1. It just takes up a ton of space. This can be seen on the default obsidian theme as well as the Faded theme.
  2. The information is just harder to read when it's not placed in a table
  3. Something with your html causes the custom bullet points in the Faded theme to show in the rendered element

This image shows what it looks like when using the Faded theme (Many themes using custom bullets will have the same issues - ITS theme for example) image

This second image shows what it could look like if you used a table instead image

The Deck and Sideboard titles could use the same styling as what you have now but my example image above is just using regular text so it looks smaller than what I would Ideally want.

the code for those tables is pretty simple here is the markdown for the sideboard

| Count | Name                | Price |
| ----- | ------------------- | ----- |
| 2     | Disdainful Stroke   | $0.16 |
| 4     | Negate              | $0.44 |
| 4     | Out of the Way      | $0.12 |
| 1     | Reckoner Bankbuster | $3.02 |
| 4     | Ertai's Scorn       | $0.28 |
|       |                     |       |
| 15    | cards               | $4.02 |

and here is the raw html for it

<table>
<thead>
<tr>
<th>Count</th>
<th>Name</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>2</td>
<td>Disdainful Stroke</td>
<td>$0.16</td>
</tr>
<tr>
<td>4</td>
<td>Negate</td>
<td>$0.44</td>
</tr>
<tr>
<td>4</td>
<td>Out of the Way</td>
<td>$0.12</td>
</tr>
<tr>
<td>1</td>
<td>Reckoner Bankbuster</td>
<td>$3.02</td>
</tr>
<tr>
<td>4</td>
<td>Ertai's Scorn</td>
<td>$0.28</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>15</td>
<td>cards</td>
<td>$4.02</td>
</tr>
</tbody>
</table>

Even excluding my particular gripes with how it renders via the Faded theme, I really think this change should be made because it would look better even when using the default theme. Plus any theme that adds basic table styling will automatically work with your plugin without css devs taking any extra time to support it.

Serif-7 commented 1 year ago

I might make a fork with this change if I have time.

omardelarosa commented 1 year ago

@Serif-7 this is awesome! Definitely something I can roll in on the next version.