博文编写参考

nxdong July 02, 2022 [Blog]

收集常用模块,用于复制粘贴.

代码块

See the docs for options.

1//! jelly-actix-web-starter - A starter template for actix-web projects that feels very Django-esque. Avoid the boring stuff and move faster.
2
3use jelly::actix_web;
4use mainlib;
5use std::io;
6
7#[actix_web::main]
8async fn main() -> io::Result<()> {
9 mainlib::main().await
10}
11
12let context = Context::new();
1<!doctype html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <title>Example HTML5 Document</title>
6</head>
7<body>
8 <p>Test</p>
9</body>
10</html>

Blockquote no attribution

Tiam, ad mint andaepu dandae nostion secatur sequo quae. Note that you can use Markdown syntax within a blockquote.

Blockquote with attribution

Don't communicate by sharing memory, share memory by communicating.
Rob Pike1

All men by nature desire to know.
Aristotle2

Power comes in response to a need, not a desire.
Goku

Tables

Tables aren't part of the core Markdown spec, but Zola supports them out-of-the-box.

NameAge
Alice23
Bob27
Cody33
John59
Kerry23

Table with Inline Markdown

ItalicsBoldCodeStrikeThrough
italicsboldcodestrikethrough

Large table within figure tag

Surround very Large tables with <figure></figure> so they can scroll horizontally.

ManufacturerVolkswagenToyotaFordHondaChevroletBMWHyundaiAudiNissanKiaMercedesTeslaMitsubishiSuzukiVolvoSubaruMazdaJaguarBuickLexusGMCPorscheCadillac
Revenue $B$254$249$127$124$123$113$88$83$74$61$55$54$38$31$30$28$27$22$21$19$17$16$12
*revenue values found on search engine and not verified, for figure scroller table demonstration purposes only.*

Foldable Text

Title 1

IT'S A SECRET TO EVERYBODY.

Title 2

Stay awhile, and listen!

Other Elements — abbr, sub, sup, kbd, mark, link

GIF is a bitmap image format.

H2O

Xn + Yn = Zn

Press CTRL+ALT+Delete to end the session.

Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures.


1

The above quote is excerpted from Rob Pike's talk during Gopherfest, November 18, 2015.

2

The quote is the first sentence of Aristotle's Metaphysics.

Site primary menu is created by nesting the nav under a header tag. Refer to the top of this site for an example.

If the nav tag is under the main tag instead of the header tag then the links will have a border:

Forms


Size

Math Usage

Wrap any valid $\KaTeX$ syntax with $...$ for inline Mathematics and $$...$$ for block Mathematics.

Inline Mathematics

This is the most beautiful equation I've ever seen:

Usage

{% katex(block=false) %} e^{i\pi}+1=0 {% end %}

Output

<script type="math/tex">e^{i\pi}+1=0</script>

Block Mathematics

Some Mathematics in display mode is fair enough:

Usage

{% katex(block=true) %} \int_0^1 x^2 dx {% end %}

Output

<script type="math/tex;mode=display">\int_0^1 x^2 dx</script>

Auto Render Inline Example

$ e^{i\pi}+1=0 $

$ e^{i\pi}+1=0 $

Auto Render Block Example

$$
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
$$

$$ f(x) = \int_{-\infty}^\infty\hat f(\xi),e^{2 \pi i \xi x},d\xi $$