diff --git a/docs/awk.html b/docs/awk.html index 972d518d..2fb0040c 100644 --- a/docs/awk.html +++ b/docs/awk.html @@ -40,7 +40,7 @@

这是 GNU awk 的单页快速参考备忘单,其中涵盖了常用的 awk 表达式和命令。

入门

试试

该程序可用于选择文件中的特定记录并对其执行操作

$ awk -F: '{print $1, $NF}' /etc/passwd
@@ -94,14 +94,14 @@
    ...
 END            {< 最后的动作 >}
 
-

示例

+

示例

awk '
     BEGIN { print "\n>>>Start" }
     !/(login|shutdown)/ { print NR, $0 }
     END { print "<<<END\n" }
 ' /etc/passwd
 
-

变量

+

变量

          $1      $2/$(NF-1)    $3/$NF
            ▼          ▼           ▼ 
@@ -124,7 +124,7 @@
 awk -F: '{print $1 "=" $6}' /etc/passwd
 

查看: Awk 变量

-

awk 程序示例

+

Awk 程序示例

awk 'BEGIN {print "hello world"}'        # 打印 "hello world"
 awk -F: '{print $1}' /etc/passwd         # -F: 指定字段分隔符
@@ -214,7 +214,8 @@
 
 
 
:-:-
$0全线
$1, $2...$NF第一个,第二个……最后一个字段
NR记录总数(Number of Records)
NFN个字段(Nnumber of Fields)
OFSOutput Field Separator
输出字段分隔符 (default " ")
FSinput Field Separator
输入字段分隔符 (default " ")
ORSOutput Record Separator
输出记录分隔符 (default "\n")
RSinput Record Separator
输入记录分隔符 (default "\n")
FILENAME文件名
-

表达式

+

表达式

+ @@ -285,7 +286,8 @@
:-:-
$1 == "root"第一个字段等于根
{print $(NF-1)}倒数第二个字段
NR!=1{print $0}从第 2 条记录开始
NR > 3从第 4 条记录开始
NR == 1第一次记录
END{print NR}总记录
BEGIN{print OFMT}输出格式
{print NR, $0}行号
{print NR " " $0}行号(选项卡)
{$1 = NR; print}用行号替换第一个字段
$NF > 4最后一个字段 > 4
NR % 2 == 0甚至记录
NR==10, NR==20记录 10 到 20
BEGIN{print ARGC}arguments
ORS=NR%5?",":"\n"连接记录
-

示例

+

示例

+

打印总和和平均值

awk -F: '{sum += $3}
      END { print sum, sum/NR }
@@ -310,6 +312,37 @@
     if (match("One Two Three", "re"))
         print RLENGTH }'
 
+

仅限 GNU awk

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:-:-
ENVIRON环境变量
IGNORECASE忽略大小写
CONVFMT转换格式
ERRNO系统错误
FIELDWIDTHS固定宽度字段

环境变量

@@ -353,47 +386,16 @@
:-:-
ARGC数字或参数
ARGV参数数组
FNR文件记录数(File Number of Records)
OFMT数字格式 (default "%.6g")
RSTART字符串中的位置
RLENGTH比赛时长
SUBSEP多维数组分隔符 (default "\034")
ARGIND参数索引
-

仅限 GNU awk

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:-:-
ENVIRON环境变量
IGNORECASE忽略大小写
CONVFMT转换格式
ERRNO系统错误
FIELDWIDTHS固定宽度字段

定义变量

awk -v var1="Hello" -v var2="Wold" '
     END {print var1, var2}
 ' </dev/null
 
-

使用 shell 变量

+

使用 shell 变量

awk -v varName="$PWD" '
     END {print varName}' </dev/null
 
-

Awk 运算符

+

Awk 运算符

运算符

@@ -421,7 +423,7 @@
:-:-
{print $1}第一个字段
$2 == "foo"等于
$2 != "foo"不等于
"foo" in array在数组中
-

正则表达式

+

正则表达式

@@ -448,7 +450,7 @@
:-:-
/regex/行匹配
!/regex/行不匹配
$1 ~ /regex/字段匹配
$1 !~ /regex/字段不匹配
-

更多条件

+

更多条件

@@ -467,8 +469,8 @@
:-:-
($2 <= 4 || $3 < 20)或者
($1 == 4 && $3 < 20)
-

运算符

-

算术运算

+

运算符

+

算术运算

  • +
  • -
  • @@ -479,7 +481,7 @@
  • --
-

速记作业

+

速记作业

  • +=
  • -=
  • @@ -488,7 +490,7 @@
  • %=
-

比较运算符

+

比较运算符

  • ==
  • !=
  • @@ -498,19 +500,19 @@
  • >=
-

示例

+

示例

awk 'BEGIN {
     if ("foo" ~ "^fo+$")
         print "Fooey!";
 }'
 
-

不匹配

+

不匹配

awk 'BEGIN {
     if ("boo" !~ "^fo+$")
         print "Boo!";
 }'
 
-

如果在数组中

+

如果在数组中

awk 'BEGIN {
     assoc["foo"] = "bar";
     assoc["bar"] = "baz";
@@ -518,7 +520,7 @@
         print "Fooey!";
 }'
 
-

Awk 函数

+

Awk 函数

常用功能

@@ -678,12 +680,12 @@ print "Huh?"; }' -

三元运算符

+

三元运算符

awk -v count=2 'BEGIN {
     print (count==1) ? "Yes" : "Huh?";
 }'
 
-

存在

+

存在

awk 'BEGIN {
     assoc["foo"] = "bar";
     assoc["bar"] = "baz";
@@ -691,7 +693,7 @@
         print "Fooey!";
 }'
 
-

不存在

+

不存在

awk 'BEGIN {
     assoc["foo"] = "bar";
     assoc["bar"] = "baz";
@@ -699,7 +701,7 @@
         print "Huh!";
 }'
 
-

switch

+

switch

awk -F: '{
     switch (NR * 2 + 1) {
         case 3:
@@ -722,13 +724,13 @@
         print "i=" i;
 }'
 
-

1 到 100 之间的 2 的幂

+

1 到 100 之间的 2 的幂

awk 'BEGIN {
     for (i = 1; i <= 100; i *= 2)
         print i
 }'
 
-

for...in

+

for...in

awk 'BEGIN {
     assoc["key1"] = "val1"
     assoc["key2"] = "val2"
@@ -736,15 +738,15 @@
         print assoc[key];
 }'
 
-

Arguments

+

Arguments

awk 'BEGIN {
     for (argnum in ARGV)
         print ARGV[argnum];
 }' a b c
 
-

示例

+

示例

-

反向记录

+

反向记录

awk -F: '{ x[NR] = $0 }
     END {
         for (i = NR; i > 0; i--)
@@ -752,14 +754,14 @@
     }
 ' /etc/passwd
 
-

反向字段

+

反向字段

awk -F: '{
     for (i = NF; i > 0; i--)
         printf("%s ",$i);
     print ""
 }' /etc/passwd
 
-

按记录求和

+

按记录求和

awk -F: '{
     s=0;
     for (i = 1; i <= NF; i++)
@@ -767,7 +769,7 @@
     print s
 }' /etc/passwd
 
-

总结整个文件

+

总结整个文件

awk -F: '
     {for (i = 1; i <= NF; i++)
         s += $i;
@@ -775,7 +777,7 @@
     END{print s}
 ' /etc/passwd
 
-

while

+

while

awk 'BEGIN {
     while (a < 10) {
@@ -784,7 +786,7 @@
     }
 }'
 
-

do...while

+

do...while

awk '{
     i = 1
     do {
@@ -793,7 +795,7 @@
     } while (i <= 5)
 }' /etc/passwd
 
-

Break

+

Break

awk 'BEGIN {
     break_num = 5
     for (i = 0; i < 10; i++) {
@@ -815,15 +817,15 @@
 

Awk 格式化打印

用法

-

右对齐

+

右对齐

awk 'BEGIN{printf "|%10s|\n", "hello"}'
 # |     hello|
 
-

左对齐

+

左对齐

awk 'BEGIN{printf "|%-10s|\n", "hello"}'
 # |hello     |
 
-

通用说明符

+

通用说明符

diff --git a/docs/bash.html b/docs/bash.html index 7cb15db5..1be5d221 100644 --- a/docs/bash.html +++ b/docs/bash.html @@ -216,7 +216,7 @@
代码描述
${FOO%suffix}删除后缀
${FOO#prefix}删除前缀
${FOO%%suffix}去掉长后缀
${FOO##prefix}删除长前缀
${FOO/from/to}替换第一个匹配项
${FOO//from/to}全部替换
${FOO/%from/to}替换后缀
${FOO/#from/to}替换前缀
-

子字符串

+

子字符串

@@ -235,7 +235,7 @@
表示描述
${FOO:0:3}子串 (位置,长度)
${FOO:(-3):3}从右边开始的子串
-

Length

+

Length

@@ -250,7 +250,7 @@
表示描述
${#FOO}$FOO 的长度
-

默认值

+

默认值

@@ -277,7 +277,7 @@
表示描述
${FOO:-val}$FOO,如果未设置,则为 val
${FOO:=val}如果未设置,则将 $FOO 设置为 val
${FOO:+val}val 如果设置了$FOO
${FOO:?message}如果 $FOO 未设置,则显示消息并退出
-

替代 Substitution

+

替代 Substitution

echo ${food:-Cake}  #=> $food or "Cake"
 
STR="/path/to/foo.cpp"
@@ -397,12 +397,12 @@
     echo $e
 done
 
-

With index

+

With index

for i in "${!Fruits[@]}"; do
   printf "%s\t%s\n" "$i" "${Fruits[$i]}"
 done
 
-

操作

+

操作

Fruits=("${Fruits[@]}" "Watermelon")         # 推
 Fruits+=('Watermelon')                       # 也推
@@ -545,7 +545,7 @@
 
条件描述
[[ -z STR ]]空字符串
[[ -n STR ]]空字符串
[[ STR == STR ]]平等的
[[ STR = STR ]]相等(同上)
[[ STR < STR ]]小于 (ASCII)
[[ STR > STR ]]大于 (ASCII)
[[ STR != STR ]]不相等
[[ STR =~ STR ]]正则表达式

例子

-

字符串

+

字符串

if [[ -z "$string" ]]; then
     echo "String is empty"
 elif [[ -n "$string" ]]; then
@@ -554,32 +554,32 @@
     echo "This never happens"
 fi
 
-

组合

+

组合

if [[ X && Y ]]; then
     ...
 fi
 
-

相等

+

相等

if [[ "$A" == "$B" ]]; then
     ...
 fi
 
-

正则表达式

+

正则表达式

if [[ '1. abc' =~ ([a-z]+) ]]; then
     echo ${BASH_REMATCH[1]}
 fi
 
-

更小

+

更小

if (( $a < $b )); then
    echo "$a is smaller than $b"
 fi
 
-

存在

+

存在

if [[ -e "file.txt" ]]; then
     echo "file exists"
 fi
 
-

文件条件

+

文件条件

@@ -687,12 +687,12 @@ echo "Welcome $i" done -

具有步长

+

具有步长

for i in {5..50..5}; do
     echo "Welcome $i"
 done
 
-

自动递增

+

自动递增

i=1
 while [[ $i -lt 4 ]]; do
     echo "Number: $i"
diff --git a/docs/c.html b/docs/c.html
index cde324e9..040da292 100644
--- a/docs/c.html
+++ b/docs/c.html
@@ -978,7 +978,7 @@
 
描述
__DATE__当前日期,一个以 "MMM DD YYYY" 格式表示的字符常量
__TIME__当前时间,一个以 "HH:MM:SS" 格式表示的字符常量
__FILE__这会包含当前文件名,一个字符串常量
__LINE__这会包含当前行号,一个十进制常量
__STDC__当编译器以 ANSI 标准编译时,则定义为 1

ANSI C 定义了许多宏,您可以使用这些宏,但是不能直接修改这些预定义的宏

-

预定义宏示例

+

预定义宏示例

#include <stdio.h>
 
 int main() {
@@ -989,7 +989,7 @@
   printf("ANSI :%d\n", __STDC__);
 }
 
-

宏延续运算符(\)

+

宏延续运算符(\)

一个宏通常写在一个单行上。

#define  message_for(a, b)  \
     printf(#a " 和 " #b ": 我们爱你!\n")
diff --git a/docs/chmod.html b/docs/chmod.html
index c05a0757..6e432584 100644
--- a/docs/chmod.html
+++ b/docs/chmod.html
@@ -42,17 +42,17 @@
 

语法

$ chmod [options] <permissions> <file> 
 
-

示例

+

示例

$ chmod 755 foo.txt
 $ chmod +x quickref.py
 $ chmod u-x quickref.py
 $ chmod u=rwx,g=rx,o= quickref.sh
 
-

递归更改文件和目录

+

递归更改文件和目录

$ chmod -R 755 my_directory
 

chmod 命令代表“更改模式”

-

Chmod 生成器

+

Chmod 生成器

权限:
@@ -152,7 +152,7 @@ -rw-r--r-- 1 root root 3 Jun 29 15:35 a.log drwxr-xr-x 2 root root 2 Jun 30 18:06 dir
-

dir 的权限分析

+

dir 的权限分析

d  rwx  r-x  r-x
 ┬  ─┬─  ─┬─  ─┬─  
 ┆   ┆    ┆    ┆  
@@ -161,7 +161,7 @@
 ┆   ╰─────────── 2. User |7 (4+2+1)
 ╰─────────────── 1. File Type | directory
 
-

权限模式

+

权限模式

diff --git a/docs/css.html b/docs/css.html index e55d0a21..7e458d94 100644 --- a/docs/css.html +++ b/docs/css.html @@ -45,7 +45,7 @@

介绍

CSS 功能丰富,不仅仅是布局页面

-

外部样式表

+

外部样式表

<link
   href="./path/to/stylesheet/style.css"
   rel="stylesheet"
@@ -53,14 +53,14 @@
 >
 
-

内部样式表

+

内部样式表

<style>
   body {
     background-color: linen;
   }
 </style>
 
-

内联样式

+

内联样式

<h2 style="text-align: center;">
   居中文本
 </h2>
@@ -69,7 +69,7 @@
 </p>
 
-

添加 class 类

+

添加 class 类

<div class="classname"></div>
 <div class="class1 ... classn"></div>
 
@@ -164,34 +164,34 @@

CSS 选择器

示例

-

组选择器

+

组选择器

h1, h2 {
     color: red;
 }
 
-

链选择器

+

链选择器

h3.section-heading {
     color: blue;
 }
 
-

属性选择器

+

属性选择器

div[attribute="SomeValue"] {
     background-color: red;
 }
 
-

第一个子选择器

+

第一个子选择器

p:first-child {
     font-weight: bold;
 }
 
-

无子选择器

+

无子选择器

.box:empty {
   background: lime;
   height: 80px;
   width: 80px;
 }
 
-

基础

+

基础

@@ -1173,12 +1173,12 @@
  • grid-row: grid-row-start / grid-row-end;
-

实例

+

实例

.item {
   grid-row: 1 / span 2;
 }
 
-

CSS 块级网格

+

CSS 块级网格

#grid-container {
     display: block;
 }
@@ -1212,11 +1212,11 @@
 
  • grid-row-start: auto|row-line;
  • grid-row-end: auto|row-line|span n;
  • -

    实例

    +

    实例

    grid-row-start: 2;
     grid-row-end: span 2;
     
    -

    对齐项目

    +

    对齐项目

    #container {
       display: grid;
       justify-items: center;
    diff --git a/docs/curl.html b/docs/curl.html
    index 13085528..0a2a8d0a 100644
    --- a/docs/curl.html
    +++ b/docs/curl.html
    @@ -98,10 +98,10 @@
         --cert-type       # der/pem/eng
     -k, --insecure        # 对于自签名证书
     
    -

    安装

    +

    安装

    apk add --update curl  # alpine linux 中安装
     
    -

    示例

    +

    示例

    CURL GET/HEAD

    diff --git a/docs/docker.html b/docs/docker.html index e9d46d27..1f0b96c4 100644 --- a/docs/docker.html +++ b/docs/docker.html @@ -229,10 +229,10 @@ -v, --volume `pwd`:/app # mount(需要绝对路径) -e, --env NAME=hello # 环境变量 env vars -

    实例

    +

    实例

    $ docker create --name my_redis --expose 6379 redis:3.0.2
     
    -

    操控

    +

    操控

    重命名容器

    docker rename my-nginx nginx-server
     
    diff --git a/docs/electron.html b/docs/electron.html index ae9fb381..cb299e05 100644 --- a/docs/electron.html +++ b/docs/electron.html @@ -47,7 +47,7 @@

    快速开始

    Electron 是一个使用 JavaScript、HTML 和 CSS 构建桌面应用程序的框架

    -

    创建你的应用程序

    +

    创建你的应用程序

    • 安装
      mkdir my-app && cd my-app
      @@ -114,7 +114,7 @@
       
    -

    关闭所有窗口时退出应用

    +

    关闭所有窗口时退出应用

    app.on('window-all-closed', () => {
       if (process.platform !== 'darwin') {
         app.quit()
    diff --git a/docs/emmet.html b/docs/emmet.html
    index 26e430a7..16532423 100644
    --- a/docs/emmet.html
    +++ b/docs/emmet.html
    @@ -2939,13 +2939,13 @@ Alias of command

    :-:-
    !!important
    -

    @f

    +

    @f

    @font-face {
         font-family:;
         src:url(|);
     }
     
    -

    @f+

    +

    @f+

    @font-face {
         font-family: 'FontName';
         src: url('FileName.eot');
    @@ -2957,10 +2957,10 @@ Alias of command

    font-weight: normal; }
    -

    @i, @import

    +

    @i, @import

    @import url();
     
    -

    @kf

    +

    @kf

    @-webkit-keyframes identifier {
         from {  }
         to {  }
    @@ -2978,12 +2978,12 @@ Alias of command

    to { } }
    -

    @m, @media

    +

    @m, @media

    @media screen {
         
     }
     
    -

    transform

    +

    常用

    块范围

    -

    Let

    +

    Let

    function fn () {
       let x = 0
       if (true) {
    @@ -51,17 +51,17 @@
       }
     }
     
    -

    Const

    +

    Const

    const a = 1
     

    let 是新的 var。 常量(const) 就像 let 一样工作,但不能重新分配。 请参阅:Let 和 const

    -

    反引号字符串

    +

    反引号字符串

    -

    插值

    +

    插值

    const message = `Hello ${name}`
     
    -

    多行字符串

    +

    多行字符串

    const str = `
     hello
     world
    @@ -69,7 +69,7 @@
     

    模板和多行字符串。 请参阅:模板字符串

    -

    二进制和八进制文字

    +

    二进制和八进制文字

    let bin = 0b1010010
     let oct = 0o755
     
    @@ -79,7 +79,7 @@ // 同: Math.pow(2, 8)

    新方法

    -

    新的字符串方法

    +

    新的字符串方法

    "hello".repeat(3)
     "hello".includes("ll")
     "hello".startsWith("he")
    @@ -88,42 +88,42 @@
     "hello".padEnd(8, '!') // hello!!!
     "\u1E9B\u0323".normalize("NFC")
     
    -

    新的数字方法

    +

    新的数字方法

    Number.EPSILON
     Number.isInteger(Infinity) // false
     Number.isNaN("NaN") // false
     
    -

    新的 Math 方法

    +

    新的 Math 方法

    Math.acosh(3) // 1.762747174039086
     Math.hypot(3, 4) // 5
     Math.imul(Math.pow(2, 32) - 1, Math.pow(2, 32) - 2) // 2
     
    -

    新的 Array 方法

    +

    新的 Array 方法

    // 返回一个真实的数组
     Array.from(document.querySelectorAll("*"))
     // 类似于 new Array(...),但没有特殊的单参数行为
     Array.of(1, 2, 3)
     

    请参阅: 新方法

    -

    +

    class Circle extends Shape {
     
    -

    构造函数

    +

    构造函数

      constructor (radius) {
         this.radius = radius
       }
     
    -

    方法

    +

    方法

      getArea () {
         return Math.PI * 2 * this.radius
       }
     
    -

    调用超类方法

    +

    调用超类方法

      expand (n) {
         return super.expand(n) * Math.PI
       }
     
    -

    静态方法

    +

    静态方法

      static createFromDiameter(diameter) {
         return new Circle(diameter / 2)
       }
    @@ -131,7 +131,7 @@
     

    原型的语法糖。 请参阅:

    -

    Promises

    +

    Promises

    做出承诺

    new Promise((resolve, reject) => {
       if (ok) { resolve(result) }
    @@ -171,10 +171,10 @@
     请参阅:异步函数

    解构 Destructuring

    解构赋值

    -

    Arrays

    +

    Arrays

    const [first, last] = ['Nikola', 'Tesla']
     
    -

    Objects

    +

    Objects

    let {title, author} = {
       title: 'The Silkworm',
       author: 'R. Galbraith'
    @@ -182,7 +182,7 @@
     

    支持匹配数组和对象。 请参阅:解构

    -

    默认值

    +

    默认值

    const scores = [22, 33]
     const [math = 50, sci = 50, arts = 50] = scores
     
    @@ -230,67 +230,67 @@

    使用 rest(...) 运算符单独提取一些键和对象中的剩余键

    扩展运算符 Spread

    对象扩展

    -

    与对象扩展

    +

    与对象扩展

    const options = {
       ...defaults,
       visible: true
     }
     
    -

    没有对象扩展

    +

    没有对象扩展

    const options = Object.assign(
       {}, defaults,
       { visible: true })
     

    对象扩展运算符允许您从其他对象构建新对象。 请参阅:对象传播

    -

    数组扩展

    -

    具有数组扩展

    +

    数组扩展

    +

    具有数组扩展

    const users = [
       ...admins,
       ...editors,
       'rstacruz'
     ]
     
    -

    没有数组扩展

    +

    没有数组扩展

    const users = admins
       .concat(editors)
       .concat([ 'rstacruz' ])
     

    扩展运算符允许您以相同的方式构建新数组。 请参阅:扩展运算符

    -

    函数 Functions

    +

    函数 Functions

    函数参数

    -

    默认参数

    +

    默认参数

    function greet (name = 'Jerry') {
       return `Hello ${name}`
     }
     
    -

    Rest 参数

    +

    Rest 参数

    function fn(x, ...y) {
       // y 是一个数组
       return x * y.length
     }
     
    -

    扩展

    +

    扩展

    fn(...[1, 2, 3])
     // 与 fn(1, 2, 3) 相同
     

    Default(默认), rest, spread(扩展)。 请参阅:函数参数

    -

    箭头函数

    +

    箭头函数

    -

    箭头函数

    +

    箭头函数

    setTimeout(() => {
       ···
     })
     
    -

    带参数

    +

    带参数

    readFile('text.txt', (err, data) => {
       ...
     })
     
    -

    隐式返回

    +

    隐式返回

    arr.map(n => n*2)
     // 没有花括号 = 隐式返回
     // 同: arr.map(function (n) { return n*2 })
    @@ -301,7 +301,7 @@
     

    类似函数,但保留了 this。 请参阅:箭头函数

    -

    参数设置默认值

    +

    参数设置默认值

    function log(x, y = 'World') {
       console.log(x, y);
     }
    diff --git a/docs/expressjs.html b/docs/expressjs.html
    index 55c0d3c8..075464bd 100644
    --- a/docs/expressjs.html
    +++ b/docs/expressjs.html
    @@ -167,7 +167,7 @@
     console.dir(app.locals.email)
     // => 'me@myapp.com'
     
    -

    属性

    +

    属性

    @@ -186,7 +186,7 @@
    :-:-
    app.locals应用程序中的局部变量 #
    app.mountpath安装子应用程序的路径模式 #
    -

    Events

    +

    Events

    @@ -201,7 +201,7 @@
    :-:-
    mount子应用挂载到父应用上,子应用上触发事件 #
    -

    方法

    +

    方法

    @@ -288,8 +288,8 @@
    :-:-
    app.all()#
    app.delete()#
    app.disable()#
    app.disabled()#
    app.enable()#
    app.enabled()#
    app.engine()#
    app.get(name)#
    app.get(path, callback)#
    app.listen()#
    app.METHOD()#
    app.param()#
    app.path()#
    app.post()#
    app.put()#
    app.render()#
    app.route()#
    app.set()#
    app.use()#
    -

    Request

    -

    属性

    +

    Request

    +

    属性

    @@ -380,7 +380,7 @@
    :-:-
    req.app#
    req.baseUrl#
    req.body#
    req.cookies#
    req.fresh#
    req.hostname#
    req.ip#
    req.ips#
    req.method#
    req.originalUrl#
    req.params#
    req.path#
    req.protocol#
    req.query#
    req.route#
    req.secure#
    req.signedCookies#
    req.stale#
    req.subdomains#
    req.xhr#
    -

    方法

    +

    方法

    @@ -423,14 +423,14 @@
    :-:-
    req.accepts()#
    req.acceptsCharsets()#
    req.acceptsEncodings()#
    req.acceptsLanguages()#
    req.get()获取HTTP 请求头字段 #
    req.is()#
    req.param()#
    req.range()#
    -

    Response

    +

    Response

    app.get('/', function (req, res) {
       console.dir(res.headersSent) // false
       res.send('OK')
       console.dir(res.headersSent) // true
     })
     
    -

    属性

    +

    属性

    @@ -453,7 +453,7 @@
    :-:-
    res.app #
    res.headersSent#
    res.locals#
    -

    方法

    +

    方法

    @@ -548,7 +548,7 @@
    :-:-
    res.append()#
    res.attachment()#
    res.cookie()#
    res.clearCookie()#
    res.download()提示要下载的文件 #
    res.end()结束响应过程 #
    res.format()#
    res.get()#
    res.json()发送 JSON 响应 #
    res.jsonp()发送带有 JSONP 支持的响应 #
    res.links()#
    res.location()#
    res.redirect()重定向请求 #
    res.render()渲染视图模板 #
    res.send()发送各种类型的响应 #
    res.sendFile()将文件作为八位字节流发送 #
    res.sendStatus()#
    res.set()#
    res.status()#
    res.type()#
    res.vary()#
    -

    示例

    +

    示例

    Router

    为传递给此路由器的任何请求调用

    diff --git a/docs/find.html b/docs/find.html index 96d2b3b2..752c93eb 100644 --- a/docs/find.html +++ b/docs/find.html @@ -290,7 +290,7 @@
    OptionDescription
    atime访问时间(上次文件打开
    mtime修改时间(上次文件内容被修改
    ctime更改时间(上次文件 inode 已更改
    -

    示例

    +

    示例

    @@ -349,7 +349,7 @@
    OptionDescription
    -mtime +024 小时前修改
    -mtime 0从现在到 1 天前修改
    -mtime -1不到 1 天前修改(与 -mtime 0 相同)
    -mtime 124 至 48 小时前修改
    -mtime +1超过 48 小时前修改
    -mtime +1w上次修改时间超过 1 周前
    -atime 0从现在到 24 小时前最后一次访问
    -atime +0访问时间超过 24 小时
    -atime 1在 24 至 48 小时前访问
    -atime +1访问时间超过 48 小时
    -atime -1不到 24 小时前访问过(与 -atime 0 相同)
    -ctime -6h30m文件状态在过去 6 小时 30 分钟内发生变化
    -

    更多示例

    +

    更多示例

    查找最近 50 天修改的文件

    $ find / -mtime 50
     
    diff --git a/docs/github-actions.html b/docs/github-actions.html index 46cac18d..975bd7e5 100644 --- a/docs/github-actions.html +++ b/docs/github-actions.html @@ -232,14 +232,14 @@ name: production_environment url: https://github.com
    -

    自定义环境变量

    +

    自定义环境变量

    GitHub 会保留 GITHUB_ 环境变量前缀供 GitHub 内部使用。设置有 GITHUB_ 前缀的环境变量或密码将导致错误。

    - name: 测试 nodejs 获取环境变量
       env:
         API_TOKEN: ${{ secrets.API_TOKEN }}
     

    https://github.com/<用户名>/<项目名称>/settings/secrets 中添加 secrets API_TOKEN,在工作流中设置环境变量 API_TOKEN

    -

    表达式

    +

    表达式

    if 条件下使用表达式时,可以省略表达式语法 (${{ }}),因为 GitHub 会自动将 if 条件作为表达式求值

    steps:
       - uses: actions/hello-world-action@v1.1
    @@ -250,7 +250,7 @@
     
    env:
       MY_ENV_VAR: ${{ <expression> }}
     
    -

    操作符

    +

    操作符

    • ( ) (逻辑分组)
    • [ ] (指数)
    • @@ -266,7 +266,7 @@
    • || (或者)
    -

    Github 上下文

    +

    Github 上下文

    @@ -813,7 +813,7 @@ working-directory: ./temp

    使用 working-directory 关键字,您可以指定运行命令的工作目录(./temp)

    -

    defaults.run

    +

    defaults.run

    jobs:
       job1:
         runs-on: ubuntu-latest
    @@ -823,7 +823,7 @@
             working-directory: scripts
     

    作业中的所有 run 步骤提供默认的 shellworking-directory

    -

    jobs.<job_id>.steps[*].shell

    +

    jobs.<job_id>.steps[*].shell

    使用 bash 运行脚本

    steps:
       - name: Display the path
    diff --git a/docs/golang.html b/docs/golang.html
    index fb00cbfc..0841d1fc 100644
    --- a/docs/golang.html
    +++ b/docs/golang.html
    @@ -107,18 +107,18 @@
     var u uint = 7       // uint (unsigned)
     var p float32 = 22.7  // 32-bit float
     
    -

    操作符 Operators

    +

    操作符 Operators

    x := 5
     x++
     fmt.Println("x + 4 =", x + 4)
     fmt.Println("x * 4 =", x * 4) 
     

    参见:更多操作符

    -

    布尔值 Booleans

    +

    布尔值 Booleans

    isTrue   := true
     isFalse  := false
     
    -

    操作符

    +

    操作符

    fmt.Println(true && true)   // true 
     fmt.Println(true && false)  // false
     fmt.Println(true || true)   // true
    @@ -126,7 +126,7 @@
     fmt.Println(!true)          // false
     

    参见:更多操作符

    -

    数组 Arrays

    +

    数组 Arrays

    ┌────┬────┬────┬────┬─────┬─────┐
     | 2  | 3  | 5  | 7  | 11  | 13  |
    @@ -148,7 +148,7 @@
     fmt.Println(a[0], a[1]) //=> Hello World
     fmt.Println(a)   // => [Hello World]
     
    -

    2d array

    +

    2d array

    var twoDimension [2][3]int
     for i := 0; i < 2; i++ {
         for j := 0; j < 3; j++ {
    @@ -158,7 +158,7 @@
     // => 2d:  [[0 1 2] [1 2 3]]
     fmt.Println("2d: ", twoDimension)
     
    -

    指针(Pointers)

    +

    指针(Pointers)

    func main () {
       b := *getPointer()
       fmt.Println("Value is", b)
    @@ -200,13 +200,13 @@
     // 将等于字符Z
     s := string(i)
     
    -

    如何获取int字符串?

    +

    如何获取int字符串?

    i := 90
     // 需要导入“strconv”
     s := strconv.Itoa(i)
     fmt.Println(s) // Outputs: 90
     
    -

    Golang 字符串

    +

    Golang 字符串

    字符串函数

    package main
     import (
    @@ -545,14 +545,14 @@
     
    import "fmt"
     import "math/rand"
     
    -

    等同于

    +

    等同于

    import (
       "fmt"        // 给 fmt.Println
       "math/rand"  // 给 rand.Intn
     )
     

    另见:导入

    -

    别名

    +

    别名

    import r "math/rand"
     
    diff --git a/docs/html.html b/docs/html.html index fbde61cf..7780c2c9 100644 --- a/docs/html.html +++ b/docs/html.html @@ -221,36 +221,36 @@ </iframe>
    -

    ↓ 预览

    +

    ↓ 预览

    请参阅:内联框架元素

    -

    HTML 中的 JavaScript

    +

    HTML 中的 JavaScript

    <script type="text/javascript">
       let text = "Hello 快速参考";
       alert(text);
     </script>
     
    -

    外部 JavaScript

    +

    外部 JavaScript

    <body>
       ...
       <script src="app.js"></script>
     </body>
     
    -

    HTML 中的 CSS

    +

    HTML 中的 CSS

    <style type="text/css">
         h1 {
             color: purple;
         }
     </style>
     
    -

    外部样式表

    +

    外部样式表

    <head>
       ...
       <link rel="stylesheet" href="style.css"/>
     </head>
     
    -

    HTML5 标签

    +

    HTML5 标签

    页面

    <body>
       <header>
    @@ -422,12 +422,12 @@
     </video>
     
    -

    ↓ 预览

    +

    ↓ 预览

    -

    HTML5 Audio

    +

    HTML5 Audio

    <audio
       controls
       src="https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3">
    @@ -435,11 +435,11 @@
     </audio>
     
    -

    ↓ 预览

    +

    ↓ 预览

    -

    HTML5 Ruby

    +

    HTML5 Ruby

    <ruby>
     <rp>(</rp><rt>hàn</rt><rp>)</rp>
     <rp>(</rp><rt></rt><rp>)</rp>
    @@ -448,7 +448,7 @@
     </ruby>
     
    -

    ↓ 预览

    +

    ↓ 预览

    (hàn) @@ -456,20 +456,20 @@ 拼 (pīn)(yīn) -

    HTML5 kdi

    +

    HTML5 kdi

    <ul>
      <li>User <bdi>hrefs</bdi>: 60 points</li>
      <li>User <bdi>jdoe</bdi>: 80 points</li>
      <li>User <bdi>إيان</bdi>: 90 points</li>
     </ul>
     
    -

    ↓ 预览

    +

    ↓ 预览

    • User hrefs: 60 points
    • User jdoe: 80 points
    • User إيان: 90 points
    -

    HTML5 progress

    +

    HTML5 progress

    <progress value="50" max="100"></progress>
     

    @@ -649,7 +649,7 @@ <label for="ck">记住我</label> </form>
    -

    ↓ 预览

    +

    ↓ 预览

    @@ -663,7 +663,7 @@

    HTML <form> 元素用于收集信息并将其发送到外部源。

    -

    Form 属性

    +

    Form 属性

    @@ -714,28 +714,28 @@
    <label for="Name">Name:</label>
     <input type="text" name="Name" id="">
     
    -

    ↓ 预览

    +

    ↓ 预览

    请参阅:HTML输入标记

    -

    Textarea 标签

    +

    Textarea 标签

    <textarea rows="2" cols="30" name="address" id="address"></textarea>
     
    -

    ↓ 预览

    +

    ↓ 预览

    Textarea 是一个多行文本输入控件

    -

    Radio Buttons

    +

    Radio Buttons

    <input type="radio" name="gender" id="m">
     <label for="m">Male</label>
     <input type="radio" name="gender" id="f">
     <label for="f">Female</label>
     
    -

    ↓ 预览

    +

    ↓ 预览

    @@ -743,13 +743,13 @@

    单选按钮用于让用户只选择一个

    -

    Checkboxes

    +

    Checkboxes

    <input type="checkbox" name="s" id="soc">
     <label for="soc">Soccer</label>
     <input type="checkbox" name="s" id="bas">
     <label for="bas">Baseball</label>
     
    -

    ↓ 预览

    +

    ↓ 预览

    @@ -757,7 +757,7 @@

    复选框允许用户选择一个或多个

    -

    Select 标签

    +

    Select 标签

    <label for="city">City:</label>
     <select name="city" id="city">
       <option value="1">Sydney</option>
    @@ -765,7 +765,7 @@
       <option value="3">Cromwell</option>
     </select>
     
    -

    ↓ 预览

    +

    ↓ 预览

    选择框是选项的下拉列表

    -

    Fieldset 标签

    +

    Fieldset 标签

    <fieldset>
       <legend>Your favorite monster</legend>
       <input type="radio" id="kra" name="m">
    @@ -784,7 +784,7 @@
       <label for="sas">Sasquatch</label>
     </fieldset>
     
    -

    ↓ 预览

    +

    ↓ 预览

    Your favorite monster @@ -794,7 +794,7 @@
    -

    数据列表标签(HTML5)

    +

    数据列表标签(HTML5)

    <label for="b">Choose a browser: </label>
     <input list="list" id="b" name="browser"/>
     <datalist id="list">
    @@ -806,7 +806,7 @@
       <option value="Microsoft Edge">
     </datalist>
     
    -

    ↓ 预览

    +

    ↓ 预览

    @@ -819,7 +819,7 @@
    -

    提交和重置按钮

    +

    提交和重置按钮

    <form action="register.php" method="post">
       <label for="foo">Name:</label>
       <input type="text" name="name" id="foo">
    @@ -827,7 +827,7 @@
       <input type="reset" value="重置">
     </form>
     
    -

    ↓ 预览

    +

    ↓ 预览

    @@ -835,7 +835,7 @@

    将数据提交到服务器 重置为默认值

    -

    HTML input 标签

    +

    HTML input 标签

    Input 属性

    @@ -997,7 +997,7 @@
    type="checkbox"
    type="radio"
    type="file"
    type="hidden"
    type="text"
    type="password"
    type="image"
    type="reset"
    type="button"
    type="submit"
    -

    HTML5 中的新输入类型

    +

    HTML5 中的新输入类型

    @@ -1056,7 +1056,7 @@
    type="color"
    type="date"
    type="time"
    type="month"
    type="datetime-local"
    type="week"
    type="email"
    type="tel"
    type="url"
    type="number"
    type="search"
    type="range"
    -

    Input CSS 选择器

    +

    Input CSS 选择器

    diff --git a/docs/htop.html b/docs/htop.html index 7446765d..b6f5ac52 100644 --- a/docs/htop.html +++ b/docs/htop.html @@ -49,7 +49,7 @@
    $ htop [-dChustv]
     
    -

    安装

    +

    安装

    $ apt install htop        # Debian
     $ dnf install htop        # Fedora
     $ emerge sys-process/htop # Gentoo
    @@ -57,7 +57,7 @@
     $ Compile htop            # GoboLinux
     

    htop 的软件包在大多数发行版中都可用下载

    -

    选项示例

    +

    选项示例

    长选项的强制参数对于短选项也是强制的

    diff --git a/docs/javascript.html b/docs/javascript.html index ecb1f3e0..c63ef21d 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -172,7 +172,7 @@ // 无穷 Number.POSITIVE_INFINITY
    -

    Math

    +

    Math

    const pi = Math.PI; // 3.141592653589793
     Math.round(4.4); // = 4 - 数字四舍五入
     Math.round(4.5); // = 5
    @@ -199,7 +199,7 @@
     // 随机整数,从 1
     Math.floor(Math.random() * 5) + 1;  
     
    -

    全局函数

    +

    全局函数

    // 像脚本代码一样执行字符串
     eval();                     
    @@ -234,13 +234,13 @@
     false || false;      // false
     10 > 100 || 10 > 20; // false
     
    -

    逻辑运算符 &&

    +

    逻辑运算符 &&

    true && true;        // true
     1 > 2 && 2 > 1;      // false
     true && false;       // false
     4 === 4 && 3 > 1;    // true
     
    -

    比较运算符

    +

    比较运算符

    1 > 3                 // false
     3 > 1                 // true
     250 >= 250            // true
    @@ -248,20 +248,20 @@
     1 === 2               // false
     1 === '1'             // false
     
    -

    逻辑运算符 !

    +

    逻辑运算符 !

    let lateToWork = true;
     let oppositeValue = !lateToWork;
     // => false
     console.log(oppositeValue); 
     
    -

    空值合并运算符 ??

    +

    空值合并运算符 ??

    null ?? 'I win';         //  'I win'
     undefined ?? 'Me too';   //  'Me too'
     false ?? 'I lose'        //  false
     0 ?? 'I lose again'      //  0
     '' ?? 'Damn it'          //  ''
     
    -

    if Statement (if 语句)

    +

    if Statement (if 语句)

    const isMailSent = true;
     if (isMailSent) {
       console.log('Mail sent to recipient');
    @@ -340,31 +340,31 @@
     

    箭头函数 (ES6)

    -

    有两个参数

    +

    有两个参数

    const sum = (param1, param2) => { 
       return param1 + param2; 
     }; 
     console.log(sum(2,5)); // => 7 
     
    -

    没有参数

    +

    没有参数

    const printHello = () => { 
       console.log('hello'); 
     }; 
     printHello(); // => hello
     
    -

    只有一个参数

    +

    只有一个参数

    const checkWeight = weight => { 
       console.log(`Weight : ${weight}`); 
     }; 
     checkWeight(25); // => Weight : 25 
     
    -

    简洁箭头函数

    +

    简洁箭头函数

    const multiply = (a, b) => a * b; 
     // => 60 
     console.log(multiply(2, 30)); 
     

    从 ES2015 开始提供箭头函数

    -

    返回关键字

    +

    返回关键字

    // 有 return
     function sum(num1, num2) {
       return num1 + num2;
    @@ -1101,7 +1101,7 @@
     // 调用静态方法
     Dog.bark();
     
    -

    公有静态字段

    +

    公有静态字段

    class ClassStaticField {
       static staticField = 'static field'
     }
    @@ -1109,7 +1109,7 @@
     console.log(ClassStaticField.staticField)
     // 预期输出值:"static field"​ 
     
    -

    Class

    +

    Class

    class Song {
       constructor() {
         this.title;
    @@ -1189,7 +1189,7 @@
       multiply, duplicate
     }
     
    -

    import 加载模块

    +

    import 加载模块

    // main.js
     import add, { subtract, multiply, duplicate } from './myMath.js';
     console.log(add(6, 2));      // 8 
    @@ -1199,7 +1199,7 @@
     // index.html
     <script type="module" src="main.js"></script>
     
    -

    Export Module

    +

    Export Module

    // myMath.js
     function add(x,y){
       return x + y
    @@ -1221,7 +1221,7 @@
       duplicate
     }
     
    -

    require 加载模块

    +

    require 加载模块

    // main.js
     const myMath = require('./myMath.js')
     console.log(myMath.add(6, 2));      // 8 
    @@ -1229,7 +1229,7 @@
     console.log(myMath.multiply(6, 2)); // 12
     console.log(myMath.duplicate(5))    // 10
     
    -

    JavaScript Promises

    +

    JavaScript Promises

    Promise

    创建 promises

    @@ -1241,18 +1241,18 @@ } }) -

    使用 promises

    +

    使用 promises

    promise
       .then((result) => { ··· })
       .catch((error) => { ··· })
     
    -

    Promise 方法

    +

    Promise 方法

    Promise.all(···)
     Promise.race(···)
     Promise.reject(···)
     Promise.resolve(···)
     
    -

    执行器函数

    +

    执行器函数

    const executorFn = (resolve, reject) => {
       resolve('Resolved!');
     };
    diff --git a/docs/jest.html b/docs/jest.html
    index 3eabf9d5..4ca8886e 100644
    --- a/docs/jest.html
    +++ b/docs/jest.html
    @@ -337,7 +337,7 @@
     // fn.mock.calls[0][0] — 第一次调用的第一个参数
     expect(fn.mock.calls[0][0]).toBe(2)
     
    -

    别名

    +

    别名

    • toBeCalledtoHaveBeenCalled
    • toBeCalledWithtoHaveBeenCalledWith
    • @@ -348,7 +348,7 @@
    • lastReturnedWithtoHaveLastReturnedWith
    • nthReturnedWithtoHaveNthReturnedWith
    -

    杂项

    +

    杂项

    // 检查对象是否是类的实例。
     expect(new A()).toBeInstanceOf(A)
     
    @@ -422,11 +422,11 @@
     // 测试函数在调用时是否抛出与最新快照匹配的错误。
     expect(fn).toThrowErrorMatchingSnapshot()
     
    -

    别名

    +

    别名

    • toThrowErrortoThrow
    -

    异步测试

    +

    异步测试

    实例

    在异步测试中指定一些预期的断言是一个很好的做法,所以如果你的断言根本没有被调用,测试将会失败。

    diff --git a/docs/json.html b/docs/json.html index 9edc4585..12be6ce3 100644 --- a/docs/json.html +++ b/docs/json.html @@ -152,18 +152,18 @@
    \"双引号 Double quote
    \\反斜杠 Backslash
    \/正斜杠 Forward slash
    \b退格 Backspace
    \f换页 Form feed
    \n换行 Newline
    \r回车 Carriage return
    \t标签 Tab
    \u后跟四个十六进制数字
    -

    示例

    +

    示例

    {
       "url": "https://quickref.me",
       "msg" : "Hi,\n\"QuickRef.ME\"",
       "intro": "Share quick reference and cheat sheet for developers."
     }
     
    -

    无效字符串

    +

    无效字符串

    { "foo": 'bar' }
     

    Have to be delimited by double quotes

    -

    数字

    +

    数字

    @@ -188,7 +188,7 @@
    类型说明
    Integer数字 1-9、0 和正数或负数
    Fraction0.3、3.9 等分数
    Exponent指数,如 e、e+、e-、E、E+、E
    -

    示例

    +

    示例

    {
       "positive" : 12,
       "negative" : -1,
    @@ -197,11 +197,11 @@
       "zero" : 0
     }
     
    -

    无效的数字

    +

    无效的数字

    { "foo": 0xFF }
     

    在JSON中,只能使用十进制文字

    -

    对象 Objects

    +

    对象 Objects

    {
       "color": "Purple",
       "id": "210",
    diff --git a/docs/lerna.html b/docs/lerna.html
    index a474fbca..6d823220 100644
    --- a/docs/lerna.html
    +++ b/docs/lerna.html
    @@ -271,7 +271,7 @@
     
     
    :-:-
    --canary #使用此标志运行时,以更精细的方式(每次提交)发布包
    --contents <dir> #要发布的子目录。 必须适用于所有包,并且必须包含 package.json 文件
    --dist-tag <tag> #使用此标志运行时,将使用给定的 npm dist-tag(默认为 latest)发布到 npm
    --git-head <sha> #打包 tarball 时将显式 SHA 设置为清单上的 gitHead,仅允许使用 from-package 位置
    --graph-type <all|dependencies> #设置在构建包图时使用哪种依赖项。默认值是依赖项,即仅包含包的 package.json 的依赖项部分中列出的包
    --ignore-scripts #传递时,此标志将在 lerna 发布期间禁用运行生命周期脚本
    --ignore-prepublish #传递时,此标志将禁用在 lerna 发布期间运行已弃用预发布脚本
    --legacy-auth #发布需要身份验证的包时,您正在使用仅使用旧版 Base64 用户名:密码 的内部托管 NPM 注册表。这与 NPM 发布 _auth 标志相同
    --no-git-reset #默认情况下,lerna publish 确保对工作树的任何更改都已重置
    --no-granular-pathspec #默认情况下,lerna publish 将尝试(如果启用)git checkout 仅在发布过程中临时修改的叶包清单
    --verify-access #从历史上看,lerna 试图通过使用给定令牌执行一些抢占式 npm API 请求来快速解决授权/身份验证问题
    --otp #发布需要双重身份验证的包时,您可以使用 --otp 指定一次性密码
    --preid #与同名的 lerna 版本选项不同,该选项只适用于 --canary 版本计算
    --pre-dist-tag <tag> #--dist-tag 的工作方式相同,但仅适用于使用预发布版本发布的软件包
    --registry <url> #使用此标志运行时,转发的 npm 命令将为您的包使用指定的注册表
    --tag-version-prefix #此选项允许提供自定义前缀而不是默认前缀:v
    --temp-tag #传递时,此标志将更改默认发布过程,首先将所有更改的包发布到临时 dist-tag(lerna-temp),然后将新版本移动到 --dist-tag 配置的 dist-tag (默认latest)
    --yes #使用此标志运行时,lerna publish 将跳过所有确认提示
    -

    不推荐使用的选项

    +

    不推荐使用的选项

    @@ -291,7 +291,7 @@
    :-:-
    --no-verify-access #旧的抢先访问验证现在默认关闭,因此不需要 --no-verify-access
    --skip-npm #直接调用 lerna version
    -

    每个包中的配置

    +

    每个包中的配置

    "publishConfig": {
       "access": "public",
       "registry": "http://my-registry.com",
    @@ -327,7 +327,7 @@
     
     
    :-:-
    access #要发布具有范围的包(例如,@mycompany/rocks)
    registry #通过设置注册表来自定义每个包的注册表
    tag #您可以通过设置标签来自定义每个包的 dist-tag
    directory #这个 非标准 字段允许您像 --contents 一样自定义发布的子目录,但基于每个包
    -

    version 修改版本号

    +

    version 修改版本号

    $ lerna version 1.0.1 # 明确的
     $ lerna version patch # semver 关键字
    @@ -470,7 +470,7 @@
     
     
    :-:-
    --allow-branch <glob> #与启用 lerna versiongit 分支匹配的 glob 白名单
    --amend #使用此标志运行时,lerna version 将在当前提交上执行所有更改,而不是添加新的
    --changelog-preset #默认情况下,更改日志预设设置为 angular
    --conventional-commits #使用常规提交规范来确定版本 bump 并生成 CHANGELOG.md 文件
    --conventional-graduate #将使用 * 对指定的包(逗号分隔)或所有包进行分级
    --conventional-prerelease #预发布版本发布指定的包
    --create-release <type> #根据更改的包创建正式的 GitHubGitLab 版本
    --exact #在更新的包中精确指定更新的依赖项(没有标点符号),而不是与 semver 兼容(使用^
    --force-publish #强制发布指定的包
    --git-remote <name> #git 更改推送到指定的远程位置,而不是origin
    --ignore-changes #检测更改的包时忽略与 glob 匹配的文件中的更改
    --ignore-scripts #禁用在 lerna version 期间运行的生命周期脚本
    --include-merged-tags #在检测到更改的包时包括来自合并分支的标签
    --message <msg> #此选项别名为 -m 以与 git commit 进行奇偶校验
    --no-changelog #使用常规提交时,不要生成任何 CHANGELOG.md 文件
    --no-commit-hooks #允许 git commit hooks 在提交版本更改时运行。通过 --no-commit-hooks 禁用此行为
    --no-git-tag-version #将提交对 package.json 文件的更改并标记发布。通过 --no-git-tag-version 禁用该行为
    --no-granular-pathspec #仅添加在版本控制过程中更改的叶包清单(可能还有变更日志)。这产生了 git add --packages/*/package.json 的等价物,但针对更改的内容量身定制
    --no-private #在选择版本、提交和标记版本时包含私有包。通过 --no-private 禁用此行为
    --no-push #将已提交和标记的更改推送到配置的 git remote。通过 --no-push 禁用此行为
    --preid #使用此标志运行时,lerna 版本将使用指定的预发布标识符增加 premajorpreminorprepatchprerelease semver bumps
    --sign-git-commit #此选项类似于同名的 npm 版本选项
    --sign-git-tag #此选项类似于同名的 npm 版本选项
    --force-git-tag #此选项替换任何现有标记而不是失败
    --tag-version-prefix #此选项允许提供自定义前缀而不是默认前缀:v
    --yes #使用此标志运行时,lerna 版本将跳过所有确认提示
    -

    不推荐使用的选项

    +

    不推荐使用的选项

    @@ -494,7 +494,7 @@
    :-:-
    --cd-version #semver 关键字传递给 bump 位置
    --repo-version #将明确的版本号传递给 bump 位置
    --skip-git #请改用 --no-git-tag-version--no-push
    -

    bootstrap

    +

    bootstrap

    将本地包链接在一起,并安装其余的包依赖项

    $ lerna bootstrap -- --production \
                          --no-optional
    @@ -527,7 +527,7 @@
     
     
    :-:-
    --hoist [glob] #repo 根目录安装与 glob 匹配的外部依赖项,以便它们可用于所有包
    --strict #与提升 (hoist) 一起使用时,会在发出版本警告后抛出错误并停止引导
    --nohoist [glob] #不要在 repo 根目录安装与 glob 匹配的外部依赖项。这可用于选择不提升某些依赖项
    --ignore #当与 bootstrap 命令一起使用时,还可以在 lerna 中设置 --ignore 标志
    -

    选项

    +

    选项

    @@ -567,7 +567,7 @@
    :-:-
    --ignore-prepublish #跳过默认在引导程序包中运行的预发布生命周期脚本
    --ignore-scripts #跳过通常在引导程序包中运行(准备等)的任何生命周期脚本
    --registry <url> #指定 npm 包的仓库地址
    --npm-client <client> #必须是知道如何安装 npm 包依赖项的可执行文件
    --use-workspaces #启用与 Yarn Workspaces 的集成(从 yarn@0.27+ 开始可用)
    --no-ci #CI 环境中调用 npm ci 而不是 npm install
    --force-local #此标志会导致引导命令始终对本地依赖项进行符号链接,而不管匹配的版本范围如何
    -

    info 本地环境信息

    +

    info 本地环境信息

    $ lerna info
     
     lerna notice cli v6.0.0
    @@ -609,7 +609,7 @@
     # 所有匹配 “package-util-*” 的包都将被忽略,除非它们是
     # 依赖于名称与 “package-*” 匹配的包
     
    -

    选项

    +

    选项

    @@ -652,7 +652,7 @@
    :-:-
    --scope <glob> #仅包括名称与给定 glob 匹配的包
    --ignore <glob> #排除名称与给定 glob 匹配的包
    --no-private #排除私有包
    --since [ref] #仅包括自指定 ref 以来已更改的包
    --exclude-dependents #使用 --since 运行命令时排除所有传递依赖项,覆盖默认的“changed”算法
    --include-dependents #无论 --scope--ignore--since 是什么,在运行命令时都包括所有传递依赖项
    --include-dependencies #无论 --scope--ignore--since # 是什么,在运行命令时都包括所有传递依赖项
    --include-merged-tags #使用 --since 运行命令时包括来自合并分支的标签
    -

    list

    +

    list

    列出本地程序包,也尊重所有可用的过滤选项

    # 与 lerna list 相同,它本身类似于 ls 命令
     lerna ls
    @@ -661,7 +661,7 @@
     # 相当于 lerna ls -la,显示所有包(包括私有包)
     lerna la
     
    -

    选项

    +

    选项

    @@ -700,7 +700,7 @@
    :-:-
    --json显示为 JSON #
    --ndjson换行符分隔 #
    -a,--all所有包 #
    -l,--long显示扩展信息 #
    -p,--parseable显示可解析的输出 #
    --toposort按拓扑排序 #
    --graphJSON 格式邻接依赖关系图 #
    -

    changed

    +

    changed

    列出自上次标记版本以来已更改的本地软件包

    • lerna changed 支持 lerna ls 支持的所有选项
    • diff --git a/docs/lessjs.html b/docs/lessjs.html index 18aaa1d4..f03f0429 100644 --- a/docs/lessjs.html +++ b/docs/lessjs.html @@ -188,13 +188,13 @@ background-color: (#FFFFFF / 16); // 结果是 #101010
      -

    calc() 特例

    +

    calc() 特例

    为了与 CSS 保持兼容,calc() 并不对数学表达式进行计算,但是在嵌套函数中会计算变量和数学公式的值

    @var: 50vh/2;
     width: calc(50% + (@var - 20px));
     // 结果是 calc(50% + (25vh - 20px))
     
    -

    转义(Escaping)

    +

    转义(Escaping)

    @min768: ~"(min-width: 768px)";
     .element {
    diff --git a/docs/markdown.html b/docs/markdown.html
    index a41b91fd..31499de8 100644
    --- a/docs/markdown.html
    +++ b/docs/markdown.html
    @@ -129,10 +129,10 @@
     
        4 空格缩进做一个代码块
     
    -

    内联代码

    +

    内联代码

    `Inline code` 周围有反引号
     
    -

    表格

    +

    表格

    |     左栏   |     中间栏     |  右栏     |
     | ----------| ------------ | --------- |
     | 单元格 1   |   居中        |     $1600 |
    @@ -165,17 +165,17 @@
     
     ![替代文字](url)
     
    -

    带链接的图片

    +

    带链接的图片

    [![GitHub Logo](/images/logo.png)](https://github.com/)
     
     [![替代文字](image_url)](link_url)
     
    -

    参考风格

    +

    参考风格

    ![替代文字][logo]
     
     [logo]: /images/logo.png "Logo Title"
     
    -

    反斜杠转义

    +

    反斜杠转义

    diff --git a/docs/mysql.html b/docs/mysql.html index 7889f043..51f6b60b 100644 --- a/docs/mysql.html +++ b/docs/mysql.html @@ -72,7 +72,7 @@

    常用的

    -

    数据库 Database

    +

    数据库 Database

    @@ -103,7 +103,7 @@
    :-:-
    CREATE DATABASE db ;创建数据库
    SHOW DATABASES;列出数据库
    USE db;切换到数据库
    CONNECT db ;切换到数据库
    DROP DATABASE db;删除数据库
    -

    表 Table

    +

    表 Table

    @@ -138,7 +138,7 @@
    :-:-
    SHOW TABLES;列出当前数据库的表
    SHOW FIELDS FROM t;表的列表字段
    DESC t;显示表格结构
    SHOW CREATE TABLE t;显示创建表sql
    TRUNCATE TABLE t;删除表中的所有数据
    DROP TABLE t;删除表格
    -

    Proccess

    +

    Proccess

    @@ -157,7 +157,7 @@
    :-:-
    show processlist;列出进程
    kill pid;杀死进程
    -

    查看 MySQL 信息

    +

    查看 MySQL 信息

    # 显示当前mysql的version的各种信息
     mysql> status;
     # 显示当前mysql的version信息
    @@ -418,7 +418,7 @@
     ON table_name TRIGGER_TYPE
     EXECUTE stored_procedure;
     
    -

    WHEN

    +

    WHEN

    @@ -437,7 +437,7 @@
    :-:-
    BEFORE在事件发生前调用
    AFTER事件发生后调用
    -

    EVENT

    +

    EVENT

    @@ -460,7 +460,7 @@
    :-:-
    INSERT为INSERT调用
    UPDATE调用UPDATE
    DELETE调用DELETE
    -

    TRIGGER_TYPE

    +

    TRIGGER_TYPE

    @@ -479,7 +479,7 @@
    :-:-
    FOR EACH ROW-
    FOR EACH STATEMENT-
    -

    管理索引

    +

    管理索引

    在t表的c1和c2上创建索引

    CREATE INDEX idx_name 
     ON t(c1,c2);
    diff --git a/docs/netstat.html b/docs/netstat.html
    index a9455ae1..70f4057e 100644
    --- a/docs/netstat.html
    +++ b/docs/netstat.html
    @@ -288,12 +288,12 @@
     

    以下命令将输出服务器上正在发生和正在发生的活动 SYNC_REC 数量。数量应该很低(小于 5)。如果该数字为两位数,则您可能正在遭受 DoS 攻击或被邮件轰炸。

    $ netstat -n -p|grep SYN_REC | wc -l
     
    -

    列出发送 SYN_REC 连接的唯一 IP 地址

    +

    列出发送 SYN_REC 连接的唯一 IP 地址

    $ netstat -n -p | grep SYN_REC | awk '{print $5}' | awk -F: '{print $1}'
     

    与上面的命令一样,该命令也列出了发送 SYN_REC 连接状态的节点的所有唯一 IP 地址

    -

    每个远程 IP 的连接数

    +

    每个远程 IP 的连接数

    $ netstat -antu | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | sort -n
     
    diff --git a/docs/nginx.html b/docs/nginx.html index 73bb1984..e49baf60 100644 --- a/docs/nginx.html +++ b/docs/nginx.html @@ -294,7 +294,7 @@

    反向代理

    -

    基础

    +

    基础

    server {
       listen 80;
       server_name example.com;
    @@ -306,7 +306,7 @@
       }
     }
     
    -

    基础 + (upstream)

    +

    基础 + (upstream)

    upstream node_js {
       server 0.0.0.0:3000;
       # 其中 0.0.0.0:3000 是绑定在 
    @@ -322,7 +322,7 @@
       }
     }
     
    -

    升级连接(适用于支持 WebSockets 的应用程序)

    +

    升级连接(适用于支持 WebSockets 的应用程序)

    upstream node_js {
       server 0.0.0.0:3000;
     }
    @@ -343,7 +343,7 @@
     }
     

    适用于 Node.js、Streamlit、Jupyter 等

    -

    静态资源(传统 Web 服务器)

    +

    静态资源(传统 Web 服务器)

    server {
       listen 80;
    @@ -799,17 +799,17 @@
     

    阻止常见攻击

    -

    base64编码的网址

    +

    base64编码的网址

    location ~* "(base64_encode)(.*)(\()" {
         deny all;
     }
     
    -

    javascript eval() url

    +

    javascript eval() url

    location ~* "(eval\()" {
         deny all;
     }
     
    -

    Gzip 配置

    +

    Gzip 配置

    gzip  on;
     gzip_buffers 16 8k;
    diff --git a/docs/npm.html b/docs/npm.html
    index ada97bd6..131d550d 100644
    --- a/docs/npm.html
    +++ b/docs/npm.html
    @@ -327,13 +327,13 @@
     
    npm config set registry https://registry.npmmirror.com
     

    请参阅:npmmirror 中国镜像站

    -

    electronjs 镜像和缓存

    +

    electronjs 镜像和缓存

    ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"
     ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/
     ; ELECTRON_CUSTOM_DIR="{{ version }}"
     
    -

    身份验证相关配置

    +

    身份验证相关配置

    //registry.npmjs.org/:_authToken=MYTOKEN
     ; 将适用于 @myorg 和 @another
     //somewhere.com/:_authToken=MYTOKEN
    diff --git a/docs/package.json.html b/docs/package.json.html
    index cf4fc456..8f75e0c0 100644
    --- a/docs/package.json.html
    +++ b/docs/package.json.html
    @@ -106,14 +106,14 @@
     }
     

    鼓励使用开源 (OSI-approved) 许可证,除非你有特别的原因不用它。 如果你开发的包是你工作的一部分,最好和公司讨论后再做决定。

    -

    license字段必须是以下之一

    +

    license字段必须是以下之一

    • 如果你使用标准的许可证,需要一个有效地 SPDX 许可证标识
    • 如果你用多种标准许可证,需要有效的 SPDX 许可证表达式2.0语法表达式
    • 如果你使用非标准的许可证,一个 SEE LICENSE IN <文件名> 字符串指向你的包里顶级目录的一个 <文件名>。
    • 如果你不想在任何条款下授权其他人使用你的私有或未公开的包,一个 UNLICENSED 字符串。
    -

    keywords

    +

    入门

    本地编译预览

    简单的将仓库克隆下来本地调试页面展示。

    -

    克隆仓库

    +

    克隆仓库

    git clone git@github.com:jaywcjlove/reference.git
     
    -

    安装依赖编译生成 HTML 页面

    +

    安装依赖编译生成 HTML 页面

    npm i         # 安装依赖
     npm run build # 编译输出 HTML
     npm run start # 监听 md 文件编译输出 HTML
     

    HTML 存放在仓库根目录下的 dist 目录中,将 dist/index.html 静态页面在浏览器中打开预览。

    -

    介绍

    +

    介绍

    在备忘清单采用 HTML 注释语法,标识网站布局和一些样式,目的是为了在 GitHub 中也是正常毫无瑕疵的预览 Markdown

    ### 卡片标题
     <!--rehype:wrap-class=col-span-2-->
    @@ -73,22 +73,22 @@
     
  • <!--rehype: 开始,--> 结束,包裹参数内容
  • 内容采用 URL 参数的字符拼接方式
  • -

    语法

    +

    语法

    <!--rehype: + key=value + & + key=value + -->
    标识开始 + 参数 + 分隔符(&) + 参数 + 标识结束

    -

    示例

    +

    示例

    ### H2 部分
     <!--rehype:body-class=cols-2-->
     
     ### H3 部分
     <!--rehype:wrap-class=row-span-2-->
     
    -

    示例,三行占位,标题红色

    +

    示例,三行占位,标题红色

    ### 标题
     <!--rehype:wrap-class=row-span-3&style=color:red;-->
     
    -

    参数说明

    +

    参数说明

    @@ -115,7 +115,7 @@
    说明
    body-style包裹所有卡片外壳的样式
    body-class用于卡片栏布局,添加
    wrap-style卡片栏添加 CSS 样式
    wrap-class用于卡片占位,添加
    -

    文字颜色

    +

    文字颜色

    _我是红色_<!--rehype:style=color: red;-->
     **加粗红色**<!--rehype:style=color: red;-->
     
    @@ -554,7 +554,7 @@

    Title 1 标题添加 col-span-2row-span-2 占位类,使用 空格 间隔。

    表格

    基本表格

    -

    Date

    +

    Date

    @@ -577,7 +577,7 @@
    :-:-
    %m/%d/%Y06/05/2013
    %A, %B %e, %YSunday, June 5, 2013
    %b %e %aJun 5 Sun
    -

    Time

    +

    Time

    @@ -597,7 +597,7 @@
    :-:-
    %H:%M23:05
    %I:%M %p11:05 PM

    标题为 H4 的基本表格。

    -

    快捷键

    +

    快捷键

    @@ -853,19 +853,19 @@

    卡片子项

    每个部分可以有以下子项:

    -

    H4 子标题

    +

    H4 子标题

    • pre
    • table
    • ul
    -

    H4 子标题

    +

    H4 子标题

    • pre
    • table
    • ul
    -

    H3 部分

    +

    H3 部分

    每个盒子(卡片)都是一个 H3 部分。 盒子将包含 H3 自身内的所有东西。

    这是一个包含段落的基本部分。

    H3 部分背景颜色

    diff --git a/docs/react.html b/docs/react.html index 0804a698..2d375f19 100644 --- a/docs/react.html +++ b/docs/react.html @@ -60,10 +60,10 @@ const root = createRoot(elm); root.render(<App />); -

    快速创建 React 项目 (CRA)

    +

    快速创建 React 项目 (CRA)

    npx create-react-app my-app
     
    -

    导入多个导出

    +

    导入多个导出

    import React, {Component} from 'react'
     import ReactDOM from 'react-dom'
     
    @@ -172,7 +172,7 @@

    使用 setState 更新状态,下面是函数组件读取状态

    <p>您点击了 {count}</p>
     
    -

    Class 中的 State

    +

    Class 中的 State

    import React from 'react';
     
     class Student extends React.Component {
    @@ -201,7 +201,7 @@
     

    使用 setState 更新状态,class 组件中不能使用 hooks。下面是 class 组件读取状态

    <p>您点击了{this.state.count}</p>
     
    -

    循环

    +

    循环

    const elm = ['one', 'two', 'three'];
     function Student() {
       return (
    @@ -308,7 +308,7 @@
       )
     );
     
    -

    使用

    +

    使用

    // 你可以直接获取 DOM button 的 ref:
     const ref = React.createRef();
     
    @@ -316,7 +316,7 @@
       点击我
     </FancyButton>;
     
    -

    Class 组件内部使用 ref 属性

    +

    Class 组件内部使用 ref 属性

    import {Component,createRef} from 'react'
     
     class MyComponent extends Component {
    @@ -397,7 +397,7 @@
     
     
     
    :-:-
    id(string)发生提交的 Profiler 树的 id
    onRender(function)组件树任何组件 “提交” 一个更新的时候调用这个函数
    -

    onRender 回调函数

    +

    onRender 回调函数

    @@ -432,7 +432,7 @@
    :-:-
    phase: "mount" | "update"判断是由 props/state/hooks 改变 或 “第一次装载” 引起的重渲染
    actualDuration: number本次更新在渲染 Profiler 和它的子代上花费的时间
    baseDuration: number在 Profiler 树中最近一次每一个组件 render 的持续时间
    startTime: number本次更新中 React 开始渲染的时间戳
    commitTime: number本次更新中 React commit 阶段结束的时间戳
    interactions: Set当更新被制定时,“interactions” 的集合会被追踪
    -

    默认值

    +

    默认值

    Class 组件默认 props

    class CustomButton extends React.Component {
    @@ -442,11 +442,11 @@
       color: 'blue'
     };
     
    -

    使用

    +

    使用

    <CustomButton /> ;
     

    不传值 props.color 将自动设置为 blue

    -

    Class 组件默认 state

    +

    Class 组件默认 state

    class Hello extends Component {
       constructor (props) {
    @@ -609,10 +609,10 @@
     }
     

    注意:组件必须总是返回一些东西。

    -

    使用

    +

    使用

    <Greeting firstName="" lastName="" />
     
    -

    JSX 三目运算符 / 与运算符 &&

    +

    JSX 三目运算符 / 与运算符 &&

    export default function Weather(props) {
       const isLoggedIn = props.isLoggedIn;
       return (
    @@ -683,7 +683,7 @@
     

    Class 组件 API

    -

    额外的 API

    +

    额外的 API

    @@ -706,7 +706,7 @@
    :--
    this.forceUpdate()强制重新渲染
    this.setState({ ... })更新状态
    this.setState(state =>{ ... })更新状态
    -

    属性

    +

    属性

    @@ -725,7 +725,7 @@
    :--
    defaultProps默认 props
    displayName显示组件名称(用于调试)
    -

    实例属性

    +

    实例属性

    @@ -744,7 +744,7 @@
    :--
    this.props组件接受参数
    this.state组件内状态
    -

    Pure 组件

    +

    Pure 组件

    import React, {PureComponent} from 'react'
     
     class MessageBox extends PureComponent {
    @@ -865,7 +865,7 @@
     

    Hooks

    Hooks API 参考

    -

    基础 Hook

    +

    基础 Hook

    @@ -888,7 +888,7 @@
    方法描述
    useState返回一个 state,更新 state 的函数 #
    useEffect可能有副作用代码的函数 #
    useContext接收并返回该 context 的当前值 #
    -

    额外的 Hook

    +

    额外的 Hook

    @@ -939,7 +939,7 @@
    方法描述
    useReduceruseState 的替代方案 #
    useCallback返回一个回调函数 #
    useMemo返回一个 memoized#
    useRef返回一个可变的 ref 对象 #
    useImperativeHandle暴露给父组件的实例值 #
    useLayoutEffectDOM 变更后同步调用函数 #
    useDebugValue开发者工具中显示标签 #
    useDeferredValue接受并返回该值的新副本 #
    useTransition过渡任务的等待状态 #
    useId用于生成唯一 ID #
    -

    Library Hooks

    +

    Library Hooks

    @@ -958,7 +958,7 @@
    方法描述
    useSyncExternalStore读取和订阅外部数据源 #
    useInsertionEffectDOM 突变之前 同步触发 #
    -

    函数式更新

    +

    函数式更新

    function Counter({ initialCount }) {
       const [count, setCount] = useState(initialCount);
    @@ -1279,7 +1279,7 @@
     
     
     
    :--
    any任意类型
    (props, propName, 组件名称)=>{}自定义验证器
    -

    基础

    +

    基础

    @@ -1310,7 +1310,7 @@
    :--
    string字符串
    number数组
    func函数
    bool布尔值
    symbol-
    -

    枚举 Enum

    +

    枚举 Enum

    @@ -1329,7 +1329,7 @@
    :--
    oneOf(any)枚举类型
    oneOfType([type])几种类型中的任意一个类型
    -

    数组 Array

    +

    数组 Array

    @@ -1348,7 +1348,7 @@
    :--
    array数组
    arrayOf数组由某一类型的元素组成
    -

    对象 Object

    +

    对象 Object

    @@ -1379,7 +1379,7 @@
    :--
    object对象
    objectOf对象由某一类型的值组成
    instanceOf(...)类的实例
    shape对象由特定的类型值组成
    exact有额外属性警告
    -

    元素 Elements

    +

    元素 Elements

    @@ -1402,7 +1402,7 @@
    :--
    elementReact 元素
    elementTypeReact 元素类型(即 MyComponent)
    nodeDOM 节点
    -

    必需的

    +

    必需的

    @@ -1418,7 +1418,7 @@
    :--
    (···).isRequired必需的

    请参阅:使用 PropTypes 进行类型检查

    -

    基本类型

    +

    基本类型

    MyComponent.propTypes = {
       email:      PropTypes.string,
       seats:      PropTypes.number,
    diff --git a/docs/regex.html b/docs/regex.html
    index 6fb2d77e..26441b3d 100644
    --- a/docs/regex.html
    +++ b/docs/regex.html
    @@ -1360,7 +1360,7 @@
     

    表达式 [^c]ar 匹配一个后面跟着 ar 的除了c的任意字符。

    重复次数

    -

    *

    +

    *

    @@ -1380,7 +1380,7 @@
    表达式匹配示例
    [a-z]*The car parked in the garage #21.
    \s*cat\s*The fat cat sat on the concatenation.

    表达式 [a-z]* 匹配一个行中所有以小写字母开头的字符串。

    -

    +

    +

    +

    @@ -1396,7 +1396,7 @@
    表达式匹配示例
    c.+tThe fat cat sat on the mat.

    表达式 c.+t 匹配以首字母c开头以t结尾,中间跟着至少一个字符的字符串。

    -

    ?

    +

    ?

    @@ -1416,7 +1416,7 @@
    表达式匹配示例
    [T]heThe car is parked in the garage.
    [T]?heThe car is parked in the garage.

    表达式 [T]?he 匹配字符串 heThe

    -

    {}

    +

    {}

    @@ -1494,7 +1494,7 @@

    锚点

    匹配指定开头或结尾的字符串就要使用到锚点。

    -

    ^ 号 (符串的开头)

    +

    ^ 号 (符串的开头)

    @@ -1514,7 +1514,7 @@
    表达式匹配示例
    (T|t)heThe car is parked in the garage.
    ^(T|t)heThe car is parked in the garage.
    -

    $ 号 (否是最后一个)

    +

    $ 号 (否是最后一个)

    @@ -1534,7 +1534,7 @@
    表达式匹配示例
    (at\.)The fat cat. sat. on the mat.
    (at\.)$The fat cat. sat. on the mat.
    -

    简写字符集

    +

    简写字符集

    @@ -1757,36 +1757,36 @@

    实例

    -

    re.search()

    +

    re.search()

    >>> sentence = 'This is a sample string'
     >>> bool(re.search(r'this', sentence, flags=re.I))
     True
     >>> bool(re.search(r'xyz', sentence))
     False
     
    -

    re.findall()

    +

    re.findall()

    >>> re.findall(r'\bs?pare?\b', 'par spar apparent spare part pare')
     ['par', 'spar', 'spare', 'pare']
     >>> re.findall(r'\b0*[1-9]\d{2,}\b', '0501 035 154 12 26 98234')
     ['0501', '154', '98234']
     
    -

    re.finditer()

    +

    re.finditer()

    >>> m_iter = re.finditer(r'[0-9]+', '45 349 651 593 4 204')
     >>> [m[0] for m in m_iter if int(m[0]) < 350]
     ['45', '349', '4', '204']
     
    -

    re.split()

    +

    re.split()

    >>> re.split(r'\d+', 'Sample123string42with777numbers')
     ['Sample', 'string', 'with', 'numbers']
     
    -

    re.sub()

    +

    re.sub()

    >>> ip_lines = "catapults\nconcatenate\ncat"
     >>> print(re.sub(r'^', r'* ', ip_lines, flags=re.M))
     * catapults
     * concatenate
     * cat
     
    -

    re.compile()

    +

    re.compile()

    >>> pet = re.compile(r'dog')
     >>> type(pet)
     <class '_sre.SRE_Pattern'>
    @@ -1795,7 +1795,7 @@
     >>> bool(pet.search('A cat crossed their path'))
     False
     
    -

    函数

    +

    函数

    @@ -1879,7 +1879,7 @@

    JavaScript 中的正则表达式

    RegExp

    -

    属性

    +

    属性

    @@ -1930,7 +1930,7 @@
    :-:-
    dotAll是否使用了 s 修饰符
    flags返回标志的字符串
    global是否使用了 g (全部)修饰符
    hasIndices是否使用了 d 修饰符
    ignoreCase匹配文本的时候是否忽略大小写 i
    multiline是否进行多行搜索 m
    lastIndex该索引表示从哪里开始下一个匹配
    source正则表达式的文本
    sticky搜索是否是 sticky
    unicodeUnicode 功能是否开启
    -

    方法

    +

    方法

    @@ -1977,7 +1977,7 @@
    :-:-
    match()获取匹配结果
    matchAll()所有匹配项
    replace()替换所有符合正则模式的匹配项
    search()搜索以取得匹配正则模式的项
    split()切割字符串返回字符串数组
    compile()(重新)编译正则表达式
    exec()指定字符串中执行一个搜索匹配
    test()正则表达式与指定的字符串是否匹配
    toString()返回该正则表达式的字符串
    -

    test()

    +

    test()

    let textA = 'I like APPles very much';
     let textB = 'I like APPles';
     let regex = /apples$/i
    @@ -2136,21 +2136,21 @@
     

    Java 中的正则表达式

    风格

    -

    第一种方式

    +

    第一种方式

    Pattern p = Pattern.compile(".s", Pattern.CASE_INSENSITIVE);
     Matcher m = p.matcher("aS");  
     boolean s1 = m.matches();  
     System.out.println(s1);   // Outputs: true
     
    -

    第二种方式

    +

    第二种方式

    boolean s2 = Pattern.compile("[0-9]+").matcher("123").matches();  
     System.out.println(s2);   // Outputs: true
     
    -

    第三种方式

    +

    第三种方式

    boolean s3 = Pattern.matches(".s", "XXXX");  
     System.out.println(s3);   // Outputs: false
     
    -

    模式字段

    +

    模式字段

    @@ -2190,14 +2190,14 @@
    :--
    CANON_EQ规范等价
    CASE_INSENSITIVE不区分大小写的匹配
    COMMENTS允许空格和注释
    DOTALL圆点模式
    MULTILINE多行模式
    UNICODE_CASEUnicode 感知大小写折叠
    UNIX_LINESUnix 行模式

    方法

    -

    Pattern

    +

    Pattern

    • 模式编译 compile(字符串正则表达式 [,int flags])
    • 布尔匹配 matches([字符串正则表达式,] CharSequence 输入)
    • String[] 拆分 split(字符串正则表达式 [,int 限制])
    • 字符串引用 quote(字符串 s)
    -

    匹配器

    +

    匹配器

    • int start([int group | 字符串名称])
    • int end([int group | 字符串名称])
    • @@ -2205,14 +2205,14 @@
    • 字符 group([int 组 | 字符串名称])
    • 匹配器重置 reset()
    -

    String

    +

    String

    • boolean matches(String regex)
    • String replaceAll(String regex, 字符串替换)
    • String[] split(String regex[, int limit])

    还有更多方法...

    -

    例子

    +

    例子

    替换句子:

    String regex = "[A-Z\n]{5}$";
    @@ -2270,7 +2270,7 @@
     

    REGEXP

    expr REGEXP pat 
     
    -

    Examples

    +

    Examples

    mysql> SELECT 'abc' REGEXP '^[a-d]';
     1
     mysql> SELECT name FROM cities WHERE name REGEXP '^A';
    @@ -2279,28 +2279,28 @@
     mysql> SELECT 'a' REGEXP 'A', 'a' REGEXP BINARY 'A';
     1   0
     
    -

    REGEXP_REPLACE

    +

    REGEXP_REPLACE

    REGEXP_REPLACE(expr, pat, repl[, pos[, occurrence[, match_type]]])
     
    -

    例子

    +

    例子

    mysql> SELECT REGEXP_REPLACE('a b c', 'b', 'X');
     a X c
     mysql> SELECT REGEXP_REPLACE('abc ghi', '[a-z]+', 'X', 1, 2);
     abc X
     
    -

    REGEXP_SUBSTR

    +

    REGEXP_SUBSTR

    REGEXP_SUBSTR(expr, pat[, pos[, occurrence[, match_type]]])
     
    -

    例子

    +

    例子

    mysql> SELECT REGEXP_SUBSTR('abc def ghi', '[a-z]+');
     abc
     mysql> SELECT REGEXP_SUBSTR('abc def ghi', '[a-z]+', 1, 3);
     ghi
     
    -

    REGEXP_LIKE

    +

    REGEXP_LIKE

    REGEXP_LIKE(expr, pat[, match_type])
     
    -

    例子

    +

    例子

    mysql> SELECT regexp_like('aba', 'b+')
     1
     mysql> SELECT regexp_like('aba', 'b{2}')
    @@ -2312,10 +2312,10 @@
     mysql> SELECT regexp_like('a\nb\nc', '^b$', 'm');
     1
     
    -

    REGEXP_INSTR

    +

    REGEXP_INSTR

    REGEXP_INSTR(expr, pat[, pos[, occurrence[, return_option[, match_type]]]])
     
    -

    例子

    +

    例子

    mysql> SELECT regexp_instr('aa aaa aaaa', 'a{3}');
     2
     mysql> SELECT regexp_instr('abba', 'b{2}', 2);
    @@ -2325,7 +2325,7 @@
     mysql> SELECT regexp_instr('abbabba', 'b{2}', 1, 3, 1);
     7
     
    -

    也可以看看

    +

    也可以看看

    • 轻松学习 Regex (github.com)
    • 正则表达式实例搜集 (jaywcjlove.github.io)
    • diff --git a/docs/sass.html b/docs/sass.html index 1c1c1677..345d8ef0 100644 --- a/docs/sass.html +++ b/docs/sass.html @@ -206,13 +206,13 @@

    获取值

    -

    HSLA

    +

    HSLA

    hue($color)         // 0deg..360deg
     saturation($color)  // 0%..100%
     lightness($color)   // 0%..100%
     alpha($color)       // 0..1 (aka opacity())
     
    -

    RGB

    +

    RGB

    red($color)         // 0..255
     green($color)
     blue($color)
    @@ -253,7 +253,7 @@
     
     
    :-:-
    color.red()用于获取颜色的红色通道
    color.green()用于获得颜色的绿色通道
    color.blue()用于获取颜色的蓝色通道
    color.hue()以获得颜色的色调
    color.saturation()用于获得颜色的饱和度
    color.lightness()以获得颜色的亮度

    另见: hue(), red()

    -

    Sass 内置了对颜色值的支持

    +

    Sass 内置了对颜色值的支持

    @debug rgb(204, 102, 153);  // #c69
     @debug rgba(107, 113, 127, 0.8); // rgba(107, 113, 127, 0.8)
     @debug hsl(228, 7%, 86%);        // #dadbdf
    diff --git a/docs/semver.html b/docs/semver.html
    index c1cc0972..283e50c6 100644
    --- a/docs/semver.html
    +++ b/docs/semver.html
    @@ -174,7 +174,7 @@
     
     
    范围描述
    1.2.3 - 2.3.4>=1.2.3 <=2.3.4
    -

    部分向右

    +

    部分向右

    @@ -194,7 +194,7 @@
    范围描述
    1.2.3 - 2.3>=1.2.3 <2.4.0
    1.2.3 - 2>=1.2.3 <3.0.0
    -

    部分向左

    +

    部分向左

    @@ -212,7 +212,7 @@

    当右侧为部分(例如,2.3)时,假定缺失的部分为x(例如, 2.3.x)。

    如果左边是部分的(例如,1.2),则假定缺少的部分为0(例如, 1.2.0)。

    -

    有效的语义版本

    +

    有效的语义版本

    0.0.4
     1.2.3
    diff --git a/docs/styled-components.html b/docs/styled-components.html
    index a42f40fa..46a0cd10 100644
    --- a/docs/styled-components.html
    +++ b/docs/styled-components.html
    @@ -279,7 +279,7 @@
       );
     }
     
    -

    👇👇 与下面 styled 写法等效 👇👇

    +

    👇👇 与下面 styled 写法等效 👇👇

    import styled from 'styled-components';
     
     const StyledCounter = styled.div`
    @@ -312,7 +312,7 @@
       );
     }
     
    -

    伪元素、伪选择器和嵌套

    +

    伪元素、伪选择器和嵌套

    const Thing = styled.div.attrs((/* props */) => ({ tabIndex: 0 }))`
       color: blue;
    @@ -926,12 +926,12 @@
     
    <MyComponent className="red-bg" />
     

    由于某种原因,这个组件仍然有绿色背景,即使你试图用 red-bg 类覆盖它!

    -

    解决方案

    +

    解决方案

    .red-bg.red-bg {
       background-color: red;
     }
     
    -

    ThemeProvider

    +

    ThemeProvider

    import styled, { ThemeProvider } from 'styled-components'
     
    diff --git a/docs/sublime-text.html b/docs/sublime-text.html
    index 977b88ed..1389cf31 100644
    --- a/docs/sublime-text.html
    +++ b/docs/sublime-text.html
    @@ -388,12 +388,12 @@
                /usr/local/bin/subl
     
    -

    在命令行中使用 subl 命令

    +

    在命令行中使用 subl 命令

    $ subl .
     $ subl README.md
     

    软链放到这个目录 /usr/local/bin/subl,这是因为 Rootless 机制,不能存放到 /usr/bin/subl 位置。

    -

    另见

    +

    另见

    • Sublime Text 官网 (sublimetext.com)
    • Sublime 编辑器快捷键 (jaywcjlove.github.io)
    • diff --git a/docs/swift.html b/docs/swift.html index 4b7082a5..874ec90d 100644 --- a/docs/swift.html +++ b/docs/swift.html @@ -78,7 +78,7 @@ x = 4 / 2 // x 现在是 2 x = 4 % 2 // x 现在是 0
      -

    复合赋值运算符

    +

    复合赋值运算符

    var numberOfDogs = 100
     numberOfDogs += 1
     print("有 \(numberOfDogs) 个斑点狗!")
    @@ -93,7 +93,7 @@
     
  • %= 除并分配余数
  • -

    字符串插值

    +

    字符串插值

    var apples = 6
     print("I have \(apples) apples!")
     // 打印: I have 6 apples!
    diff --git a/docs/toml.html b/docs/toml.html
    index a52bd2b0..d0532ad6 100644
    --- a/docs/toml.html
    +++ b/docs/toml.html
    @@ -162,7 +162,7 @@
     author = "Anonymous"
     text = "Love it!"
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
     	"comments" : [
     		{
    @@ -176,11 +176,11 @@
     	]
     }
     
    -

    点分隔

    +

    点分隔

    [dog."tater.man"]
     type = "pug"
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "dog": {
         "tater.man": {
    @@ -189,11 +189,11 @@
       }
     }
     
    -

    多嵌套

    +

    多嵌套

    [foo.bar.baz]
     bat = "hi"
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
     	"foo" : {
     		"bar" : {
    @@ -204,7 +204,7 @@
     	}
     }
     
    -

    忽略空格

    +

    忽略空格

    [a.b.c]          # this is best practice
     [ d.e.f ]        # same as [d.e.f]
     [ g .  h  .i ]   # same as [g.h.i]
    diff --git a/docs/typescript.html b/docs/typescript.html
    index e27871fd..9e3a010a 100644
    --- a/docs/typescript.html
    +++ b/docs/typescript.html
    @@ -61,7 +61,7 @@
     Regexp, Promise
     

    内置

    -

    类型字面量

    +

    类型字面量

    Object:

    { field: string }
     
    @@ -74,10 +74,10 @@

    Tuple:

    [string, number]
     
    -

    避免

    +

    避免

    Object, String, Number, Boolean
     
    -

    通用语法

    +

    通用语法

    /** 可选择从现有接口或类型(Response, HTTPAble)中获取属性 */
     interface JSONResponse extends Response, HTTPAble {
    @@ -107,7 +107,7 @@
       data: Response
     }
     
    -

    用法

    +

    用法

    const api: APICall<ArtworkCall> = ...
     
     api.data  // Artwork
    @@ -121,7 +121,7 @@
     
     api.data.status
     
    -

    重载

    +

    重载

    interface Expect {
       (matcher: boolean): string
       (matcher: string): boolean;
    @@ -165,11 +165,11 @@
     
  • Interface 可以通过多次声明来扩展
  • 在性能关键 Type 中,Interface 比较检查可以更快。
  • -

    把类型想象成变量

    +

    把类型想象成变量

    就像您如何在不同范围内创建具有相同名称的变量一样,type 具有相似的语义。

    -

    使用实用程序类型构建

    +

    使用实用程序类型构建

    TypeScript 包含许多全局类型,它们将帮助您在类型系统中完成常见任务。检查他们的网站。

    -

    原始类型

    +

    原始类型

    type SanitizedInput = string;
     type MissingNo = 404;
     
    @@ -256,7 +256,7 @@

    控制流动分析

    If 声明

    -

    typeof(用于原语)

    +

    typeof(用于原语)

    const input = getUserInput()
     input // string | number
     
    @@ -264,7 +264,7 @@
      input // string
     }
     
    -

    对象中的“property”(对于对象)

    +

    对象中的“property”(对于对象)

    const input = getUserInput()
     input  // string | { error: ... }
     
    @@ -272,7 +272,7 @@
       input // { error: ... }
     }
     
    -

    instanceof(用于类)

    +

    instanceof(用于类)

    const input = getUserInput()
       input // number | number[]
     
    @@ -280,7 +280,7 @@
       input // number[]
     }
     
    -

    类型保护功能(适用于任何东西)

    +

    类型保护功能(适用于任何东西)

    const input = getUserInput()
        input // number | number[]
     
    @@ -288,7 +288,7 @@
       input // number[]
     }
     
    -

    任务

    +

    任务

    const data1 = {
       name: "Zagreus"
    @@ -338,7 +338,7 @@
       | { status: 301, to: string }
       | { status: 400, error: Error }
     
    -

    用法

    +

    用法

    const response = getResponse()
     response // Responses
     switch(response.status) {
    @@ -347,7 +347,7 @@
       case 400: return response.error
     }
     
    -

    断言函数

    +

    断言函数

    描述影响当前范围的 CFA 更改的函数,因为它抛出而不是返回 false。

    function assertResponse(obj: any): asserts obj is SuccessResponse {
    @@ -356,7 +356,7 @@
       }
     }
     
    -

    用法

    +

    用法

    const res = getResponse():
     res // SuccessResponse | ErrorResponse
     
    @@ -365,7 +365,7 @@
     
     res // SuccessResponse
     
    -

    in 操作符

    +

    in 操作符

    interface A {
       x: number;
     }
    @@ -388,7 +388,7 @@
     const abc = new ABC()
     

    新 ABC 的参数来自构造函数。

    -

    private x 与 #private

    +

    private x 与 #private

    前缀 private 是一个仅类型的添加,在运行时没有任何影响。 在以下情况下,类之外的代码可以进入项目:

    class Bag {
       private item: any
    @@ -397,17 +397,17 @@
     

    Vs #private 是运行时私有的,并且在 JavaScript 引擎内部强制执行,它只能在类内部访问:

    class Bag { #item: any }
     
    -

    Class 上的 “this”

    +

    Class 上的 “this”

    函数内部‘this’的值取决于函数的调用方式。 不能保证始终是您可能在其他语言中使用的类实例。

    您可以使用“此参数”、使用绑定功能或箭头功能来解决问题。

    -

    类型和值

    +

    类型和值

    一个类既可以用作类型也可以用作值。

    const a:Bag = new Bag()
     

    所以,小心不要这样做:

    class C implements Bag {}
     
    -

    通用语法

    +

    通用语法

    // 确保类符合一组接口或类型  ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈▶┈┈╮
     // 子类这个类 ┈┈┈┈┈┈┈┈↘                 ┈┈┈┈┈┈┈┈┈┈┈┈┈┴┈┈┈┈┈┈┈
    @@ -693,7 +693,7 @@
     

    从构造函数类型的类型构造元组或数组类型。它产生一个包含所有参数类型的元组类型(如果 Type 不是函数,则类型 never )。

    内在字符串操作类型

    -

    Uppercase<StringType>

    +

    Uppercase<StringType>

    type Greeting = "Hello, world"
     type ShoutyGreeting = Uppercase<Greeting>
     // type ShoutyGreeting = "HELLO, WORLD"
    @@ -703,7 +703,7 @@
     // type MainID = "ID-MY_APP"
     

    将字符串中的每个字符转换为大写版本。

    -

    Lowercase<StringType>

    +

    Lowercase<StringType>

    type Greeting = "Hello, world"
     type QuietGreeting = Lowercase<Greeting>
     // type QuietGreeting = "hello, world"
    @@ -713,19 +713,19 @@
     // type MainID = "id-my_app"
     

    将字符串中的每个字符转换为等效的小写字母

    -

    Capitalize<StringType>

    +

    Capitalize<StringType>

    type LowercaseGreeting = "hello, world";
     type Greeting = Capitalize<LowercaseGreeting>;
     // type Greeting = "Hello, world"
     

    将字符串中的第一个字符转换为等效的大写字母

    -

    Uncapitalize<StringType>

    +

    Uncapitalize<StringType>

    type UppercaseGreeting = "HELLO WORLD";
     type UncomfortableGreeting = Uncapitalize<UppercaseGreeting>;
     // type UncomfortableGreeting = "hELLO WORLD"
     

    将字符串中的第一个字符转换为等效的小写字母

    -

    ReturnType<Type>

    +

    ReturnType<Type>

    declare function f1(): {
       a: number; b: string
     };
    diff --git a/docs/vim.html b/docs/vim.html
    index 1e8fd83f..7d13e385 100644
    --- a/docs/vim.html
    +++ b/docs/vim.html
    @@ -46,7 +46,7 @@
     
     
    ▼/▶ 光标   ▽/▷ 目标
     
    -

    左右动作

    +

    左右动作

    ╭┈┈┈┈┈┈┈┈┈┈┈┈┈ |      
     ├┈┈┈┈┈┈┈┈┈┈┈┈┈ 0      $ ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮
     ┆  ╭┈┈┈┈┈┈┈┈┈┈ ^      fe ┈┈┈┈┈┈┈┈╮       ┆
    @@ -58,7 +58,7 @@
     ▽  ▽  ▽▽ ▽ ▽  ▽▼      ▼▽ ▽ ▽ ▽  ▽▽       ▽
        echo "A cheatsheet from quickReference"
     
    -

    上下动作

    +

    上下动作

                      - SCREEN 1 START
        ╭┈┬┈┈┈┈┈┈┈┈┈▷  #!/usr/bin/python
        ┆ ┆     ╭┈┈┈▷      
    @@ -75,7 +75,7 @@
     ┆                 - SCREEN 1 END
     ╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈▷  print("SCREEN 2")
     
    -

    动作

    +

    动作

    @@ -100,7 +100,7 @@
    快捷方式说明
    h | j | k | l方向键
    <C-u> / <C-d>上/下半页
    <C-b> / <C-f>向上/向下翻页
    -

    字(词)

    +

    字(词)

    @@ -120,7 +120,7 @@
    快捷方式说明
    b / w上一个/下一个单词
    ge / e上一个/下一个词尾
    -

    +

    @@ -140,7 +140,7 @@
    快捷方式说明
    0 (zero) / $行的开始/结束
    ^行开头 (非空白)
    -

    字符串

    +

    字符串

    @@ -164,7 +164,7 @@
    快捷方式说明
    Fe / fe移动到上一个/下一个e
    To / to在上一个/下一个o之前/之后移动
    | / n|转到第一个/n
    -

    文档

    +

    文档

    @@ -188,7 +188,7 @@
    快捷方式说明
    gg / G第一行/最后一行
    :n | nG转到第 n
    } / {下一个/上一个空行
    -

    窗口

    +

    窗口

    @@ -208,7 +208,7 @@
    快捷方式说明
    H / M / L上/中/下屏幕
    zt / zz / zb上/中/下这条线
    -

    插入模式

    +

    插入模式

    @@ -389,7 +389,7 @@
    快捷方式说明
    x删除字符 (剪切)
    p / P在之后/之前粘贴
    xp交换两个字符
    D删除到行尾 (剪切)
    dw删除单词 (剪切)
    dd删除线 (剪切)
    ddp交换两条线
    yy拉线 (复制)
    "*p | "+p从系统剪贴板粘贴
    "*y | "+y粘贴到系统剪贴板
    -

    在可视化模式下

    +

    在可视化模式下

    @@ -413,7 +413,7 @@
    快捷方式说明
    d | x删除选择 (剪切)
    s替换选择
    yYank 选择 (复制)
    -

    重复

    +

    重复

    @@ -1038,7 +1038,7 @@
    快捷方式说明
    :tabe [file]E在新选项卡中编辑文件
    :tabf [file]如果在新选项卡中存在则打开
    :tabcC失去当前选项卡
    :tabo关闭o其他选项卡
    :tabs列出所有标签
    :tabr转到第一个r标签
    :tabl转到 last 选项卡
    :tabm 0转到位置 0
    :tabn转到 next 选项卡
    :tabp转到p上一个标签
    -

    正常模式

    +

    正常模式

    @@ -1061,7 +1061,7 @@
    快捷方式说明
    gt转到 next 选项卡
    gT转到p上一个标签
    2gt转到标签编号 2
    -

    Vim 搜索和替换

    +

    Vim 搜索和替换

    搜索

    diff --git a/docs/vue2.html b/docs/vue2.html index 093ebb7b..2b3ea00b 100644 --- a/docs/vue2.html +++ b/docs/vue2.html @@ -51,10 +51,10 @@

    注意:Vue 2.x 版本对应 Vue Router 3.x 路由版本

    -

    快速创建 Vue 项目 (Vue CLI)

    +

    快速创建 Vue 项目 (Vue CLI)

    npx @vue/cli create hello-world
     
    -

    声明式渲染

    +

    声明式渲染

    <div id="app">
       {{ message }}
     </div>
    @@ -1295,7 +1295,7 @@
     
     
    :-:-
    v-enter定义进入过渡的开始状态 #
    v-enter-active定义进入过渡生效时的状态 #
    v-enter-to (2.1.8)定义进入过渡的结束状态 #
    v-leave定义离开过渡的开始状态 #
    v-leave-active定义离开过渡生效时的状态 #
    v-leave-to (2.1.8)定义离开过渡的结束状态 #

    如果你使用了 <transition name="my-tran">,那么 v-enter 会替换为 my-tran-enter

    -

    自定义过渡的类名

    +

    自定义过渡的类名

    @@ -1339,7 +1339,7 @@ <p v-if="show">hello</p> </transition> -

    显性的过渡持续时间

    +

    显性的过渡持续时间

    <transition> 组件上的 duration prop 定制一个显性的过渡持续时间 (以毫秒计):

    <transition :duration="1000">
       ...
    diff --git a/docs/yaml.html b/docs/yaml.html
    index 616f0550..f507f9b2 100644
    --- a/docs/yaml.html
    +++ b/docs/yaml.html
    @@ -65,7 +65,7 @@
     b: false         # 布尔类型
     d: 2015-04-05    # 日期类型
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "n1": 1,
       "n2": 1.234,
    @@ -77,17 +77,17 @@
     }
     

    使用空格缩进。 元素部分之间必须有空间。

    -

    变量

    +

    变量

    some_thing: &VAR_NAME foobar
     other_thing: *VAR_NAME
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "some_thing": "foobar",
       "other_thing": "foobar"
     }
     
    -

    注释

    +

    注释

    # A single line comment example
     # block level comment example
     # comment line 1
    @@ -99,10 +99,10 @@
       hello
       world
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {"description": "hello\nworld\n"}
     
    -

    继承

    +

    继承

    parent: &defaults
       a: 2
    @@ -111,7 +111,7 @@
       <<: *defaults
       b: 4
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "parent": {
         "a": 2,
    @@ -123,7 +123,7 @@
       }
     }
     
    -

    参考

    +

    参考

    values: &ref
       - Will be
    @@ -132,7 +132,7 @@
     other_values:
       i_am_ref: *ref
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "values": [
         "Will be",
    @@ -146,15 +146,15 @@
       }
     }
     
    -

    折叠的字符串

    +

    折叠的字符串

    description: >
       hello
       world
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {"description": "hello world\n"}
     
    -

    两份文件

    +

    两份文件

    ---
     document: this is doc 1
     ---
    @@ -167,38 +167,38 @@
     - Sammy Sosa
     - Ken Griffey
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    [
       "Mark McGwire",
       "Sammy Sosa",
       "Ken Griffey"
     ]
     
    -

    映射

    +

    映射

    hr:  65       # Home runs
     avg: 0.278    # Batting average
     rbi: 147      # Runs Batted In
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "hr": 65,
       "avg": 0.278,
       "rbi": 147
     }
     
    -

    映射到序列

    +

    映射到序列

    attributes:
       - a1
       - a2
     methods: [getter, setter]
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "attributes": ["a1", "a2"],
       "methods": ["getter", "setter"]
     }
     
    -

    映射序列

    +

    映射序列

    children:
       - name: Jimmy Smith
         age: 15
    @@ -208,7 +208,7 @@
         name: Sammy Sosa
         age: 12
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "children": [
         {"name": "Jimmy Smith", "age": 15},
    @@ -217,7 +217,7 @@
       ]
     }
     
    -

    序列的序列

    +

    序列的序列

    my_sequences:
       - [1, 2, 3]
       - [4, 5, 6]
    @@ -227,7 +227,7 @@
         - 9
         - 0 
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "my_sequences": [
         [1, 2, 3],
    @@ -236,14 +236,14 @@
       ]
     }
     
    -

    映射的映射

    +

    映射的映射

    Mark McGwire: {hr: 65, avg: 0.278}
     Sammy Sosa: {
         hr: 63,
         avg: 0.288
       }
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "Mark McGwire": {
         "hr": 65,
    @@ -255,7 +255,7 @@
       }
     }
     
    -

    嵌套集合

    +

    嵌套集合

    Jack:
       id: 1
       name: Franc
    @@ -265,7 +265,7 @@
         - b
       location: {country: "A", city: "A-A"}
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "Jack": {
         "id": 1,
    @@ -278,26 +278,26 @@
       }
     }
     
    -

    无序集

    +

    无序集

    set1: !!set
       ? one
       ? two
     set2: !!set {'one', "two"}
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "set1": {"one": null, "two": null},
       "set2": {"one": null, "two": null}
     }
     

    集合表示为一个映射,其中每个键都与一个空值相关联

    -

    有序映射

    +

    有序映射

    ordered: !!omap
     - Mark McGwire: 65
     - Sammy Sosa: 63
     - Ken Griffy: 58
     
    -

    ↓ 等效的 JSON

    +

    ↓ 等效的 JSON

    {
       "ordered": [
          {"Mark McGwire": 65},
    @@ -306,7 +306,7 @@
       ]
     }
     
    -

    YAML 参考

    +

    YAML 参考

    条款

    • 序列又名数组或列表
    • @@ -533,14 +533,14 @@
      !!map{Hash table, dictionary, mapping}
      !!seq{List, array, tuple, vector, sequence}
      !!strUnicode 字符串

    转义码

    -

    Numeric

    +

    Numeric

    • \x12 (8-bit)
    • \u1234 (16-bit)
    • \U00102030 (32-bit)
    -

    Protective

    +

    Protective

    • \\ (\)
    • \" (")
    • @@ -548,7 +548,7 @@
    • \<TAB> (TAB)
    -

    C

    +

    C

    • \0 (NUL)
    • \a (BEL)
    • @@ -560,7 +560,7 @@
    • \v (VTAB)
    -

    额外的

    +

    额外的

    • \e (ESC)
    • \_ (NBSP)
    • @@ -569,7 +569,7 @@
    • \P (PS)
    -

    更多类型

    +

    更多类型

    diff --git a/style/style.css b/style/style.css index eb45ddce..5ce73404 100644 --- a/style/style.css +++ b/style/style.css @@ -630,6 +630,8 @@ body:not(.home) .h2wrap-body > .wrap:hover .h3wrap > h3 a::after { .wrap.h3body-exist > .h3wrap-body { flex: 1; + display: flex; + flex-direction: column; } .wrap-header.h3wrap { @@ -658,7 +660,7 @@ body:not(.home) .h2wrap-body > .wrap:hover .h3wrap > h3 a::after { } .wrap-header.h3wrap > .wrap-body p, -.wrap-header.h4wrap > .wrap-body p { +.h3wrap-body p { margin: 0px; width: 100%; padding-left: 1rem; @@ -681,7 +683,8 @@ body:not(.home) .h2wrap-body > .wrap:hover .h3wrap > h3 a::after { border-radius: 0.5rem 0.5rem 0 0; } -.wrap-header.h3wrap > .wrap-body p:not(:first-child):last-child { +.wrap-header.h3wrap > .wrap-body p:not(:first-child):last-child, +.h3wrap-body p:not(:first-child):last-child { margin-top: auto; border-radius: 0 0 0.5rem 0.5rem; } @@ -694,7 +697,9 @@ body:not(.home) .h2wrap-body > .wrap:hover .h3wrap > h3 a::after { flex-direction: column; } -.h4wrap > h4 { +.h3wrap-body > h4, +.h3wrap-body > h5, +.h3wrap-body > h6 { border-color: transparent; background-color: var(--color-neutral-muted); color: var(--color-fg-default); @@ -708,12 +713,12 @@ body:not(.home) .h2wrap-body > .wrap:hover .h3wrap > h3 a::after { text-align: center; } -.h4wrap > .wrap-body ul, -.h4wrap > .wrap-body ol, -.h4wrap > .wrap-body dl, -.h3wrap > .wrap-body ul, -.h3wrap > .wrap-body ol, -.h3wrap > .wrap-body dl { +.h3wrap .wrap-body > ul, +.h3wrap .wrap-body > ol, +.h3wrap .wrap-body > dl, +.h3wrap-body > ul, +.h3wrap-body > ol, +.h3wrap-body > dl { margin-top: 0.5rem; margin-bottom: 0.5rem; display: grid; @@ -721,10 +726,6 @@ body:not(.home) .h2wrap-body > .wrap:hover .h3wrap > h3 a::after { grid-template-columns: repeat(1, minmax(0, 1fr)); } -.h4wrap > .wrap-body ul + hr { - margin-bottom: 0; -} - .h3wrap > .wrap-body ul:not(:last-child), .h3wrap > .wrap-body ol, .h3wrap > .wrap-body dl { @@ -850,7 +851,7 @@ body:not(.home) .h2wrap-body > .wrap:hover .h3wrap > h3 a::after { box-shadow: 0 0 #0000, 0 0 #0000, 0 6px 8px rgba(102, 119, 136, 0.03), 0 1px 2px rgba(102, 119, 136, 0.3); } -.h2wrap-body > .wrap .wrap-body > *:last-child { +.h3wrap-body > *:last-child { border-radius: 0 0 0.5rem 0.5rem; }