🗓️ 2021-02-15 🏷️ #markdown

Github repo

KSimple

Ksimple 是在 hugo-xminhugo-admonitions 基础上稍作修改的一个 hugo 主题。比较简单,可能更适合个人使用,因此没有单独发布的打算。

基本语法展示

BoldItalicHighlightDelete,⛺,😘, Inline Code, \(x^2 + y^2 = 1\),

Reference1, Reference22


this is a blockquote

$${\sqrt {n}}\left(\left({\frac {1}{n}}\sum _{i=1}^{n}X_{i}\right)-\mu \right)\ {\xrightarrow {d}}\ N\left(0,\sigma ^{2}\right)$$
#include<iostream>
using namespace std;
int main(){
    cout<<"hello hugo\n";
    return 0;
}
- hallo
+ hello
  1. item

图片排版

借用超链接实现浮动

[<<img src="xxx" alt="" style="max-width: 50%; float:right;">>]()

效果看上面那个 github 头像即可

div flex

<div style="display: flex; gap: 2px; justify-content: center">
    <img src="aaa" alt="" style="max-width: 50%;">
    <img src="bbb" alt="" style="max-width: 50%;">
</div>
cppzh cpp

TODO: 定制 Shotcode

PlantUML 代码块自动渲染

类图

@startuml
interface Scriptable{
    toSmtLib():String
}

class SmtScript{
    -functions:List<Function>
    -addFunction(Function):void
}

abstract class Expr{
    -node:ASTRootNode
    -children:List<Expr>
}

enum ConstExpr
class CompoundExpr{
    +getOp():String
}
struct ComplexExpr{
    -format:String
}

class Function{
    - funcName:string
    - args:List<Pair<String,String>>
    - returnType:String
    - funcBody:Expr
}

Scriptable <|.. SmtScript
Scriptable <|.. Function
Scriptable <|.. Expr
Expr <|-- ConstExpr
Expr <|-- CompoundExpr
Expr <|-- ComplexExpr

Expr <-- Function

SmtScript "1"-->"1..*" Function
@enduml

活动图

@startuml
actor 用户 as user
participant PtolemyII as ptii
participant 验证选项配置器 as config
participant 模型解与预校验器 as parser
participant 形式化验证器 as verifier

user -> ptii++: 打开PtolemyII建模工具
ptii->ptii: 打开/创建模型
return 模型持久化XML文件

user -> config++: 配置验证选项,启动验证过程
config -> parser--++: 解析与校验模型

alt 校验失败
    parser --> user: 返回校验错误信息
else 校验通过
    parser -> verifier--++: 启动形式化验证
    verifier -->user--: 返回验证结果
end

@enduml

ebnf

@startebnf
Type = PrimitiveType | ReferenceType;
PrimitiveType = [Annotation], (NumericType | boolean );
@endebnf

……

目录

暂时不打算给博客添加目录

Tip

可以考虑使用浏览器插件OneToc,有快捷键 Toggle 的功能,效果已经非常不错了。


版权声明

以下 callout 块相关的内容(包括本博客的实现)全部来自具有MIT开源协议的hugo-admonitions主题,详情请参考原主题!

Callout 块展示

Nosupport

Helpful advice for doing things better or more easily.

GitHub Test

Note

Useful information that users should know, even when skimming content.

Tip

Helpful advice for doing things better or more easily.

Important

Key information users need to know to achieve their goal.

Warning

Urgent info that needs immediate user attention to avoid problems.

Caution

Advises about risks or negative outcomes of certain actions.

Callout Overview

Abstract

Abstract: This paper discusses the advantages and challenges of microservice architecture.

Caution

Advises about risks or negative outcomes of certain actions.

Code

Code snippet:

function fetchData() {
  return axios.get("/api/data");
}
Conclusion

Conclusion: Based on the analysis above, we’ve decided to implement Docker containerization.

Danger

Danger! Critical security vulnerability detected in the system. Immediate action required.

Error

Error: Unable to connect to database. Please check your connection settings.

Example

Example:

def hello_world():
    print("Hello, World!")
Experiment

Experiment: Testing the impact of new caching strategies on system performance.

Goal

Goal: Reduce service response time by 30% by the end of this quarter.

Idea

Idea: Implement a machine learning-based code quality detection system.

Important

Key information users need to know to achieve their goal.

Info

System status: All services are operating normally. Current uptime: 99.99%.

Memo

Memo: Technical review meeting scheduled for next Tuesday at 2:00 PM.

Note

Useful information that users should know, even when skimming content.

Notification

System notification: Your password will expire in 30 days.

Question

Question: How can we optimize database query performance?

Quote

“Code is like humor. When you have to explain it, it’s bad.” - Cory House

Success

Congratulations! Your code has been successfully deployed to production.

Task

To-do list:

  • Update documentation
  • Deploy new version
Tip

Helpful advice for doing things better or more easily.

Warning

Urgent info that needs immediate user attention to avoid problems.

Customization

Choose a callout you prefer and add a title

Summary

This is a summary using the TIP callout!

Summary

This is a summary using the IDEA callout!

Header Only Mode

You can choose to only to show the header!

This paper discusses the advantages of microservice architecture
Ensure all tests pass before merging to main branch
Execute npm install to install all dependencies
We’ve decided to implement Docker containerization
Critical security vulnerability detected in the system
Error: Unable to connect to database. Please check your connection settings
Git commit message format: “feat: add user authentication”
Testing new caching strategy with Redis
Reduce service response time by 30% by the end of this quarter
Implement a machine learning-based code quality detection system
Please review and update your security settings
Current system status: All services are operating normally with 99.9% uptime
Technical review meeting scheduled for next Tuesday at 2:00 PM
Always backup your data before performing system updates
System notification: Your password will expire in 30 days
How can we optimize database query performance?
“Code is like humor. When you have to explain it, it’s bad.” - Cory House
Congratulations! Your code has been successfully deployed to production
Review and update API documentation by Friday
Use Ctrl + C to quickly terminate a running program
Warning: This operation will delete all data

  1. This is the first reference。Alought it placed at the middle of markdown source, it will be move to the end of the html. ↩︎

  2. And this is the second one ↩︎