🕷️markdown语法笔记

🕷️markdown语法笔记

插入

链接

  1. 行内链接:[显示文本](链接地址 "可选标题")
  2. 引用式链接:
    1
    2
    3
    [显示文本][链接标识]

    [链接标识]: 链接地址 "可选标题"
  3. 直接显示URL:<https://markdown.org>
  4. 图片链接:[![图片替代文本](图片URL)](链接地址)

emoji

  • win + .打开系统自带的emoji搜索
  • emoji中文网等复制粘贴
  • 使用标签符号简码,需要安装Markdown Emoji插件,语法:joy:,效果:joy:。(此方法hexo不支持)
  • fluid主题内置了一些图标,在配置about页的时候用到了,在文档里也可以如<i class="iconfont icon-github-fill"></i>的方式使用,带链接的方式:
    • [<i class="iconfont icon-github-fill"></i>](https://github.com/weimoyo/weimoyo.github.io/tree/gh-source/source/snake)
    • <a href="https://github.com/weimoyo/weimoyo.github.io/tree/gh-source/source/snake)" title="GitHub" target="_blank" rel="noopener noreferrer"><i class="iconfont icon-github-fill"></i></a>
  • fluid内置的图标的便捷使用方式,添加一个图标插件:
    1. 在主题目录的scripts目录里创建一个icon.js,内容如下
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      hexo.extend.tag.register('icon', function(args) {
      const iconClass = args[0];
      const link = args[1];
      const tip = args[2];

      if (!iconClass) {
      return '';
      }

      // 智能判断基础类
      let baseClass = 'iconfont'; // 默认是 iconfont
      if (iconClass.startsWith('fa-')) {
      baseClass = 'fa'; // 如果以 fa- 开头,则是 Font Awesome
      }

      let iconHtml = `<i class="${baseClass} ${iconClass}"></i>`;

      if (link) {
      const titleAttr = tip ? `title="${tip}"` : '';
      iconHtml = `<a href="${link}" ${titleAttr} target="_blank" rel="noopener noreferrer">${iconHtml}</a>`;
      }

      return iconHtml;
      });
    2. 三种使用方式
      • 只显示图标{% icon icon-github-fill %}:
      • 带链接的图标{% icon icon-github-fill https://github.com/weimoyo %}:
      • 带链接和提示的图标{% icon icon-github-fill https://github.com/weimoyo GitHub %}:

拼音

编辑器: VSCode

步骤:

  1. 命令面板=>Snippets: Configure Snippets=>markdown
  2. 使用预先准备的markdown.json
  3. 在setting.json里配置,必须专门配置markdown格式。
    1
    2
    3
    4
    5
    "[markdown]": {
    "editor.quickSuggestions": {
    "other": "on"
    }
    }
  4. Markdown All in One等插件的设置对此没有影响。

🕷️markdown语法笔记
http://lixiang.us.kg/2025/06/16/markdown语法笔记/
作者
lix
发布于
2025年6月16日
许可协议