<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tools on NEVERMORE</title><link>https://hych0317.github.io/hugoweb_auto/categories/tools/</link><description>Recent content in Tools on NEVERMORE</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><copyright>ychuang</copyright><lastBuildDate>Fri, 15 Nov 2024 14:01:14 +0800</lastBuildDate><atom:link href="https://hych0317.github.io/hugoweb_auto/categories/tools/index.xml" rel="self" type="application/rss+xml"/><item><title>Clash</title><link>https://hych0317.github.io/hugoweb_auto/p/clash/</link><pubDate>Fri, 15 Nov 2024 14:01:14 +0800</pubDate><guid>https://hych0317.github.io/hugoweb_auto/p/clash/</guid><description>&lt;h2 id="clash安装及使用">Clash安装及使用
&lt;/h2>&lt;ol>
&lt;li>
&lt;p>下载Clash for Windows：(&lt;a class="link" href="https://github.com/clashdownload/Clash_for_Windows" target="_blank" rel="noopener"
>https://github.com/clashdownload/Clash_for_Windows&lt;/a>)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>在官网推荐的网站订阅节点（需检查clash core为premium核心/最下面的几个代理开关全部关闭），并复制链接导入配置文件&lt;/p>
&lt;/li>
&lt;li>
&lt;p>启用配置，选择节点，打开主页的系统代理开关。测试是否可用&lt;/p>
&lt;/li>
&lt;li>
&lt;p>在防火墙开放7890端口的接入规则，打开Allow LAN，设置port为7890，本机就可以当作代理服务器使用&lt;/p>
&lt;/li>
&lt;li>
&lt;p>在linux命令行中使用curl --proxy http://本机IPv4地址:7890 &lt;a class="link" href="https://www.google.com" target="_blank" rel="noopener"
>www.google.com&lt;/a>测试是否成功&lt;/p>
&lt;/li>
&lt;li>
&lt;p>在命令行/.sh文件中使用
export http_proxy=http://本机IPv4地址:7890
export https_proxy=https://本机IPv4地址:7890&lt;/p>
&lt;/li>
&lt;li>
&lt;p>在.py文件中使用
os.environ[&amp;lsquo;http_proxy&amp;rsquo;] = &amp;lsquo;http://本机IPv4地址:7890&amp;rsquo;
os.environ[&amp;lsquo;https_proxy&amp;rsquo;] = &amp;lsquo;https://本机IPv4地址:7890&amp;rsquo;&lt;/p>
&lt;/li>
&lt;/ol></description></item><item><title>bash/cmd指令</title><link>https://hych0317.github.io/hugoweb_auto/p/bash/cmd%E6%8C%87%E4%BB%A4/</link><pubDate>Thu, 22 Aug 2024 14:26:16 +0800</pubDate><guid>https://hych0317.github.io/hugoweb_auto/p/bash/cmd%E6%8C%87%E4%BB%A4/</guid><description>&lt;h2 id="ide快捷键">IDE快捷键
&lt;/h2>&lt;ol>
&lt;li>
&lt;p>多光标
Alt + 点击/选中：在多个位置增加光标/选中多个位置
Ctrl + Alt + ↑ / ↓：在上下行增加光标&lt;/p>
&lt;/li>
&lt;li>
&lt;p>列选择（矩形选择）
Alt + Shift + 鼠标框选：选择矩形区域&lt;/p>
&lt;/li>
&lt;li>
&lt;p>选择相同文本
Ctrl + D：选中下一个相同内容
Ctrl + Shift + L：选中所有相同内容&lt;/p>
&lt;/li>
&lt;li>
&lt;p>插入新行
Ctrl + Enter：在当前行下方插入新行&lt;/p>
&lt;/li>
&lt;/ol>
&lt;h2 id="linux">Linux
&lt;/h2>&lt;h3 id="文件操作">文件操作
&lt;/h3>&lt;ul>
&lt;li>ls：列出当前目录下的文件和目录&lt;/li>
&lt;li>cd：切换目录&lt;/li>
&lt;li>mkdir -p &amp;lt;d1/d2&amp;gt;：创建目录（-p：创建多级目录）&lt;/li>
&lt;li>touch：创建文件&lt;/li>
&lt;li>cat：查看文件内容(不如vim)&lt;/li>
&lt;li>echo &amp;ldquo;text&amp;rdquo; &amp;gt; file.txt：将文本&lt;strong>覆盖&lt;/strong>写入文件&lt;/li>
&lt;li>echo &amp;ldquo;text&amp;rdquo; &amp;raquo; file.txt：将文本追加到文件末尾&lt;/li>
&lt;li>grep &lt;path> &amp;ldquo;text&amp;rdquo; filename：在文件中查找指定文本的行&lt;/li>
&lt;li>find . -name &amp;ldquo;filename&amp;rdquo;：在当前目录及子目录中查找文件&lt;/li>
&lt;li>cp：复制文件或目录&lt;/li>
&lt;li>mv：移动或重命名文件或目录&lt;/li>
&lt;li>rsync -av &amp;ndash;progress source/ destination/：同步文件夹（-a：归档模式，保留权限等信息；-v：显示详细信息；&amp;ndash;progress：显示进度）&lt;/li>
&lt;li>rm -rf：删除文件或目录（-r：递归删除文件夹及其下文件；-f：强制删除所有属性的文件，包括只读）&lt;/li>
&lt;li>df -h：查看&lt;strong>磁盘&lt;/strong>使用&lt;/li>
&lt;li>du -sh &amp;ndash;max-depth=1 &lt;directory>：查看&lt;strong>目录&lt;/strong>下总大小&lt;/li>
&lt;/ul>
&lt;h3 id="用户与权限">用户与权限
&lt;/h3>&lt;ul>
&lt;li>sudo：以超级用户身份执行命令&lt;/li>
&lt;li>su：切换用户身份&lt;/li>
&lt;li>chmod：修改文件或目录权限&lt;/li>
&lt;li>who：查看登录用户&lt;/li>
&lt;/ul>
&lt;h3 id="进程管理">进程管理
&lt;/h3>&lt;ul>
&lt;li>ps -ef | grep &lt;PID>:可以查看子父进程之间的关系&lt;/li>
&lt;li>ps -o ppid,cmd -p PID：查看指定进程的父进程和命令&lt;/li>
&lt;li>top [-d -i -p]：实时显示进程信息(-d：更新显示；-i：不显示闲置进程；-p：指定进程ID)&lt;/li>
&lt;li>iotop -oPa：实时显示磁盘I/O使用情况(-o：只显示有I/O的进程；-P：显示累积I/O；-a：显示累计I/O)&lt;/li>
&lt;li>sudo ionice -c 2 -n 0 -p PID：设置进程I/O优先级（-c：调度类，2为最佳努力；-n：优先级，0最高，7最低）&lt;/li>
&lt;li>iostat：显示系统I/O统计信息&lt;/li>
&lt;li>screen：创建会话,保持长期运行的进程&lt;br>
screen [-S &amp;lt;session_name&amp;gt;] &lt;command>:创建会话并运行指令（命名可选）&lt;br>
screen -ls：SSH重连后查看会话&lt;br>
screen -r &amp;lt;session_name&amp;gt;&lt;/li>
&lt;li>kill -s PID：杀死进程&lt;br>
-9:强制杀死进程&lt;br>
-15:正常杀死进程&lt;br>
杀死指定用户进程：kill -9 $(ps -ef | grep user_name)或kill -u user_name&lt;/li>
&lt;/ul>
&lt;h3 id="网络管理">网络管理
&lt;/h3>&lt;ul>
&lt;li>ifconfig：查看网络接口信息&lt;/li>
&lt;li>netstat：查看网络连接信息&lt;/li>
&lt;li>ssh：远程登录&lt;/li>
&lt;li>scp：远程复制文件&lt;/li>
&lt;li>wget：代理下载文件
wget &lt;link> -e &amp;ldquo;https_proxy=http://&amp;rdquo;&lt;/li>
&lt;li>curl：发送HTTP请求
curl &lt;a class="link" href="https://www.google.com" target="_blank" rel="noopener"
>www.google.com&lt;/a> &amp;ndash;proxy http://&lt;/li>
&lt;li>bark通知：
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">requests&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">r&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">requests&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">get&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;https://api.day.app/yPjmWKqbWBcYB4tWbAVk8/&amp;lt;test title&amp;gt;/&amp;lt;test content&amp;gt;/?group=&amp;lt;test group&amp;gt;/?level=timeSensitive&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;/li>
&lt;/ul>
&lt;h3 id="vim">vim
&lt;/h3>&lt;p>vim有两种模式：命令模式和编辑模式。&lt;/p>
&lt;p>命令模式：按下ESC进入命令模式，可以执行命令，如：&lt;/p>
&lt;ul>
&lt;li>i：进入编辑模式&lt;/li>
&lt;li>:q!：强制退出并不保存&lt;/li>
&lt;li>:wq：保存并退出&lt;/li>
&lt;li>:set nu：显示行号&lt;/li>
&lt;li>:set nonu：取消显示行号&lt;/li>
&lt;li>:set hlsearch：高亮搜索结果&lt;/li>
&lt;li>:set nohlsearch：取消高亮搜索结果&lt;/li>
&lt;li>:set fileencoding=utf-8：设置文件编码为utf-8&lt;/li>
&lt;/ul>
&lt;p>编辑模式：按下i进入编辑模式，按下ESC进入命令模式。&lt;/p>
&lt;h2 id="pip">pip
&lt;/h2>&lt;ul>
&lt;li>
&lt;p>pip install &amp;lt;package_name&amp;gt; -i &amp;lt;镜像源&amp;gt; &amp;ndash;proxy=http:// &amp;ndash;no-deps(不自动调整其他包版本)：安装包
镜像源:
-i &lt;a class="link" href="https://pypi.tuna.tsinghua.edu.cn/simple/" target="_blank" rel="noopener"
>https://pypi.tuna.tsinghua.edu.cn/simple/&lt;/a>：清华源
-i &lt;a class="link" href="https://pypi.doubanio.com/simple/" target="_blank" rel="noopener"
>https://pypi.doubanio.com/simple/&lt;/a>：豆瓣源
-i &lt;a class="link" href="https://mirrors.aliyun.com/pypi/simple/" target="_blank" rel="noopener"
>https://mirrors.aliyun.com/pypi/simple/&lt;/a>：阿里云源&lt;/p>
&lt;/li>
&lt;li>
&lt;p>pip uninstall package_name：卸载包&lt;/p>
&lt;/li>
&lt;li>
&lt;p>pip cache purge：清理缓存&lt;/p>
&lt;/li>
&lt;li>
&lt;p>pip list：查看已安装的包&lt;/p>
&lt;/li>
&lt;li>
&lt;p>pip show package_name：查看包信息&lt;/p>
&lt;/li>
&lt;li>
&lt;p>pip check：检查依赖版本是否一致&lt;/p>
&lt;/li>
&lt;li>
&lt;p>pip list &amp;ndash;format=freeze &amp;gt; requirements.txt
按版本号导出依赖（更建议导出conda环境）&lt;/p>
&lt;/li>
&lt;li>
&lt;p>pip install -r requirements.txt：导入依赖
对应conda install &amp;ndash;file requirements.txt&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="conda">Conda
&lt;/h2>&lt;h3 id="环境操作">环境操作
&lt;/h3>&lt;ul>
&lt;li>conda create -n env_name python=xx：创建环境&lt;/li>
&lt;li>conda create -n new_env &amp;ndash;clone copied_env：复制环境
本地复制直接在本地环境文件夹复制并重命名即可&lt;/li>
&lt;li>conda env export &amp;gt; environment.yml：导出环境&lt;/li>
&lt;li>conda env create -f environment.yml：导入环境&lt;/li>
&lt;li>conda env list：查看环境&lt;/li>
&lt;li>conda activate env_name：激活环境&lt;/li>
&lt;li>conda deactivate：退出环境&lt;/li>
&lt;li>conda remove -n env_name &amp;ndash;all：删除环境&lt;/li>
&lt;/ul>
&lt;h3 id="包管理">包管理
&lt;/h3>&lt;ul>
&lt;li>conda list：查看已安装的包&lt;/li>
&lt;li>conda install package_name (-c channel_name)：安装包(从指定源安装)&lt;/li>
&lt;li>conda remove package_name：删除包&lt;/li>
&lt;li>conda search package_name：搜索包&lt;/li>
&lt;li>conda update package_name：更新包&lt;/li>
&lt;/ul>
&lt;h3 id="源管理">源管理
&lt;/h3>&lt;ul>
&lt;li>conda config &amp;ndash;add channels url：添加源&lt;/li>
&lt;li>conda config &amp;ndash;remove channels url：删除源&lt;/li>
&lt;/ul>
&lt;h2 id="docker">Docker
&lt;/h2>&lt;p>镜像是用于创建容器的只读模板。 容器在镜像上添加了一个可写层，是镜像的一个运行实例。&lt;/p>
&lt;h3 id="镜像操作">镜像操作
&lt;/h3>&lt;ul>
&lt;li>docker pull image_name:tag：拉取镜像&lt;/li>
&lt;li>docker images：查看本地镜像&lt;/li>
&lt;li>docker rmi image_id：删除镜像&lt;/li>
&lt;li>docker build -t image_name:tag .：从Dockerfile构建镜像&lt;/li>
&lt;/ul>
&lt;h3 id="容器操作">容器操作
&lt;/h3>&lt;ul>
&lt;li>docker run &amp;lt;-it&amp;gt; &amp;ndash;name container_name image_name:tag -e ENV_VAR=value -p &amp;lt;host_port&amp;gt;:&amp;lt;container_port&amp;gt; /bin/bash：运行容器并进入bash
&lt;ul>
&lt;li>-it：交互式终端&lt;/li>
&lt;li>-d：后台运行&lt;/li>
&lt;li>-e：设置环境变量&lt;/li>
&lt;li>-p：端口映射&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>docker ps -a：查看所有容器 -a会显示已停止的容器&lt;/li>
&lt;li>docker stop container_id：停止容器&lt;/li>
&lt;li>docker start container_id：启动容器&lt;/li>
&lt;li>docker rm container_id：删除容器&lt;/li>
&lt;li>docker exec -it container_id /bin/bash：进入运行中的容器bash&lt;/li>
&lt;/ul></description></item><item><title>Git</title><link>https://hych0317.github.io/hugoweb_auto/p/git/</link><pubDate>Mon, 12 Aug 2024 18:36:30 +0800</pubDate><guid>https://hych0317.github.io/hugoweb_auto/p/git/</guid><description>&lt;h2 id="初始化">初始化
&lt;/h2>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl"> git init
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> git add .
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> git commit -m &lt;span class="s2">&amp;#34;first commit&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> git branch -M main
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> git remote add origin &lt;span class="o">{&lt;/span>你的github仓库地址&lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> git push -u origin main
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="克隆">克隆
&lt;/h2>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl"> git clone &lt;span class="o">{&lt;/span>github仓库地址&lt;span class="o">}&lt;/span> -c http.proxy&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;http://127.0.0.1:7890&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 下载大文件时&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> git lfs install
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> git lfs clone &lt;span class="o">{&lt;/span>github仓库地址&lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="后续上传">后续上传
&lt;/h2>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl"> git add .
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> git commit
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> git push //若要无视pull则添加&lt;span class="o">(&lt;/span>--force&lt;span class="o">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>第一行将修改同步至本地缓存区，第二行将缓存区的修改提交至本地仓库，第三行将本地仓库的修改推送至远端仓库。&lt;/p>
&lt;h2 id="分支">分支
&lt;/h2>&lt;h3 id="建立分支">建立分支
&lt;/h3>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl"> git checkout -b &lt;span class="o">[&lt;/span>branchname&lt;span class="o">]&lt;/span> //git 切换分支 建立并切换至新分支 新分支名
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="推送分支">推送分支
&lt;/h3>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl"> git push origin &lt;span class="o">[&lt;/span>branchname&lt;span class="o">]&lt;/span> //git 推送 远端名称 本地分支名
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="版本回退">版本回退
&lt;/h2>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl"> git log //查看各提交版本
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> git reset &lt;span class="o">[&lt;/span>head~n/commit ID&lt;span class="o">]&lt;/span> --soft/hard //回退n个版本/回退到ID表示的版本
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;blockquote>
&lt;p>详细见：&lt;a class="link" href="https://www.bilibili.com/video/BV14C4y1q78x" target="_blank" rel="noopener"
>https://www.bilibili.com/video/BV14C4y1q78x&lt;/a>&lt;/p>
&lt;/blockquote>
&lt;h3 id="文件回退">文件回退
&lt;/h3>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl"> git checkout &lt;span class="o">[&lt;/span>版本ID&lt;span class="o">]&lt;/span> --文件名
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="gitignore失效">gitignore失效
&lt;/h2>&lt;p>使用git rm (-r) &amp;ndash;cached file_path移除与缓存的连接&lt;/p>
&lt;blockquote>
&lt;p>&lt;a class="link" href="https://www.cnblogs.com/goloving/p/15017769.html" target="_blank" rel="noopener"
>失效解决方法&lt;/a>&lt;/p>
&lt;/blockquote></description></item><item><title>Markdown常用语法</title><link>https://hych0317.github.io/hugoweb_auto/p/markdown%E5%B8%B8%E7%94%A8%E8%AF%AD%E6%B3%95/</link><pubDate>Mon, 12 Aug 2024 14:36:30 +0800</pubDate><guid>https://hych0317.github.io/hugoweb_auto/p/markdown%E5%B8%B8%E7%94%A8%E8%AF%AD%E6%B3%95/</guid><description>&lt;blockquote>
&lt;p>官方语法教程：&lt;a class="link" href="https://markdown.com.cn/basic-syntax/" target="_blank" rel="noopener"
>https://markdown.com.cn/basic-syntax/&lt;/a>&lt;/p>
&lt;/blockquote>
&lt;h2 id="标题">标题
&lt;/h2>&lt;p>（#）数量代表几级标题，数量越小字体越大&lt;/p>
&lt;h2 id="段落">段落
&lt;/h2>&lt;p>使用空白行分割文本，例如：&lt;/p>
&lt;p>此时文本被分段。（注意：段落的首行均不可缩进，以免导致编译错误；分段与换行不同）&lt;/p>
&lt;h2 id="换行">换行
&lt;/h2>&lt;p>不是简单的回车，应在一行的末尾添加两个或多个空格，然后再按回车键(或者使用&lt;br>)。&lt;/p>
&lt;h2 id="强调">强调
&lt;/h2>&lt;p>加粗两边用两个星号（&lt;strong>粗体&lt;/strong>）&lt;br>
加斜两边用一个星号（&lt;em>斜体&lt;/em>）&lt;/p>
&lt;h2 id="引用">引用
&lt;/h2>&lt;p>使用&amp;gt;号，使用&amp;raquo;可以嵌套引用&lt;/p>
&lt;h2 id="列表">列表
&lt;/h2>&lt;p>使用1. 2. 3.进行有序列表&lt;br>
使用星号，破折号-进行无序列表&lt;br>
在列表中缩进tab可以嵌套包括列表项的其它元素，如：&lt;/p>
&lt;ul>
&lt;li>一&lt;/li>
&lt;li>二
&lt;ul>
&lt;li>嵌套1&lt;/li>
&lt;li>嵌套2&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>三
&lt;blockquote>
&lt;p>引用1&lt;/p>
&lt;/blockquote>
&lt;/li>
&lt;li>四&lt;/li>
&lt;/ul>
&lt;h2 id="代码块">代码块
&lt;/h2>&lt;ol>
&lt;li>缩进tab表示代码块&lt;/li>
&lt;li>代码块前后分别用三个反引号```表示，同时可以使用语言标识符指定代码类型，如：&lt;/li>
&lt;/ol>
&lt;p>python代码块：&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">print(&amp;#34;Hello, world!&amp;#34;)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>yaml代码块：&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">links&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">title&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">My GitHub&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">description&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">GitHub is the world&amp;#39;s largest software development platform.&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">website&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">https://github.com&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">image&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>这样可以使用复制粘贴代码块功能，并能高亮显示代码类型。&lt;/p>
&lt;h2 id="图片">图片
&lt;/h2>&lt;pre>&lt;code>![描述](路径 &amp;quot;可选title&amp;quot;)
&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://hych0317.github.io/hugoweb_auto/hugoweb_auto/post/tools/markdown/als.png"
loading="lazy"
alt="example"
>&lt;br>
给图片添加链接&lt;/p>
&lt;pre>&lt;code>[![描述](路径)](链接) //图片链接
&lt;/code>&lt;/pre>
&lt;h2 id="链接">链接
&lt;/h2>&lt;pre>&lt;code>[描述](&amp;lt;网址&amp;gt;) //网址间空格应使用%20替换
&lt;/code>&lt;/pre>
&lt;p>&amp;lt;&amp;gt;使得网址可点击&lt;/p>
&lt;h2 id="数学公式">数学公式
&lt;/h2>&lt;p>使用LaTeX语法，用双美元符号 或 \左括号+\右括号 包裹公式两边，如：&lt;br>
$$公式$$或[公式]
[e^{i\pi}+1=0]&lt;/p></description></item></channel></rss>