pingcap / website

The website of PingCAP. Powered by Gatsby ⚛️ and Rocket 🚀.
11 stars 21 forks source link

Fix the code format in tables of case studies and blog posts #145

Closed CaitinChen closed 4 years ago

CaitinChen commented 4 years ago

For example, in the post: https://pingcap.com/blog/heterogeneous-database-replication-to-tidb

In the table, DELETE and UPDATE are not displayed in the inline code format.

@YiniXu9506 PTAL

std4453 commented 4 years ago

As in here, the markdown file uses a HTML <table> instead of the markdown format, so there's no way to support complicated formats with that.

By changing that table to real markdown code, the inline code would work.

| **Advantages** | **Disadvantages** |
| -- | -- |
| Your application requires no additional development.<br>CDC tools can obtain all DML changes, like `DELETE` and `UPDATE`.<br>Because the workload is distributed through the day, these tools have higher performance.<br>CDC tools bring low latency and near real-time replication.<br>Upstream data is obtained by reading redo logs, which does not impact the SQL performance. | CDC tools are mostly commercial products, and you need to purchase them.<br>Most CDC tools only allow a specific database as an upstream database. If you have multiple types of upstream databases, you need to use multiple CDC tools. |

Certain pitfalls do exist here like a table cell can only occupy one single line, so <br> have to be inserted manually and the code looks disgusting.

Another solution is to create these tags manually, like:

<table>
  <tr>
   <td><strong>Advantages</strong>
   </td>
   <td><strong>Disadvantages</strong>
   </td>
  </tr>
  <tr>
   <td>Your application requires no additional development.
<p>
CDC tools can obtain all DML changes, like <code>DELETE</code> and <code>UPDATE</code>.
<p>
Because the workload is distributed through the day, these tools have higher performance.
<p>
CDC tools bring low latency and near real-time replication.
<p>
Upstream data is obtained by reading redo logs, which does not impact the SQL performance.
   </td>
   <td>CDC tools are mostly commercial products, and you need to purchase them.
<p>
Most CDC tools only allow a specific database as an upstream database. If you have multiple types of upstream databases, you need to use multiple CDC tools.
   </td>
  </tr>
</table>

So <code> tags are inserted manually here. Considering the effort made to write <table> tags by hand (which is done in various places throughout the blogs), this should not create too big a trouble.

FYI, here's a list that uses <table> tags (from all English blogs):

CaitinChen commented 4 years ago

@std4453 Thanks.