Youwang Deng

I'm a software developer, familiar with C#, Java, JavaScript, focus on full stack development.

Markdown syntax example

26 May 2019 » Markdown

Following are some examples of markdown syntax.

1. URL

use “[text to display]” and “(href)” to customize the url link, such as Markdown Doc.

2. Strong Text

put “**” besides the text to make it to be strong, such as Strong Text.

3. Code Snippet

put “ ` “ besides the text that to be treated as code snippet, such as int a = 3;

4. horizontal line

put more than 3 “ - “ to make a horizontal line, such as “---”.


5. List

use “*” and space to make lists, such as

  • item 1
  • item 2 list inside another list could be achieved by three space.
  • list 1
    • list 2
      • list 3

6. Code blocks, support language highlight

use “ ```language “ as beginning line and “```” as end line to make coding blocks, such as following java code block.

import java.util.*;
class Solution {
    public static void main(Sting[] args) {
        List<Integer> res = new ArrayList<>();
        for(int i = 0; i < 10; i++) res.add(i);
    }
}

if the code is HTML then use jekyll highlight syntax.

<script type="text/javascript">
function isNumber(evt) {
    evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        return false;
    }
    return true;
}
</script>

7. insert web page

use “iframe” tag to insert a web page into markdown file, such as markdown doc page.



8. insert a quote

use “>” to quote, such as

some quote

9. insert an image

use “![alt](image src “title”) to inset an image, such as

scene

10. inset a table

use

header | header | header
:-:|:-:|:-:|
content | content | content

such as

header 1header 2header 3
123