Skip to content

Blog

Note tools

笔记工具的选择

这是一个信息爆炸的时代,选择合适的信息/知识管理工具能让自己工作事半功倍。下面说说我对于各种笔记工具的选择和用途:

  • OneNote:硕士的时候的主力笔记,发现读博时候我很少复制笔记进去了。目前闲置,打算用来做网页剪辑收藏。
  • Flomo:记录自己的心情、想法、碎碎念、稍后阅读。因为在手机上,所以很方便。
  • Apple Notes:工作以外的知识储备库,有很多个人信息在里面,所以不方便分享。
  • Obsidian:它是可以分好多Vault的,但目前只想把生信笔记这个和科研相关的仔细记录。
  • guoyingwei.github.io:之前的博客网站,感觉和notes仓库功能重叠,打算废弃。或者只用来记录生活,这些博客的缺点就是手机上写作不方便,必须用电脑。
  • Markdown-materials:在github上创建了一个notes仓库,用VScode进行同时管理,blog,notes和obsidian的笔记。初步打算,notes主体用来放置obsidian里面想要发布的笔记,里面的博客模块用来替代上面blog的内容。

Encrypt

mkdocs encrypt

本文介绍通过调用mkdocs-encryptcontent-plugin插件进行mkdocs界面的加密

Install

pip install mkdocs-encryptcontent-plugin

mkdocs.yml中添加以下配置:

Text Only
plugins:
    - search: {}
    - encryptcontent: {}

Usuage

Add an meta tag password: secret_password in your markdown files to protect them.

Add global_password: your_password in plugin configuration variable, to protect all pages with this password by default

Text Only
  - encryptcontent: 
      password_button: True
      global_password: 'password'

If the password meta tag is defined in a markdown file, it will ALWAYS override the global password.

扩展markdown功能

Warning

这里的语法并不是Markdown通用语法,其它主题或软件可能并不支持,慎用!

content tabs

Configuration

This configuration enables content tabs, and allows to nest arbitrary content inside content tabs, including code blocks and ... more content tabs! Add the following lines to mkdocs.yml:

Text Only
markdown_extensions:
  - pymdownx.superfences
  - pymdownx.tabbed:
      alternate_style: true

Usage

Grouping code blocks

Code blocks are one of the primary targets to be grouped, and can be considered a special case of content tabs, as tabs with a single code block are always rendered without horizontal spacing:

Content tabs with code blocks
=== "C"

    ``` c
    #include <stdio.h>

    int main(void) {
      printf("Hello world!\n");
      return 0;
    }
    ```

=== "C++"

    ``` c++
    #include <iostream>

    int main(void) {
      std::cout << "Hello world!" << std::endl;
      return 0;
    }
    ```
C
#include <stdio.h>

int main(void) {
  printf("Hello world!\n");
  return 0;
}
C++
#include <iostream>

int main(void) {
  std::cout << "Hello world!" << std::endl;
  return 0;
}
Grouping other content
Content tabs
=== "Unordered list"

    * Sed sagittis eleifend rutrum
    * Donec vitae suscipit est
    * Nulla tempor lobortis orci

=== "Ordered list"

    1. Sed sagittis eleifend rutrum
    2. Donec vitae suscipit est
    3. Nulla tempor lobortis orci
  • Sed sagittis eleifend rutrum
  • Donec vitae suscipit est
  • Nulla tempor lobortis orci
  1. Sed sagittis eleifend rutrum
  2. Donec vitae suscipit est
  3. Nulla tempor lobortis orci
Embedded content
Content tabs in admonition
!!! example

    === "Unordered List"

        ``` markdown
        * Sed sagittis eleifend rutrum
        * Donec vitae suscipit est
        * Nulla tempor lobortis orci
        ```

    === "Ordered List"

        ``` markdown
        1. Sed sagittis eleifend rutrum
        2. Donec vitae suscipit est
        3. Nulla tempor lobortis orci
        ```

Example

Markdown
* Sed sagittis eleifend rutrum
* Donec vitae suscipit est
* Nulla tempor lobortis orci
Markdown
1. Sed sagittis eleifend rutrum
2. Donec vitae suscipit est
3. Nulla tempor lobortis orci

Admonitions

Demo

mkdocs支持Admonitions,在网页上显示类似警告信息。

Admonition

Action is the antidote to despair.

Text Only
???+ note "Admonition"
    Action is the antidote to despair.
Quote
  • Adding a + after the ??? token renders the block expanded

  • 通过缩进控制Tab和Admonition结构

Supported types

Note

Action is the antidote to despair.

Abstract

Action is the antidote to despair.

Info

Action is the antidote to despair.

Tip

Action is the antidote to despair.

Success

Action is the antidote to despair.

Question

Action is the antidote to despair.

Warning

Action is the antidote to despair.

Failure

Action is the antidote to despair.

Danger

Action is the antidote to despair.

Bug

Action is the antidote to despair.

Example

Action is the antidote to despair.

Quote

Action is the antidote to despair.

blog和note的url, title, header的关系说明

Blog

blog部分post URL是可以自定义的,目前的设置的post_url_format: "{slug}",通过header部分的slug可以自定义slug信息。

Note

note部分, 不添加title属性,不包含一级标题的话,url显示md文件名,导航显示文件名,标题显示文件名。 不添加title属性,包含一级标题的话,url显示md文件名,导航显示一级标题,标题显示一级标题。 添加title属性,不包含一级标题的话,url显示md文件名,导航显示title,标题显示title, 添加title属性,包含一级标题的话,url显示md文件名,导航显示title,标题显示一级标题。

总结一下,url是跟着md文件名走的,而title控制左边导航栏显示名称,一级标题控制这篇笔记最上面的标题名称,如果确实则用另一个互补,都缺失用md文件名互补。

第一篇博客

最近一直折腾Obsidian和博客以及mkdocs,荒废了学业。

现在记笔记同时有Obsidian和OneNote,写博客同时有Montaigne、jekyll和mkdocs。

暂时决定分工如下:

  • OneNote:信息收集,用来复制网上的各种教程或方法。
  • Obsidian:知识整理,只用来写自己原创的内容。
  • mkdocs:内容创作,用来把Obsidian当中的笔记发布到网站上。其中blog模块用来写博客。
  • Montaigne:依赖于Apple Notes,只用来分享苹果设备及其使用技巧。
  • jekyll:用于记录生活,写日记。