YAML tables in Markdown
Posted on September 07, 2018 in Develop
If you put YAML in your github markdown, you can use it for creating nested tables
This is opposed to using normal markdown tables as here:
Normal | Markdown | Tables |
---|---|---|
col 3 is | right-aligned | $1600 |
col 2 is | centered | $12 |
zebra stripes | are neat | $1 |
Cool usage sample
CryptoZombies is a code teaching webapp that uses data from Yaml tables as persistence for their content. Here is how their markup shows in github:
The corresponding yaml markdown:
---
title: Ownable Contracts
actions: ['checkAnswer', 'hints']
requireLogin: true
material:
editor:
language: sol
startingCode:
"zombiefactory.sol": |
pragma solidity ^0.4.19;
// 1. Import here
"zombiefeeding.sol": |
pragma solidity ^0.4.19;
// other sol code here
"ownable.sol": |
// other sol code here
answer: >
pragma solidity ^0.4.19;
// other sol code here
---
Did you spot ....
What is really cool is how their webapp formats the .md
Links
- github/markup
- Markdown Cheatsheet
- CryptoZombies - Learn to code games on Ethereum.
- CryptoZombies lessons webapp on github
The End