snachodog.github.io/_posts/2019-8-12-code-snippets.md

43 lines
738 B
Markdown
Raw Normal View History

2019-08-12 11:40:45 +00:00
---
layout: post
title: Code snippets in a blog post
categories: [HTML,Code]
---
2019-08-12 11:46:05 +00:00
This post demonstrate the use of code snippets in the theme. The code snippets are powered by [Pygments](http://pygments.org/) and the code theme that is been used in Reverie is called [Draula](https://draculatheme.com/).
2019-08-12 11:40:45 +00:00
This is a raw snippet:
```
hello world
123
This is a text snippet
```
This is a PHP snippet:
2019-08-12 11:46:05 +00:00
```php
2019-08-12 11:40:45 +00:00
<?php
2019-08-12 11:46:05 +00:00
echo 'Hello, World!';
2019-08-12 11:40:45 +00:00
?>
```
This is a JavaScript snippet:
```js
const add = (a, b) => a + b
const minus = (a, b) => a - b
console.log(add(100,200)) // 300
console.log(minus(100,200)) // -100
```
This is a Python snippet:
```python
def say_hello():
print("hello world!")
say_hello() // "hello world!"
```