diff --git a/README.md b/README.md index 8e48c16..49dee35 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [](https://codeclimate.com/github/jeffreytse/jekyll-spaceship) [](https://codeclimate.com/github/jeffreytse/jekyll-spaceship/test_coverage) -A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, etc. +A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, youtube, etc. ## Table of Contents @@ -17,14 +17,23 @@ A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, etc. - [1.2 Multiline](#multiline) - [1.3 Headerless](#headerless) - [1.4 Cell Alignment](#cell-alignment) + - [1.5 Cell Markdown](#cell-markdown) - [2. MathJax Usage](#2-mathjax-usage) - [3. PlantUML Usage](#3-plantuml-usage) + - [4. Video Usage](#4-video-usage) + - [4.1 Youtube Usage](#youtube-usage) + - [4.2 Vimeo Usage](#vimeo-usage) + - [4.3 DailyMotion Usage](#dailymotion-usage) + - [5. Hybrid HTML with Markdown](#5-hybrid-html-with-markdown) + - [6. Markdown Polyfill](#6-markdown-polyfill) + - [6.1 Escape Ordered List](#escape-ordered-list) - [Credits](#credits) - [Contributing](#contributing) - [License](#license) ## Requirements -* Ruby >= 2.3.0 + +- Ruby >= 2.3.0 ## Installation @@ -47,28 +56,29 @@ plugins: **For now, these extended features are provided:** -* Cells spanning multiple columns -* Cells spanning multiple rows -* Cells text align separately -* Table header not required -* Grouped table header rows or data rows +- Cells spanning multiple columns +- Cells spanning multiple rows +- Cells text align separately +- Table header not required +- Grouped table header rows or data rows Noted that GitHub filters out style property, so the example displays with the obsolete align property. But in actual this plugin outputs style property with text-align CSS attribute. #### Rowspan and Colspan + ^^ in a cell indicates it should be merged with the cell above. This feature is contributed by [pmccloghrylaing](https://github.com/pmccloghrylaing). ```markdown -| Stage | Direct Products | ATP Yields | -| ----: | --------------: | ---------: | -|Glycolysis | 2 ATP || -|^^ | 2 NADH | 3--5 ATP | -|Pyruvaye oxidation | 2 NADH | 5 ATP | -|Citric acid cycle | 2 ATP | | -|^^ | 6 NADH | 15 ATP | -|^^ | 2 FADH | 3 ATP | -| 30--32 ATP ||| +| Stage | Direct Products | ATP Yields | +| -----------------: | --------------: | ---------: | +| Glycolysis | 2 ATP | | +| ^^ | 2 NADH | 3--5 ATP | +| Pyruvaye oxidation | 2 NADH | 5 ATP | +| Citric acid cycle | 2 ATP || +| ^^ | 6 NADH | 15 ATP | +| ^^ | 2 FADH | 3 ATP | +| 30--32 ATP ||| ``` Code above would be parsed as: @@ -114,18 +124,19 @@ Code above would be parsed as: #### Multiline + A backslash at end to join cell contents with the following lines. This feature is contributed by [Lucas-C](https://github.com/Lucas-C). ```markdown -|: Easy Multiline :||| -|:------ |:------ |:-------- | -| Apple | Banana | Orange \ -| Apple | Banana | Orange \ -| Apple | Banana | Orange -| Apple | Banana | Orange \ -| Apple | Banana | Orange | -| Apple | Banana | Orange | +| : Easy Multiline : ||| +| :----- | :----- | :------ | +| Apple | Banana | Orange \ +| Apple | Banana | Orange \ +| Apple | Banana | Orange +| Apple | Banana | Orange \ +| Apple | Banana | Orange | +| Apple | Banana | Orange | ``` Code above would be parsed as: @@ -156,18 +167,19 @@ Code above would be parsed as: #### Headerless + Table header can be eliminated. ```markdown |--|--|--|--|--|--|--|--| -|♜| |♝|♛|♚|♝|♞|♜| -| |♟|♟|♟| |♟|♟|♟| -|♟| |♞| | | | | | -| |♗| | |♟| | | | -| | | | |♙| | | | -| | | | | |♘| | | -|♙|♙|♙|♙| |♙|♙|♙| -|♖|♘|♗|♕|♔| | |♖| +|♜| |♝|♛|♚|♝|♞|♜| +| |♟|♟|♟| |♟|♟|♟| +|♟| |♞| | | | | | +| |♗| | |♟| | | | +| | | | |♙| | | | +| | | | | |♘| | | +|♙|♙|♙|♙| |♙|♙|♙| +|♖|♘|♗|♕|♔| | |♖| ``` Code above would be parsed as: @@ -258,21 +270,22 @@ Code above would be parsed as: #### Cell Alignment + Markdown table syntax use colons ":" for forcing column alignment. -Therefore, here we also use it for foring cell alignment. +Therefore, here we also use it for foring cell alignment. Table cell can be set alignment separately. -``` -|: Fruits \|\| Food :||| -|:-------- |:-------- |:------------ | -| Apple |: Apple :| Apple \ -| Banana | Banana | Banana \ -| Orange | Orange | Orange | -|: Rowspan is 4 :|| How's it? | -|^^ A. Peach || 1. Fine :| -|^^ B. Orange ||^^ 2. Bad | -|^^ C. Banana || It's OK! | +```markdown +| : Fruits \|\| Food : ||| +| :--------- | :-------- | :-------- | +| Apple | : Apple :| Apple \ +| Banana | Banana | Banana \ +| Orange | Orange | Orange | +| : Rowspan is 4 : || How's it? | +|^^ A. Peach || 1. Fine :| +|^^ B. Orange ||^^ 2. Bad | +|^^ C. Banana || It's OK! | ``` Code above would be parsed as: @@ -309,22 +322,79 @@ Rowspan is 4 +#### Cell Markdown + +Sometimes we may need some abundant content (e.g., mathjax, image, video) in Markdown table +Therefore, here we also make markown syntax possible inside a cell. + +```markdown +| : MathJax \|\| Image : ||| +| :------------ | :-------- | :----------------------------- | +| Apple | : Apple : | Apple \ +| Banana | Banana | Banana \ +| Orange | Orange | Orange | +| : Rowspan is 4 : || : How's it? : | +| ^^ A. Peach || 1. ![example][cell-image] | +| ^^ B. Orange || ^^ 2. $I = \int \rho R^{2} dV$ | +| ^^ C. Banana || **It's OK!** | + +[cell-image]: https://jekyllrb.com/img/octojekyll.png "An exemplary image" +``` + +Code above would be parsed as: + +
| MathJax || Image + | ||
|---|---|---|
| Apple Banana Orange |
+Apple Banana Orange |
+Apple Banana Orange |
+
|
+Rowspan is 4
+ A. Peach + B. Orange + C. Banana + |
+||
| How's it? | +||
+
|
+||
| It' OK! | +||