彩色代码块

设置 child: codeblock 并设置 color: 颜色枚举 可以实现 10 种不同颜色的代码块,彩色代码块一般可以用在代码正确与错误的示范对比场景。

推荐的写法

codeblock green

func test() {
// ...
}

不推荐的写法

codeblock red

func test() -> () {
// ...
}

页脚增加网页运行时间

  content: | # 支持 Markdown 格式
    <center>
    </br>
    </br>
    <script type="text/javascript">
    function show_runtime() {
        window.setTimeout("show_runtime()", 1000);
        X = new Date("10/20/2023 00:00:00");
        Y = new Date();
        T = (Y.getTime() - X.getTime());
        M = 24 * 60 * 60 * 1000;
        a = T / M;
        A = Math.floor(a);
        b = (a - A) * 24;
        B = Math.floor(b);
        c = (b - B) * 60;
        C = Math.floor((b - B) * 60);
        D = Math.floor((c - C) * 60);
        runtime_span.innerHTML = "⏲️本站已运行 " + A + "天|" + B + "小时|" + C + "分|" + D + "秒⏲️"
    }
    show_runtime();
    </script>
    <span id="runtime_span"></span>
    </center>

添加页面动态线条

<!--动态线条背景-->
<script type="text/javascript"
  color="220,220,220" opacity='0.7' zIndex="-2" count="200" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js">
</script>

测试音频标签

图标测试

一、超长代码块增加滚动条

首先判断代码块是否过长,如果是,则设置最大高度并开启滚动。

新建 source/js/adjust-codeblock-height.js,添加以下内容:

// adjust-code-block-height.js
document.addEventListener("DOMContentLoaded", function() {
// 选择所有的.md-text元素
var codeBlocks = document.querySelectorAll('.md-text');
// 遍历每个.md-text元素
codeBlocks.forEach(function(block) {
// 检查是否包含.highlight类的子元素,且父元素高度超过500px
var highlightBlocks = block.querySelectorAll('.highlight');
highlightBlocks.forEach(function(highlightBlock) {
if (highlightBlock.clientHeight > 800) {
highlightBlock.style.maxHeight = '300px';
highlightBlock.style.overflow = 'auto';
}
});
});
});

以上代码代表如果代码框高度超过 800px,则开启折叠,折叠框最大高度为 300px。其中,可自行设置判断阈值 if (highlightBlock.clientHeight > 800) { 以及折叠后最大高度 highlightBlock.style.maxHeight = '300px';

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.rocketmq.remoting.netty;

import io.netty.channel.Channel;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.rocketmq.remoting.InvokeCallback;
import org.apache.rocketmq.remoting.common.SemaphoreReleaseOnlyOnce;
import org.apache.rocketmq.remoting.protocol.RemotingCommand;

public class ResponseFuture {
private final int opaque;
private final Channel processChannel;
private final long timeoutMillis;
private final InvokeCallback invokeCallback;
private final long beginTimestamp = System.currentTimeMillis();
private final CountDownLatch countDownLatch = new CountDownLatch(1);

private final SemaphoreReleaseOnlyOnce once;

private final AtomicBoolean executeCallbackOnlyOnce = new AtomicBoolean(false);
private volatile RemotingCommand responseCommand;
private volatile boolean sendRequestOK = true;
private volatile Throwable cause;

public ResponseFuture(Channel channel, int opaque, long timeoutMillis, InvokeCallback invokeCallback,
SemaphoreReleaseOnlyOnce once) {
this.opaque = opaque;
this.processChannel = channel;
this.timeoutMillis = timeoutMillis;
this.invokeCallback = invokeCallback;
this.once = once;
}

public void executeInvokeCallback() {
if (invokeCallback != null) {
if (this.executeCallbackOnlyOnce.compareAndSet(false, true)) {
invokeCallback.operationComplete(this);
}
}
}

public void release() {
if (this.once != null) {
this.once.release();
}
}

public boolean isTimeout() {
long diff = System.currentTimeMillis() - this.beginTimestamp;
return diff > this.timeoutMillis;
}

public RemotingCommand waitResponse(final long timeoutMillis) throws InterruptedException {
this.countDownLatch.await(timeoutMillis, TimeUnit.MILLISECONDS);
return this.responseCommand;
}

public void putResponse(final RemotingCommand responseCommand) {
this.responseCommand = responseCommand;
this.countDownLatch.countDown();
}

public long getBeginTimestamp() {
return beginTimestamp;
}

public boolean isSendRequestOK() {
return sendRequestOK;
}

public void setSendRequestOK(boolean sendRequestOK) {
this.sendRequestOK = sendRequestOK;
}

public long getTimeoutMillis() {
return timeoutMillis;
}

public InvokeCallback getInvokeCallback() {
return invokeCallback;
}

public Throwable getCause() {
return cause;
}

public void setCause(Throwable cause) {
this.cause = cause;
}

public RemotingCommand getResponseCommand() {
return responseCommand;
}

public void setResponseCommand(RemotingCommand responseCommand) {
this.responseCommand = responseCommand;
}

public int getOpaque() {
return opaque;
}

public Channel getProcessChannel() {
return processChannel;
}

@Override
public String toString() {
return "ResponseFuture [responseCommand=" + responseCommand
+ ", sendRequestOK=" + sendRequestOK
+ ", cause=" + cause
+ ", opaque=" + opaque
+ ", processChannel=" + processChannel
+ ", timeoutMillis=" + timeoutMillis
+ ", invokeCallback=" + invokeCallback
+ ", beginTimestamp=" + beginTimestamp
+ ", countDownLatch=" + countDownLatch + "]";
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.rocketmq.remoting.netty;

import io.netty.channel.Channel;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.rocketmq.remoting.InvokeCallback;
import org.apache.rocketmq.remoting.common.SemaphoreReleaseOnlyOnce;
import org.apache.rocketmq.remoting.protocol.RemotingCommand;

public class ResponseFuture {
private final int opaque;
private final Channel processChannel;
private final long timeoutMillis;
private final InvokeCallback invokeCallback;
private final long beginTimestamp = System.currentTimeMillis();
private final CountDownLatch countDownLatch = new CountDownLatch(1);

private final SemaphoreReleaseOnlyOnce once;

private final AtomicBoolean executeCallbackOnlyOnce = new AtomicBoolean(false);
private volatile RemotingCommand responseCommand;
private volatile boolean sendRequestOK = true;
private volatile Throwable cause;

public ResponseFuture(Channel channel, int opaque, long timeoutMillis, InvokeCallback invokeCallback,
SemaphoreReleaseOnlyOnce once) {
this.opaque = opaque;
this.processChannel = channel;
this.timeoutMillis = timeoutMillis;
this.invokeCallback = invokeCallback;
this.once = once;
}

public void executeInvokeCallback() {
if (invokeCallback != null) {
if (this.executeCallbackOnlyOnce.compareAndSet(false, true)) {
invokeCallback.operationComplete(this);
}
}
}

public void release() {
if (this.once != null) {
this.once.release();
}
}

public boolean isTimeout() {
long diff = System.currentTimeMillis() - this.beginTimestamp;
return diff > this.timeoutMillis;
}

public RemotingCommand waitResponse(final long timeoutMillis) throws InterruptedException {
this.countDownLatch.await(timeoutMillis, TimeUnit.MILLISECONDS);
return this.responseCommand;
}

public void putResponse(final RemotingCommand responseCommand) {
this.responseCommand = responseCommand;
this.countDownLatch.countDown();
}

public long getBeginTimestamp() {
return beginTimestamp;
}

public boolean isSendRequestOK() {
return sendRequestOK;
}

public void setSendRequestOK(boolean sendRequestOK) {
this.sendRequestOK = sendRequestOK;
}

public long getTimeoutMillis() {
return timeoutMillis;
}

public InvokeCallback getInvokeCallback() {
return invokeCallback;
}

public Throwable getCause() {
return cause;
}

public void setCause(Throwable cause) {
this.cause = cause;
}

public RemotingCommand getResponseCommand() {
return responseCommand;
}

public void setResponseCommand(RemotingCommand responseCommand) {
this.responseCommand = responseCommand;
}

public int getOpaque() {
return opaque;
}

public Channel getProcessChannel() {
return processChannel;
}

@Override
public String toString() {
return "ResponseFuture [responseCommand=" + responseCommand
+ ", sendRequestOK=" + sendRequestOK
+ ", cause=" + cause
+ ", opaque=" + opaque
+ ", processChannel=" + processChannel
+ ", timeoutMillis=" + timeoutMillis
+ ", invokeCallback=" + invokeCallback
+ ", beginTimestamp=" + beginTimestamp
+ ", countDownLatch=" + countDownLatch + "]";
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.rocketmq.remoting.netty;

import io.netty.channel.Channel;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.rocketmq.remoting.InvokeCallback;
import org.apache.rocketmq.remoting.common.SemaphoreReleaseOnlyOnce;
import org.apache.rocketmq.remoting.protocol.RemotingCommand;

public class ResponseFuture {
private final int opaque;
private final Channel processChannel;
private final long timeoutMillis;
private final InvokeCallback invokeCallback;
private final long beginTimestamp = System.currentTimeMillis();
private final CountDownLatch countDownLatch = new CountDownLatch(1);

private final SemaphoreReleaseOnlyOnce once;

private final AtomicBoolean executeCallbackOnlyOnce = new AtomicBoolean(false);
private volatile RemotingCommand responseCommand;
private volatile boolean sendRequestOK = true;
private volatile Throwable cause;

public ResponseFuture(Channel channel, int opaque, long timeoutMillis, InvokeCallback invokeCallback,
SemaphoreReleaseOnlyOnce once) {
this.opaque = opaque;
this.processChannel = channel;
this.timeoutMillis = timeoutMillis;
this.invokeCallback = invokeCallback;
this.once = once;
}

public void executeInvokeCallback() {
if (invokeCallback != null) {
if (this.executeCallbackOnlyOnce.compareAndSet(false, true)) {
invokeCallback.operationComplete(this);
}
}
}

public void release() {
if (this.once != null) {
this.once.release();
}
}

public boolean isTimeout() {
long diff = System.currentTimeMillis() - this.beginTimestamp;
return diff > this.timeoutMillis;
}

public RemotingCommand waitResponse(final long timeoutMillis) throws InterruptedException {
this.countDownLatch.await(timeoutMillis, TimeUnit.MILLISECONDS);
return this.responseCommand;
}

public void putResponse(final RemotingCommand responseCommand) {
this.responseCommand = responseCommand;
this.countDownLatch.countDown();
}

public long getBeginTimestamp() {
return beginTimestamp;
}

public boolean isSendRequestOK() {
return sendRequestOK;
}

public void setSendRequestOK(boolean sendRequestOK) {
this.sendRequestOK = sendRequestOK;
}

public long getTimeoutMillis() {
return timeoutMillis;
}

public InvokeCallback getInvokeCallback() {
return invokeCallback;
}

public Throwable getCause() {
return cause;
}

public void setCause(Throwable cause) {
this.cause = cause;
}

public RemotingCommand getResponseCommand() {
return responseCommand;
}

public void setResponseCommand(RemotingCommand responseCommand) {
this.responseCommand = responseCommand;
}

public int getOpaque() {
return opaque;
}

public Channel getProcessChannel() {
return processChannel;
}

@Override
public String toString() {
return "ResponseFuture [responseCommand=" + responseCommand
+ ", sendRequestOK=" + sendRequestOK
+ ", cause=" + cause
+ ", opaque=" + opaque
+ ", processChannel=" + processChannel
+ ", timeoutMillis=" + timeoutMillis
+ ", invokeCallback=" + invokeCallback
+ ", beginTimestamp=" + beginTimestamp
+ ", countDownLatch=" + countDownLatch + "]";
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.rocketmq.remoting.netty;

import io.netty.channel.Channel;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.rocketmq.remoting.InvokeCallback;
import org.apache.rocketmq.remoting.common.SemaphoreReleaseOnlyOnce;
import org.apache.rocketmq.remoting.protocol.RemotingCommand;

public class ResponseFuture {
private final int opaque;
private final Channel processChannel;
private final long timeoutMillis;
private final InvokeCallback invokeCallback;
private final long beginTimestamp = System.currentTimeMillis();
private final CountDownLatch countDownLatch = new CountDownLatch(1);

private final SemaphoreReleaseOnlyOnce once;

private final AtomicBoolean executeCallbackOnlyOnce = new AtomicBoolean(false);
private volatile RemotingCommand responseCommand;
private volatile boolean sendRequestOK = true;
private volatile Throwable cause;

public ResponseFuture(Channel channel, int opaque, long timeoutMillis, InvokeCallback invokeCallback,
SemaphoreReleaseOnlyOnce once) {
this.opaque = opaque;
this.processChannel = channel;
this.timeoutMillis = timeoutMillis;
this.invokeCallback = invokeCallback;
this.once = once;
}

public void executeInvokeCallback() {
if (invokeCallback != null) {
if (this.executeCallbackOnlyOnce.compareAndSet(false, true)) {
invokeCallback.operationComplete(this);
}
}
}

public void release() {
if (this.once != null) {
this.once.release();
}
}

public boolean isTimeout() {
long diff = System.currentTimeMillis() - this.beginTimestamp;
return diff > this.timeoutMillis;
}

public RemotingCommand waitResponse(final long timeoutMillis) throws InterruptedException {
this.countDownLatch.await(timeoutMillis, TimeUnit.MILLISECONDS);
return this.responseCommand;
}

public void putResponse(final RemotingCommand responseCommand) {
this.responseCommand = responseCommand;
this.countDownLatch.countDown();
}

public long getBeginTimestamp() {
return beginTimestamp;
}

public boolean isSendRequestOK() {
return sendRequestOK;
}

public void setSendRequestOK(boolean sendRequestOK) {
this.sendRequestOK = sendRequestOK;
}

public long getTimeoutMillis() {
return timeoutMillis;
}

public InvokeCallback getInvokeCallback() {
return invokeCallback;
}

public Throwable getCause() {
return cause;
}

public void setCause(Throwable cause) {
this.cause = cause;
}

public RemotingCommand getResponseCommand() {
return responseCommand;
}

public void setResponseCommand(RemotingCommand responseCommand) {
this.responseCommand = responseCommand;
}

public int getOpaque() {
return opaque;
}

public Channel getProcessChannel() {
return processChannel;
}

@Override
public String toString() {
return "ResponseFuture [responseCommand=" + responseCommand
+ ", sendRequestOK=" + sendRequestOK
+ ", cause=" + cause
+ ", opaque=" + opaque
+ ", processChannel=" + processChannel
+ ", timeoutMillis=" + timeoutMillis
+ ", invokeCallback=" + invokeCallback
+ ", beginTimestamp=" + beginTimestamp
+ ", countDownLatch=" + countDownLatch + "]";
}
}

二、表情速查

  1. blobcat
https://cdn.jsdelivr.net/gh/infinitesum/Twikoo-emoji@master/blobcatplus.json
表情 索引 表情 索引 表情 索引
ablobcatheart
ablobcatheartbroken
blobcatheart
blobcatheartpride
blobcatlove
blobcatkissheart
blobcatsnuggle
comfyuee
comfyslep
blobcatcomfysweat
blobcatcomftears
blobcatfacepalm
blobcat0_0
blobcatangry
blobbanhammerr
blobcatt
blobcatblush
blobcatcoffee
blobcatcry
blobcatdead
blobcatdied
blobcatdisturbed
blobcatfearful
blobcatfingerguns
blobcatflip
blobcatflower
blobcatgay
blobcatgooglycry
blobcatneutral
blobcatopenmouth
blobcatsadreach
blobcatscared
blobcatnomblobcat
blobcatpresentred
blobcatread
blobcatsipsweat
blobcatsnapped
blobcatthink
blobcattriumph
blobcatumm
blobcatverified
blobcatbox
blobcatcaged
blobcatgooglytrash
blobcatheadphones
blobcathighfive
blobcatmelt
blobcatmeltthumb
blobcatnotlikethis
blobcatsaitama
blobcatyandere
blobcatpeek2
blobcatpeekaboo
blobcatphoto
ablobcatattentionreverse
ablobcatreachrev
ablobcatwave
blobcatalt
blobcatpolice
blobcatshocked
ablobcatrainbow
A_BlobCat_REEEE
A_BlobCat_Code
ablobcatknitsweats
A_BlobCat_Nervous
blobcat-aww
ablobcatcry
ablobcatdead
  1. azuki
https://cdn.jsdelivr.net/gh/infinitesum/Twikoo-emoji@master/xiaodouni.json
表情 索引 表情 索引 表情 索引
001
015
029
002
016
030
003
017
031
004
018
032
005
019
033
006
020
034
007
021
035
008
022
036
009
023
037
010
024
038
011
025
039
012
026
040
013
027
014
028
  1. neko
https://cdn.jsdelivr.net/gh/infinitesum/Twikoo-emoji@master/neko.json
表情 索引 表情 索引 表情 索引
001
015
028
002
016
029
003
017
030
004
018
031
005
019
032
006
020
033
007
021
034
008
022
035
009
023
036
010
024
037
011
025
038
012
026
039
013
027
014
  1. dokomo
https://raw.githubusercontent.com/infinitesum/Twikoo-emoji/main/dokomo/dokomo.json
表情 索引 表情 索引 表情 索引
dokomo-1
dokomo-18
dokomo-35
dokomo-2
dokomo-19
dokomo-36
dokomo-3
dokomo-20
dokomo-37
dokomo-4
dokomo-21
dokomo-38
dokomo-5
dokomo-22
dokomo-39
dokomo-6
dokomo-23
dokomo-40
dokomo-7
dokomo-24
dokomo-41
dokomo-8
dokomo-25
dokomo-42
dokomo-9
dokomo-26
dokomo-43
dokomo-10
dokomo-27
dokomo-44
dokomo-11
dokomo-28
dokomo-45
dokomo-12
dokomo-29
dokomo-46
dokomo-13
dokomo-30
dokomo-47
dokomo-14
dokomo-31
dokomo-48
dokomo-15
dokomo-32
dokomo-49
dokomo-16
dokomo-33
dokomo-17
dokomo-34

本站由 卡卡龙 使用 Stellar 1.33.1主题创建

本站访问量 次. 本文阅读量 次.