পৃষ্ঠাসমূহ

.

Search Your Article

Total Pageviews

Monday, February 20, 2017

Grav - Markdown Syntax

Markdown syntax is defined as writing plain text in an easy to read and easy to write format, which is later converted into HTML code. Symbols like (*) or (`) are used in markdown syntax. These symbols are used to bold, creating headers and organize your content.

To use Markdown syntax, you must create a .md file in your user/pages/02.mypage folder. Enable Markdown Syntax in your \user\config\system.yaml configuration file.
Grav Markdown Syntax There are many benefits of using Markdown syntax, some of them are as follows.
  • It is easy to learn and has minimum characters.
  • When you use markdown there are very few chances of having errors
  • Valid XHTML output
  • Your content and visual display is kept seperate so that it does not affect your website look
  • You can use any text editor or markdown application.
Following are the main elements of HTML that are used in markdown and how would you get the output.

Headings

Each heading tag is created with # for each heading, i.e. from h1 to h6 the number of # increases as shown.
 #my new Heading
 ##my new Heading
 ###my new Heading
 ####my new Heading
 #####my new Heading
 ######my new Heading
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Comments

You can write comments in the following format.
<!—
This is my new comment
-->
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Horizontal rules

Horizontal rules are used to create a thematic break in between paragraphs. You can create breaks between paragraphs using any of the following methods.
  • ___: Three underscores
  • ---: Three dashes
  • ***: Three asterisks
Open the md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Body Copy

Body copy can be defined as writing text in normal format in markdown syntax, no (p) tag is used

Example


It is a way of writing your plain text in an easy to read and write format, which later gets 
converted into HTML code.
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Emphasis

Emphasis are the writing formats in markdown syntax that are used to bold, italicize or strikethrough. Let us discuss them below:

Bold

Text can be made bold using two (**) signs at either side of the texts.

Example

The newest articles from **Advance Online Publication (AOP)** and the current issue.
In this example we have to show ‘Advance Online Publication (AOP)’ word as bold.
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Italics

Use “_” (underscores) sign at either sides of the word to italicize the text.

Example

The newest articles from _Advance Online Publication_ (AOP) and the current issues.
In this example we have to italicize “Advance Online Publication” (AOP) word.
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Strikethrough

Use two "~~" (tildes) on either side of the word to strikethrough the word.

Example

The newest articles from ~~Advance Online Publication~~ (AOP) and the current issues.
In this example we have to strike “Advance Online Publication” (AOP) word.
Open the .md file in a browser as localhost/grav/mypage.. This will give you the following result:
Grav Markdown Syntax

Blockquote

To create a blockquote you must add an > sign before the sentence or word.

Example

>The newest articles from Advance Online Publication (AOP) and the current issues.
In this example we have used a > sign before the sentence.
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax Blockquote can also be used as following:
>The newest articles from Advance Online Publication (AOP) and the current issues.
>>> The newest articles from Advance Online Publication (AOP) and the current issues.
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Notices

Notices can be defined as informing or notifying about something important.
There are four types of notices, they are yellow, red, blue and green.

Yellow

You must use >>> sign before a yellow notice type that describes !Info or information.

Example

>>>Neurotransmitter-gated ion channels of the Cys-loop receptor family are essential 
mediators of fast neurotransmission throughout the nervous system and are implicated 
in many neurological disorders.

Red

Use four >>>> signs before a red notice type that describes a Warning.

Example

>>>>Neurotransmitter-gated ion channels of the Cys-loop receptor family are essential 
mediators of fast neurotransmission throughout the nervous system and are implicated 
in many neurological disorders.

Blue

Five >>>>> signs for a Blue notice type that describes a Note.

Example

>>>>>Neurotransmitter-gated ion channels of the Cys-loop receptor family are essential 
mediators of fast neurotransmission throughout the nervous system and are implicated 
in many neurological disorders.

Green:

Here six >>>>>>> signs before a Green notice type that describes a Tip.

Example

>>>>>>Neurotransmitter-gated ion channels of the Cys-loop receptor family are essential 
mediators of fast neurotransmission throughout the nervous system and are implicated 
in many neurological disorders.
Open the md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Lists

Unordered:

In an unordered list bullets are used. Use *, - , +. symbols for bullets. Use the symbol with space before any text and the bullet will be displayed.

Example

+ Bullet
+ Bullet
+ Bullet
   -Bullet
   -Bullet
   -Bullet
   *Bullet
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Ordered

Add the numbers before you list something.

Example

1. Coffee
2. Tea
3. Green Tea
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Code

Inline Code

Make inline code using (`) for using codes in markdown.

Example

In the given example '<section></section>' must be converted into code.
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Block code “fences”

Use (```) fences if you want to block multiple lines of code.

Example

```
You’re Text Here

```
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Tables

In Grav, tables are created by using pipes and dashes under the header section. Pipes must not be vertically aligned.

Example:

| Number| Points |
| ------| ----------- |
| 1     | Eve Jackson 94|
| 2  | John Doe 80 |
| 3     |Adam Johnson 67 |
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Right Aligned Text

To get the table contents at the right you must add a colon on the right side of the dashes below headings.
| Number| Points |
| ------:| -----------: |
| 1     | Eve Jackson 94|
| 2  | John Doe 80 |
| 3     |Adam Johnson 67 |
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Links

Basic Links:

Links are made with the help of ([]) square brackets and (()) parenthesis. In [] brackets you must write the content and in () write the domain name.

Example

[Follow the Given link](http://www.google.com)
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

Add a Title

Example

 [Google](https://www.gogle.com/google/ "Visit Google!")
Open the .md file in a browser as localhost/grav/mypage.. This will give you the following result:
Grav Markdown Syntax

Images

Images are similar to a link but have an exclamation point at the start of the syntax.

Example

![Nature] (/grav/images/grav-images.jpg)
Open the .md file in a browser as localhost/grav/mypage. This will give you the following result:
Grav Markdown Syntax

No comments:

Post a Comment