포스트

Chirpy 마크다운 문법 작성 팁(그 외 블로그 명령어)

이 포스트는 Chirpy에서 제공하는 마크다운 문법을 어떻게 작성하고 렌더링되는지 정리한 글이다. 원본글은 자세한 사용방법이 따로 나와있지 않다.

Headings

H1 - heading

1
2
3
4
<!-- 사용법 -->
# H1 - heading

{: .mt-4 .mb-0 }

H2 - heading

1
2
3
4
<!-- 사용법 -->
## H2 - heading

{: data-toc-skip='' .mt-4 .mb-0 }

H3 - heading

1
2
3
4
<!-- 사용법 -->
### H3 - heading

{: data-toc-skip='' .mt-4 .mb-0 }

H4 - heading

1
2
3
4
<!-- 사용법 -->
#### H4 - heading

{: data-toc-skip='' .mt-4 }

Paragraph

Quisque egestas convallis ipsum, ut sollicitudin risus tincidunt a. Maecenas interdum malesuada egestas. Duis consectetur porta risus, sit amet vulputate urna facilisis ac. Phasellus semper dui non purus ultrices sodales. Aliquam ante lorem, ornare a feugiat ac, finibus nec mauris. Vivamus ut tristique nisi. Sed vel leo vulputate, efficitur risus non, posuere mi. Nullam tincidunt bibendum rutrum. Proin commodo ornare sapien. Vivamus interdum diam sed sapien blandit, sit amet aliquam risus mattis. Nullam arcu turpis, mollis quis laoreet at, placerat id nibh. Suspendisse venenatis eros eros.

1
2
<!-- 사용법 -->
Quisque egestas convallis ipsum, ut sollicitudin risus tincidunt a. Maecenas interdum malesuada egestas. Duis consectetur porta risus, sit amet vulputate urna facilisis ac. Phasellus semper dui non purus ultrices sodales. Aliquam ante lorem, ornare a feugiat ac, finibus nec mauris. Vivamus ut tristique nisi. Sed vel leo vulputate, efficitur risus non, posuere mi. Nullam tincidunt bibendum rutrum. Proin commodo ornare sapien. Vivamus interdum diam sed sapien blandit, sit amet aliquam risus mattis. Nullam arcu turpis, mollis quis laoreet at, placerat id nibh. Suspendisse venenatis eros eros.

Lists

Ordered list

  1. Firstly
  2. Secondly
  3. Thirdly
1
2
3
4
<!-- 사용법 -->
1. Firstly
2. Secondly
3. Thirdly

Unordered list

  • Chapter
    • Section
      • Paragraph
1
2
3
4
<!-- 사용법 -->
- Chapter
  - Section
    - Paragraph

ToDo list

  • Job
    • Step 1
    • Step 2
    • Step 3
1
2
3
4
5
<!-- 사용법 -->
- [ ] Job
  - [x] Step 1
  - [x] Step 2
  - [ ] Step 3

Description list

Sun
the star around which the earth orbits
Moon
the natural satellite of the earth, visible by reflected light from the sun
1
2
3
4
5
6
<!-- 사용법 -->
Sun
: the star around which the earth orbits

Moon
: the natural satellite of the earth, visible by reflected light from the sun

Block Quote

This line shows the block quote.

1
2
<!-- 사용법 -->
> This line shows the _block quote_.

Prompts

An example showing the tip type prompt.

1
2
3
<!-- 사용법 -->
> An example showing the `tip` type prompt.
{: .prompt-tip }

An example showing the info type prompt.

1
2
3
<!-- 사용법 -->
> An example showing the `info` type prompt.
{: .prompt-info }

An example showing the warning type prompt.

1
2
3
<!-- 사용법 -->
> An example showing the `warning` type prompt.
{: .prompt-warning }

An example showing the danger type prompt.

1
2
3
<!-- 사용법 -->
> An example showing the `danger` type prompt.
{: .prompt-danger }

Tables

CompanyContactCountry
Alfreds FutterkisteMaria AndersGermany
Island TradingHelen BennettUK
Magazzini Alimentari RiunitiGiovanni RovelliItaly
1
2
3
4
5
6
<!-- 사용법 -->
| Company                      | Contact          | Country |
| :--------------------------- | :--------------- | ------: |
| Alfreds Futterkiste          | Maria Anders     | Germany |
| Island Trading               | Helen Bennett    |      UK |
| Magazzini Alimentari Riuniti | Giovanni Rovelli |   Italy |

http://127.0.0.1:4000

1
2
<!-- 사용법 -->
<http://127.0.0.1:4000>

Footnote

Click the hook will locate the footnote1, and here is another footnote2.

1
2
<!-- 사용법 -->
Click the hook will locate the footnote[^footnote], and here is another footnote[^fn-nth-2].

Inline code

This is an example of Inline Code.

1
2
<!-- 사용법 -->
This is an example of `Inline Code`.

Filepath

Here is the /path/to/the/file.extend.

1
2
<!-- 사용법 -->
Here is the `/path/to/the/file.extend`{: .filepath}.

Code blocks

Common

1
This is a common code snippet, without syntax highlight and line number.
1
2
3
4
    <!-- 사용법 -->
    ```
    This is a common code snippet, without syntax highlight and line number.
    ```

Specific Language

1
2
3
4
if [ $? -ne 0 ]; then
  echo "The command was not successful.";
  #do the needful / exit
fi;
1
2
3
4
5
6
7
    <!-- 사용법 -->
    ```bash
    if [ $? -ne 0 ]; then
      echo "The command was not successful.";
      #do the needful / exit
    fi;
    ```

Specific filename

1
2
3
@import
  "colors/light-typography",
  "colors/dark-typography";
1
2
3
4
5
6
7
    <!-- 사용법 -->
    ```sass
    @import
      "colors/light-typography",
      "colors/dark-typography";
    ```
    {: file='_sass/jekyll-theme-chirpy.scss'}

Mathematics

The mathematics powered by MathJax:

\[\sum\_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6}\]

When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are

\(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)

1
2
3
4
5
6
<!-- 사용법 -->
$$ \sum\_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6} $$

When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are

$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$

Mermaid SVG

 gantt
  title  Adding GANTT diagram functionality to mermaid
  apple :a, 2017-07-20, 1w
  banana :crit, b, 2017-07-23, 1d
  cherry :active, c, after b a, 1d
1
2
3
4
5
6
7
8
    <!-- 사용법 -->
    ```mermaid
    gantt
      title  Adding GANTT diagram functionality to mermaid
      apple :a, 2017-07-20, 1w
      banana :crit, b, 2017-07-23, 1d
      cherry :active, c, after b a, 1d
    ```

Images

Default (with caption)

Desktop View Full screen width and center alignment

1
2
3
<!-- 사용법 -->
![Desktop View](https://chirpy-img.netlify.app/posts/20190808/mockup.png){: width="972" height="589" }
_Full screen width and center alignment_

Left aligned

Desktop View

1
2
<!-- 사용법 -->
![Desktop View](https://chirpy-img.netlify.app/posts/20190808/mockup.png){: width="972" height="589" .w-75 .normal}

Float to left

Desktop View Praesent maximus aliquam sapien. Sed vel neque in dolor pulvinar auctor. Maecenas pharetra, sem sit amet interdum posuere, tellus lacus eleifend magna, ac lobortis felis ipsum id sapien. Proin ornare rutrum metus, ac convallis diam volutpat sit amet. Phasellus volutpat, elit sit amet tincidunt mollis, felis mi scelerisque mauris, ut facilisis leo magna accumsan sapien. In rutrum vehicula nisl eget tempor. Nullam maximus ullamcorper libero non maximus. Integer ultricies velit id convallis varius. Praesent eu nisl eu urna finibus ultrices id nec ex. Mauris ac mattis quam. Fusce aliquam est nec sapien bibendum, vitae malesuada ligula condimentum.

1
2
3
<!-- 사용법 -->
![Desktop View](https://chirpy-img.netlify.app/posts/20190808/mockup.png){: width="972" height="589" .w-50 .left}
Praesent maximus aliquam sapien. Sed vel neque in dolor pulvinar auctor. Maecenas pharetra, sem sit amet interdum posuere, tellus lacus eleifend magna, ac lobortis felis ipsum id sapien. Proin ornare rutrum metus, ac convallis diam volutpat sit amet. Phasellus volutpat, elit sit amet tincidunt mollis, felis mi scelerisque mauris, ut facilisis leo magna accumsan sapien. In rutrum vehicula nisl eget tempor. Nullam maximus ullamcorper libero non maximus. Integer ultricies velit id convallis varius. Praesent eu nisl eu urna finibus ultrices id nec ex. Mauris ac mattis quam. Fusce aliquam est nec sapien bibendum, vitae malesuada ligula condimentum.

Float to right

Desktop View Praesent maximus aliquam sapien. Sed vel neque in dolor pulvinar auctor. Maecenas pharetra, sem sit amet interdum posuere, tellus lacus eleifend magna, ac lobortis felis ipsum id sapien. Proin ornare rutrum metus, ac convallis diam volutpat sit amet. Phasellus volutpat, elit sit amet tincidunt mollis, felis mi scelerisque mauris, ut facilisis leo magna accumsan sapien. In rutrum vehicula nisl eget tempor. Nullam maximus ullamcorper libero non maximus. Integer ultricies velit id convallis varius. Praesent eu nisl eu urna finibus ultrices id nec ex. Mauris ac mattis quam. Fusce aliquam est nec sapien bibendum, vitae malesuada ligula condimentum.

1
2
3
<!-- 사용법 -->
![Desktop View](https://chirpy-img.netlify.app/posts/20190808/mockup.png){: width="972" height="589" .w-50 .right}
Praesent maximus aliquam sapien. Sed vel neque in dolor pulvinar auctor. Maecenas pharetra, sem sit amet interdum posuere, tellus lacus eleifend magna, ac lobortis felis ipsum id sapien. Proin ornare rutrum metus, ac convallis diam volutpat sit amet. Phasellus volutpat, elit sit amet tincidunt mollis, felis mi scelerisque mauris, ut facilisis leo magna accumsan sapien. In rutrum vehicula nisl eget tempor. Nullam maximus ullamcorper libero non maximus. Integer ultricies velit id convallis varius. Praesent eu nisl eu urna finibus ultrices id nec ex. Mauris ac mattis quam. Fusce aliquam est nec sapien bibendum, vitae malesuada ligula condimentum.

Dark/Light mode & Shadow

The image below will toggle dark/light mode based on theme preference, notice it has shadows.

light mode only dark mode only

1
2
3
<!-- 사용법 -->
![light mode only](https://chirpy-img.netlify.app/posts/20190808/devtools-light.png){: .light .w-75 .shadow .rounded-10 w='1212' h='668' }
![dark mode only](https://chirpy-img.netlify.app/posts/20190808/devtools-dark.png){: .dark .w-75 .shadow .rounded-10 w='1212' h='668' }

Video

1
2
3
4
5
6
7
8
9
10
11
<!-- 사용법 -->
<iframe
  class="embed-video youtube"
  loading="lazy"
  src="https://www.youtube.com/embed/Balreaj8Yqs"
  title="YouTube video player"
  frameborder="0"
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
  allowfullscreen
></iframe>

Reverse Footnote

1
2
3
<!-- 사용법 -->
[^footnote]: The footnote source
[^fn-nth-2]: The 2nd footnote source

번외) 블로그 관련 명령어

로컬 블로그 서버 실행

1
bundle exec jekyll s

새로운 포스트 만들기

1
bundle exec jekyll post "제목" --timestamp-format "%Y-%m-%d %H:%M:%S %z"

위 명령어들을 alias 등록 시 추가할 script

.bash_profile 혹은 .bash_rc 에 추가

1
2
3
4
5
alias blog="bundle exec jekyll s"

post() {
        bundle exec jekyll post "$1" --timestamp-format "%Y-%m-%d %H:%M:%S %z"
}

source 이후에 blog 명령어 실행 시 블로그 로컬 서버 실행, post "제목" 명령어 실행 시 새로운 포스트 생성.


마치며

이 포스트는 Chirpy에서 제공하는 Markdown Syntax의 렌더링과 사용법을 같이 표기한 포스트이다.

공식 도큐먼트에는 렌더링 결과만 나와있기 때문에, 추가적인 사용법과 같이 작성했다.

한가지 정리하면서 배운 팁은 Markdown의 Codeblock 안에서 Codeblock을 표기할 때, backtick을 escape해줘야 하는데 escape할 codeblock 앞에 space를 4번 해주면 된다.

  1. The footnote source 

  2. The 2nd footnote source 

이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.