mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-20 22:17:32 +08:00
feat: add tocs feature & fix page element generation issue (#9). dd8a3cb26d
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<!doctype html><html lang="en" data-color-mode="dark"><head></head><body>
|
||||
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" data-color-mode="dark">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Find 备忘清单
|
||||
& find cheatsheet & Quick Reference</title>
|
||||
@ -9,8 +9,8 @@
|
||||
<meta keywords="Quick,Reference,cheatsheet,find">
|
||||
<link rel="icon" href="data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20height%3D%221em%22%20width%3D%221em%22%3E%20%3Cpath%20d%3D%22m21.66%2010.44-.98%204.18c-.84%203.61-2.5%205.07-5.62%204.77-.5-.04-1.04-.13-1.62-.27l-1.68-.4c-4.17-.99-5.46-3.05-4.48-7.23l.98-4.19c.2-.85.44-1.59.74-2.2%201.17-2.42%203.16-3.07%206.5-2.28l1.67.39c4.19.98%205.47%203.05%204.49%207.23Z%22%20fill%3D%22%23c9d1d9%22%2F%3E%20%3Cpath%20d%3D%22M15.06%2019.39c-.62.42-1.4.77-2.35%201.08l-1.58.52c-3.97%201.28-6.06.21-7.35-3.76L2.5%2013.28c-1.28-3.97-.22-6.07%203.75-7.35l1.58-.52c.41-.13.8-.24%201.17-.31-.3.61-.54%201.35-.74%202.2l-.98%204.19c-.98%204.18.31%206.24%204.48%207.23l1.68.4c.58.14%201.12.23%201.62.27Zm2.43-8.88c-.06%200-.12-.01-.19-.02l-4.85-1.23a.75.75%200%200%201%20.37-1.45l4.85%201.23a.748.748%200%200%201-.18%201.47Z%22%20fill%3D%22%23228e6c%22%20%2F%3E%20%3Cpath%20d%3D%22M14.56%2013.89c-.06%200-.12-.01-.19-.02l-2.91-.74a.75.75%200%200%201%20.37-1.45l2.91.74c.4.1.64.51.54.91-.08.34-.38.56-.72.56Z%22%20fill%3D%22%23228e6c%22%20%2F%3E%20%3C%2Fsvg%3E" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="../style/style.css">
|
||||
|
||||
<nav class="header-nav"><div class="max-container"><a href="../index.html" class="logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em">
|
||||
</head>
|
||||
<body><nav class="header-nav"><div class="max-container"><a href="../index.html" class="logo"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em">
|
||||
<path d="m21.66 10.44-.98 4.18c-.84 3.61-2.5 5.07-5.62 4.77-.5-.04-1.04-.13-1.62-.27l-1.68-.4c-4.17-.99-5.46-3.05-4.48-7.23l.98-4.19c.2-.85.44-1.59.74-2.2 1.17-2.42 3.16-3.07 6.5-2.28l1.67.39c4.19.98 5.47 3.05 4.49 7.23Z" fill="#c9d1d9"></path>
|
||||
<path d="M15.06 19.39c-.62.42-1.4.77-2.35 1.08l-1.58.52c-3.97 1.28-6.06.21-7.35-3.76L2.5 13.28c-1.28-3.97-.22-6.07 3.75-7.35l1.58-.52c.41-.13.8-.24 1.17-.31-.3.61-.54 1.35-.74 2.2l-.98 4.19c-.98 4.18.31 6.24 4.48 7.23l1.68.4c.58.14 1.12.23 1.62.27Zm2.43-8.88c-.06 0-.12-.01-.19-.02l-4.85-1.23a.75.75 0 0 1 .37-1.45l4.85 1.23a.748.748 0 0 1-.18 1.47Z" fill="#228e6c"></path>
|
||||
<path d="M14.56 13.89c-.06 0-.12-.01-.19-.02l-2.91-.74a.75.75 0 0 1 .37-1.45l2.91.74c.4.1.64.51.54.91-.08.34-.38.56-.72.56Z" fill="#228e6c"></path>
|
||||
@ -37,7 +37,9 @@
|
||||
</script><a href="https://github.com/jaywcjlove/reference" class="" target="__blank"><svg viewBox="0 0 16 16" fill="currentColor" height="1em" width="1em"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg></a></div></div></nav><div class="wrap max-container"><header class="wrap-header h1wrap"><h1 id="find-备忘清单"><svg viewBox="0 0 1024 1024" fill="currentColor" xmlns="http://www.w3.org/2000/svg" height="1em" width="1em"><path d="M384 554.666667C384 625.493333 441.173333 682.666667 512 682.666667 582.826667 682.666667 640 625.493333 640 554.666667 640 483.84 582.826667 426.666667 512 426.666667 441.173333 426.666667 384 483.84 384 554.666667M853.333333 835.84 853.333333 341.333333 597.333333 85.333333 256 85.333333C209.066667 85.333333 170.666667 123.733333 170.666667 170.666667L170.666667 853.333333C170.666667 900.266667 209.066667 938.666667 256 938.666667L768 938.666667C787.2 938.666667 804.266667 932.266667 818.773333 921.6L629.76 732.586667C595.626667 754.773333 554.666667 768 512 768 394.24 768 298.666667 672.426667 298.666667 554.666667 298.666667 436.906667 394.24 341.333333 512 341.333333 629.76 341.333333 725.333333 436.906667 725.333333 554.666667 725.333333 597.333333 712.106667 638.293333 689.92 672L853.333333 835.84Z"></path>
|
||||
</svg><a aria-hidden="true" tabindex="-1" href="#find-备忘清单"><span class="icon icon-link"></span></a>Find 备忘清单</h1><div class="wrap-body">
|
||||
<p>这是 Linux find 命令备忘清单的快速参考列表,包含常用选项和示例。</p>
|
||||
</div></header><div class="h1wrap-body"><div class="wrap"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
||||
</div></header><div class="menu-tocs"><div class="menu-btn"><svg aria-hidden="true" fill="currentColor" height="1em" width="1em" viewBox="0 0 16 16" version="1.1" data-view-component="true">
|
||||
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
|
||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" href="#用法">用法</a><a aria-hidden="true" class="leve3 tocs-link" href="#参数示例">参数示例</a><a aria-hidden="true" class="leve3 tocs-link" href="#类型">类型</a><a aria-hidden="true" class="leve3 tocs-link" href="#大小">大小</a><a aria-hidden="true" class="leve3 tocs-link" href="#大小--">大小 +/-</a><a aria-hidden="true" class="leve3 tocs-link" href="#名称">名称</a><a aria-hidden="true" class="leve3 tocs-link" href="#权限">权限</a><a aria-hidden="true" class="leve3 tocs-link" href="#所有者和组">所有者和组</a><a aria-hidden="true" class="leve3 tocs-link" href="#多个文件名">多个文件名</a><a aria-hidden="true" class="leve3 tocs-link" href="#多个目录">多个目录</a><a aria-hidden="true" class="leve3 tocs-link" href="#空的">空的</a><a aria-hidden="true" class="leve2 tocs-link" href="#查找日期和时间">查找日期和时间</a><a aria-hidden="true" class="leve3 tocs-link" href="#方法">方法</a><a aria-hidden="true" class="leve4 tocs-link" href="#示例">示例</a><a aria-hidden="true" class="leve3 tocs-link" href="#更多示例">更多示例</a><a aria-hidden="true" class="leve2 tocs-link" href="#查找并">查找并</a><a aria-hidden="true" class="leve3 tocs-link" href="#查找和删除">查找和删除</a><a aria-hidden="true" class="leve3 tocs-link" href="#查找和替换">查找和替换</a><a aria-hidden="true" class="leve3 tocs-link" href="#查找和重命名">查找和重命名</a><a aria-hidden="true" class="leve3 tocs-link" href="#查找和移动">查找和移动</a><a aria-hidden="true" class="leve3 tocs-link" href="#查找和复制">查找和复制</a><a aria-hidden="true" class="leve3 tocs-link" href="#查找并连接">查找并连接</a><a aria-hidden="true" class="leve3 tocs-link" href="#查找和排序">查找和排序</a><a aria-hidden="true" class="leve3 tocs-link" href="#查找和-chmod">查找和 chmod</a><a aria-hidden="true" class="leve3 tocs-link" href="#查找并-tar">查找并 tar</a></div></div><div class="h1wrap-body"><div class="wrap"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
||||
</div></div><div class="h2wrap-body"><div class="wrap"><div class="wrap-header h3wrap"><h3 id="用法"><a aria-hidden="true" tabindex="-1" href="#用法"><span class="icon icon-link"></span></a>用法</h3><div class="wrap-body">
|
||||
<pre class="language-shell"><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> <span class="token punctuation">[</span>path<span class="token punctuation">..</span>.<span class="token punctuation">]</span> <span class="token punctuation">[</span>options<span class="token punctuation">]</span> <span class="token punctuation">[</span>expression<span class="token punctuation">]</span>
|
||||
</span></code></pre>
|
||||
@ -248,12 +250,12 @@
|
||||
<pre class="language-shell"><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> /home <span class="token parameter variable">-user</span> tecmint <span class="token parameter variable">-iname</span> <span class="token string">"*.txt"</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="多个文件名"><a aria-hidden="true" tabindex="-1" href="#多个文件名"><span class="icon icon-link"></span></a>多个文件名</h3><div class="wrap-body">
|
||||
<pre class="wrap-text"><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> <span class="token builtin class-name">.</span> <span class="token parameter variable">-type</span> f <span class="token punctuation">\</span><span class="token punctuation">(</span> <span class="token parameter variable">-name</span> <span class="token string">"*.sh"</span> <span class="token parameter variable">-o</span> <span class="token parameter variable">-name</span> <span class="token string">"*.txt"</span> <span class="token punctuation">\</span><span class="token punctuation">)</span>
|
||||
<pre class="wrap-text "><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> <span class="token builtin class-name">.</span> <span class="token parameter variable">-type</span> f <span class="token punctuation">\</span><span class="token punctuation">(</span> <span class="token parameter variable">-name</span> <span class="token string">"*.sh"</span> <span class="token parameter variable">-o</span> <span class="token parameter variable">-name</span> <span class="token string">"*.txt"</span> <span class="token punctuation">\</span><span class="token punctuation">)</span>
|
||||
</span></code></pre>
|
||||
<!--rehype:className=wrap-text -->
|
||||
<p>查找带有 <code>.sh</code> 和 <code>.txt</code> 扩展名的文件</p>
|
||||
</div></div></div><div class="wrap"><div class="wrap-header h3wrap"><h3 id="多个目录"><a aria-hidden="true" tabindex="-1" href="#多个目录"><span class="icon icon-link"></span></a>多个目录</h3><div class="wrap-body">
|
||||
<pre class="wrap-text"><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> /opt /usr /var <span class="token parameter variable">-name</span> foo.scala <span class="token parameter variable">-type</span> f
|
||||
<pre class="wrap-text "><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> /opt /usr /var <span class="token parameter variable">-name</span> foo.scala <span class="token parameter variable">-type</span> f
|
||||
</span></code></pre>
|
||||
<!--rehype:className=wrap-text -->
|
||||
<p>查找具有多个目录的文件</p>
|
||||
@ -423,6 +425,7 @@
|
||||
if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) {
|
||||
window.onhashchange = function () {
|
||||
anchorPoint()
|
||||
updateAnchor()
|
||||
};
|
||||
}
|
||||
function anchorPoint() {
|
||||
@ -436,6 +439,25 @@ function anchorPoint() {
|
||||
}
|
||||
}
|
||||
anchorPoint();
|
||||
</script>
|
||||
|
||||
</body></html>
|
||||
function updateAnchor(element) {
|
||||
const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link');
|
||||
anchorContainer.forEach((tocanchor) => {
|
||||
tocanchor.classList.remove('is-active-link');
|
||||
});
|
||||
const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`);
|
||||
console.log('anchor', anchor)
|
||||
if (anchor) {
|
||||
anchor.classList.add('is-active-link');
|
||||
}
|
||||
}
|
||||
// toc 定位
|
||||
updateAnchor()
|
||||
const anchor = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link');
|
||||
anchor.forEach((item) => {
|
||||
item.addEventListener('click', (e) => {
|
||||
updateAnchor()
|
||||
})
|
||||
})
|
||||
</script></body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user