mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2025-05-17 16:44:24 -04:00
Update demo
This commit is contained in:
parent
0dfff4e1ce
commit
ff475e3fd7
15 changed files with 590 additions and 556 deletions
152
content/posts/code_syntax.md
Normal file
152
content/posts/code_syntax.md
Normal file
|
@ -0,0 +1,152 @@
|
|||
---
|
||||
author: ["Aditya Telange"]
|
||||
title: "Code Syntax Guide"
|
||||
date: "2019-03-10"
|
||||
description: "Sample article showcasing basic code syntax and formatting for HTML elements."
|
||||
summary: "Sample article showcasing basic code syntax and formatting for HTML elements."
|
||||
tags: ["markdown", "syntax", "code", "gist"]
|
||||
categories: ["themes", "syntax"]
|
||||
series: ["Themes Guide"]
|
||||
ShowToc: true
|
||||
TocOpen: true
|
||||
---
|
||||
|
||||
### Inline Code
|
||||
|
||||
`This is Inline Code`
|
||||
|
||||
### Only `pre`
|
||||
|
||||
<pre>
|
||||
This is pre text
|
||||
</pre>
|
||||
|
||||
### Code block with backticks
|
||||
|
||||
```{hl_lines=[2,8]}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Example HTML5 Document</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
### Code block with backticks and language specified
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Example HTML5 Document</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
### Code block with backticks and language specified with line numbers
|
||||
|
||||
```html {linenos=true}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Example HTML5 Document</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
### Code block with line numbers and <mark>highlighted</mark> lines
|
||||
|
||||
- PaperMod supports `linenos=true` or `linenos=table`
|
||||
|
||||
```html {linenos=true,hl_lines=[2,8]}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Example HTML5 Document</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
- With `linenos=inline` line <mark>**might not** get highlighted</mark> properly.
|
||||
|
||||
```html {linenos=inline,hl_lines=[2,8]}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Example HTML5 Document</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
### Code block indented with four spaces
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
### Code block with Hugo's internal highlight shortcode
|
||||
|
||||
{{< highlight html >}}
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
{{< /highlight >}}
|
||||
|
||||
### Github Gist
|
||||
|
||||
{{< gist adityatelange 376cd56ee2c94aaa2e8b93200f2ba8b5 >}}
|
Loading…
Add table
Add a link
Reference in a new issue