Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kbravh/table-to-markdown

A Chrome DevTools extension to convert an HTML Table to Markdown for easy export.
https://github.com/kbravh/table-to-markdown

html-table markdown

Last synced: 24 days ago
JSON representation

A Chrome DevTools extension to convert an HTML Table to Markdown for easy export.

Awesome Lists containing this project

README

        

[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
[![Chrome Web Store Version][chrome-version-shield]][chrome-url]
[![Chrome Web Store Users][chrome-users-shield]][chrome-url]





Logo

Table to Markdown


A Chrome DevTools extension to convert an HTML Table to Markdown for easy export.




Report a Bug
·
Request a Feature

## About The Project

This Chrome DevTools extension adds an extra tab to the Chrome DevTools and will allow you to export any HTML Table in Markdown format.

## Installing

The latest published version of the extension can be installed from the [Chrome Web Store](https://chrome.google.com/webstore/detail/html-table-to-markdown/ghcdpakfleapaahmemphphdojhdabojj).

To load this extension locally for development, clone the repo to your machine. Visit the Chrome extensions page at [chrome://extensions](chrome://extensions) and click the `Load Unpacked` button. Navigate to and choose this project folder that you cloned. And voilà! The extension will now appear in your browser and DevTools.

## Usage

Navigate to a page that has an HTML table element. Right click anywhere on the table you would like to export and inspect it in your DevTools. You don't have to select the top `` element yourself! If you selected anything inside of the table, the extension will find the entire table.

Open the Table to Markdown panel of the DevTools (you may need to click the dropdown to see it). Click the `Convert to Markdown` button, and your markdown table will appear in the box.

### HTML Table export format

To see an example of how a table will be rendered, let's look at the following table taken from the [Scholastic Accolades Wikipedia page](https://en.wikipedia.org/wiki/Scholastic_accolades#Doctors_in_law).



Accolade
Name
Death



Doctor Aristotelis Anima
Johannes Dondus
1380


Doctor a Doctoribus
Antonius Franciscus
1528


Doctor Fons Canonum
Johannes Andrea
1348


Doctor Fons Juris Utriusque
Henry of Susa (Ostia)
1267-81


Doctor Lucerna Juris
Baldus de Ubaldis
1400


Doctor Lucerna Juris Pontificii
Nicholas Tedeschi (O.S.B.)
1445


Doctor Lumen Juris
Pope Clement IV
1268



Doctor Lumen Legum
Irnerius
1125 (after)



Doctor Memoriosissimus
Ludovicus Pontanus
1439


Doctor Monarcha Juris
Bartholomew of Saliceto
1412


Doctor Os Aureum
Bulgarus
1166


Doctor Pater Decretalium
Gregory IX
1241


Doctor Pater et Organum Veritatis
Pope Innocent IV
1254


Doctor Pater Juris
Pope Innocent III
1216


Doctor Pater Peritorum
Pierre de Belleperche
1307


Doctor Planus ac Perspicuus
Walter Burleigh
1337


Doctor Princeps Subtilitatum
Francesco d'Accolti
1486


Doctor Speculator
William Durandus
1296


Doctor Speculum Juris
Bartholus of Sassoferrato
1359


Doctor Subtilis
Benedict Raymond
1440


Doctor Subtilis
Filippo Corneo
1462


Doctor Verus
Thomas Doctius, Siena
1441



This table will be rendered in Markdown as follows:

```
| Accolade | Name | Death |
|-----------------------------------|----------------------------|--------------|
| Doctor Aristotelis Anima | Johannes Dondus | 1380 |
| Doctor a Doctoribus | Antonius Franciscus | 1528 |
| Doctor Fons Canonum | Johannes Andrea | 1348 |
| Doctor Fons Juris Utriusque | Henry of Susa (Ostia) | 1267-81 |
| Doctor Lucerna Juris | Baldus de Ubaldis | 1400 |
| Doctor Lucerna Juris Pontificii | Nicholas Tedeschi (O.S.B.) | 1445 |
| Doctor Lumen Juris | Pope Clement IV | 1268 |
| Doctor Lumen Legum | Irnerius | 1125 (after) |
| Doctor Memoriosissimus | Ludovicus Pontanus | 1439 |
| Doctor Monarcha Juris | Bartholomew of Saliceto | 1412 |
| Doctor Os Aureum | Bulgarus | 1166 |
| Doctor Pater Decretalium | Gregory IX | 1241 |
| Doctor Pater et Organum Veritatis | Pope Innocent IV | 1254 |
| Doctor Pater Juris | Pope Innocent III | 1216 |
| Doctor Pater Peritorum | Pierre de Belleperche | 1307 |
| Doctor Planus ac Perspicuus | Walter Burleigh | 1337 |
| Doctor Princeps Subtilitatum | Francesco d'Accolti | 1486 |
| Doctor Speculator | William Durandus | 1296 |
| Doctor Speculum Juris | Bartholus of Sassoferrato | 1359 |
| Doctor Subtilis | Benedict Raymond | 1440 |
| Doctor Subtilis | Filippo Corneo | 1462 |
| Doctor Verus | Thomas Doctius, Siena | 1441 |
```

### HTML Tables without headers

Most Markdown table parsers do not support header-less tables. To compensate for this, this extension throws in a blank header row. For example, take the following table (taken from the [NBA Most Valuable Player Award Wikipedia page](https://en.wikipedia.org/wiki/NBA_Most_Valuable_Player_Award)).



^
Denotes player who is still active in the NBA


*
Inducted into the Naismith Memorial Basketball Hall of Fame



Denotes player whose team won championship that year


Player (X)
Denotes the number of times the player had been named MVP at that time


Team (X)
Denotes the number of times a player from this team had won at that time


This table will be rendered in Markdown like this:

```
| | |
|------------|--------------------------------------------------------------------------|
| ^ | Denotes player who is still active in the NBA |
| * | Inducted into the Naismith Memorial Basketball Hall of Fame |
| † | Denotes player whose team won championship that year |
| Player (X) | Denotes the number of times the player had been named MVP at that time |
| Team (X) | Denotes the number of times a player from this team had won at that time |
```

### HTML tables with missing cells

HTML tables sometimes leave off empty cells in the final column, like this table about [medieval accolades](https://en.wikipedia.org/wiki/Scholastic_accolades#Other_medieval_accolades).



Accolade
Name
Death
Translation/Notes



Apostolus
St. Paul
67
Due to his preeminence among the Letters of the Apostles within the Bible


Commentator
Averroes (Ibn Rushd)
1198


Magister sententiarum
Peter Lombard
1160


Philosophus
Aristotle
BC 322


Propheta
David
BC 10th century
Due to his authorship of the Psalms


Theologus
Augustine of Hippo
430


It will be rendered in Markdown with the cells missing as well. Markdown parsers usually handle this gracefully and render the table with those cells blank.

``` md
| Accolade | Name | Death | Translation/Notes |
|-----------------------|----------------------|-----------------|---------------------------------------------------------------------------|
| Apostolus | St. Paul | 67 | Due to his preeminence among the Letters of the Apostles within the Bible |
| Commentator | Averroes (Ibn Rushd) | 1198 |
| Magister sententiarum | Peter Lombard | 1160 |
| Philosophus | Aristotle | BC 322 |
| Propheta | David | BC 10th century | Due to his authorship of the Psalms |
| Theologus | Augustine of Hippo | 430 |
```

### Tables with elements that span rows or columns

HTML tables allow for elements that span multiple rows or columns, a feature not supported in most Markdown flavors. To compensate for this, any cells that span multiple rows or columns are just repeated to avoid ambiguity. See this table of vowels from the [Esperanto Wikipedia page](https://en.wikipedia.org/wiki/Esperanto#Vowels).




Front
Back


Close
i
u


Mid
e
o


Open
a


The `a` vowel that spans two columns at the bottom would be repeated, and the Markdown would appear as so:

``` md
| | | |
|-------|-------|------|
| | Front | Back |
| Close | i | u |
| Mid | e | o |
| Open | a | a |
```

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch ( `git checkout -b feature/AmazingFeature` )
3. Commit your Changes ( `git commit -m 'Add some AmazingFeature'` )
4. Push to the Branch ( `git push origin feature/AmazingFeature` )
5. Open a Pull Request

## License

This project is licensed under the MIT License - see the [ `LICENSE` ](LICENSE) file for details

## Contact

Karey Higuera - [@kbravh](https://twitter.com/kbravh) - [email protected]

Project Link: [https://github.com/kbravh/table-to-markdown](https://github.com/kbravh/table-to-markdown)

[issues-shield]: https://img.shields.io/github/issues/kbravh/table-to-markdown.svg?style=flat-square
[issues-url]: https://github.com/kbravh/table-to-markdown/issues
[license-shield]: https://img.shields.io/github/license/kbravh/table-to-markdown.svg?style=flat-square
[license-url]: https://github.com/kbravh/table-to-markdown/blob/master/LICENSE
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/kbravh
[chrome-version-shield]: https://img.shields.io/chrome-web-store/v/ghcdpakfleapaahmemphphdojhdabojj?style=flat-square
[chrome-users-shield]: https://img.shields.io/chrome-web-store/users/ghcdpakfleapaahmemphphdojhdabojj?style=flat-square
[chrome-url]: https://chrome.google.com/webstore/detail/html-table-to-markdown/ghcdpakfleapaahmemphphdojhdabojj