Git Product home page Git Product logo

markdown_blogs's Introduction

Markdown Starter Worksheet

Markdown cheatsheet

The main goal of MarkDown is to be easily written and easily read. It uses "plain text" formatting and can be converted to HTML. The most common use case I've come across to use Markdown is for ReadMe files, used, for example, for Github repos. Markdown can also be used to create email.

Markdown, in comparison to HTML, is much simpler to read and write. The average person can typically understand markdown and would be able to learn and write it much quicker than HTML.

Specifically, Visual Studio Code uses the CommonMark Markdown specification.

Sections


Headers

Headers are defined by the '#'symbol. One '#' for H1, two for H2, etc.

header

header

header

header


Quotes

Quotes are defined by the '>' symbol

TODO. Create a quote

You can combine a header with a quote.

TODO. Create an H2 Quote


Emphasis

Add emphasis with asterisks '*' and underscores '_' Two before and after (no spaces) a section of texts makes it bold

One before and after (no spaces) a section of texts makes it bold

You can also put Bold and Italicized text inline by surrounding a group of words.

TODO. Create a bold sentence, an italicized sentence, and a sentence with both bold and italicized text inline

Horizontal Rule

A horizontal rule gives a visible line break. You can create one by putting three or more hypens, asterisks, or underscores (-, *, _).

For what it's worth, I prefer dashes...

TODO Create a horizontal rule


Lists

Create unordered lists using '-', '*', '+,

You can create sublists by indenting

Create ordered lists using a number prefix

TODO Create an unordered list of your 5 favorite TV Shows

TODO Create an ordered list of your top 5 Movies


Links

Create a link by surrounding it with angle bracket

Create a link with text by surrounding text with brackets, [], and link immediately following with parenthesis ()

TODO Create a link to your website, twitter, or github. with no text

TODO Create a link with text to your website, twitter, or github

What if you needed to reuse a link several times? Well, you could copy and paste that link each time. That means, if you need to update the link, you will have to do it each time its used. There's a better way!

Create reference style links by defining your link with the a 'key' inside of brackets, colon, space, and the link

Then use the reference style link by using your text inside of brackets followed by the link 'key' inside of bracket.

TODO Create a reference link to your website and reference it three times

You can also link to other locations on your markdown page. Remember, your MarkDown will get converted to HTML, so you can, in theory, use a anchor tag to link to an element with a specific ID. You can find an example of this in the list of sections at the top of this document.

When we create a header tag for example, it implicitly creates an id property.

Ex '# Header' becomes <h1 id="header">Header</h1>

Names will be converted to ids by replacing spaces with hyphens and uppercase letters with lowercase letters (think css naming convention).

Ex 'Header Info' becomes header-info

TODO Create a link to another part of your page.


Images

Defining an image is similar to defining a link, except you prefix it with '!'

alt text

Just like links, you can define images by reference in the same format.

Define the reference

Use the reference

TODO Create a reference link to your profile picture and then reference it.


Code

You can do inline code with backticks (``)

import { useState, useEffect } from 'react';

const App = () => {
  const [state, setState] = useState();

  useEffect(() => {
    setState(state + 1);
  }, []);

  return <div>{state}</div>;
};

TODO Display a block of code from your favorite language

The above does not give language specific highlighting. You can specify the programming language immediately following the opening 3 backticks. You Should see a difference in highliting!

TODO Display a block of code from your favorite language while specifying the language


Tables

Tables are useful for displaying rows and columns of data. Column headers can be defined in between pipes (|). Headers are separated from table content with a row of dashes (-) (still separated by pipes), and there must be at least 3 dashes between each header. The row data follows beneath (still separated by pipes).

The column definitions and row definitions do not have to have the exact same width sizes, but it would be much more readable. Notice the output of the following two tables are the same, but the second (the raw markdown) is much more readable.

TODO Create a table with three columns and two rows

You can also align (Center, left, right) the text in a column by using colons (:) in the line breaks between headers and rows. No colon means the default left alignment. Colons on each side signifies center alignment. And a trailing colon means right alignment.

TODO Create a table with three columns, one aligned left, one aligned center, and one aligned right


Custom HTML

Since MarkDown gets automatically converted to HTML, you can add raw HTML directly to your MarkDown.

<p>Sample HTML Div</p>

Creates this

Sample HTML Div

TODO If you are comfortable with HTML, add some raw HTML.


Custom CSS

You can also add custom CSS to your MarkDown to add additional styling to your document. You can also include CSS by including a style tag.

<style>
  p {
    color: green;
  }
</style>

TODO If you are comfortable with CSS, give your page some style.


Additional Resources

markdown_blogs's People

Contributors

renuja99 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.