Notion文件导出

Notion 批量文件导出,以 PFD格式 Notion 是一款 markdown 笔记软件,可以快速书写,多端同步,支持文件导出,十分方便。 我在 notion 中写了很多页面,有时要转移到别的地方保存,那么应该怎么做呢? notion 支持导出的文件格式:PDF,HTML,MD 可是,这几种方法都有缺点。 PDF:只能当前页面,导出所有子页面,需要升级 Pro HTML:多出了一些附带的文件,文件散乱,转移和浏览都不方便 MD:导出之后,图片和文本都分开,转移不方便,文件散乱 那么,有没有更简单的办法获取我自己写的许多页面,且保存为 PDF ? 有的,步骤如下: 在notion中包含子页面导出 markdown 使用 vs code 打开,使用插件 Markdown PDF 逐页导出。 具体操作步骤 下图可以看到我的一个页面包含了多个子页面。 右上角三个点的按钮,选择 export 导出 markdown 会得到页面和子页面的目录结构 使用 vscode 打开。 安装插件 ”Markdown PDF“ 搜索 Markdown PDF, 点击安装 install。 设置 ”auto convert when save “ 在插件库里可以看到已安装 Markdown PDF 这样一来,打开一个 md 文件,ctrl + s,它就自动转换为 pdf 并输出到源路径了。 ...

March 11, 2023

Java

多线程 Java 多线程编程笔记 🔗

July 12, 2022

各种设计模式

Creational Object Created Pattern Factory Method Provide the method for creating an instance in the superclass, and allow the subclass to choose the type of the instance. 在父类中提供创建对象的方法,允许子类决定实例化对象的类型。 具备的部分:生产者协议、产品协议,往后就可以根据需要来扩展每一种产品。 具体的生产者比如 MongoCakeCreator 的存在是为了实现与产品相关的核心业务逻辑,而不仅仅是创建 MongoCake 实例。工厂方法将核心业务逻辑从具体产品类中分离出来。 // Creator protocol CakeCreator { func createCake() -> Cake func doSomethingForCake(cake: Cake) -> Cake } // Product protocol Cake { func doWork() } // ConcreteCreator class MongoCakeCreator: CakeCreator { var cake: MongoCake? func createCake() -> Cake { var cake = MongoCake() doSomethingForCake(cake: cake) return cake } func doSomethingForCake(cake: Cake) -> Cake{ cake.doWork() cake.doWork() return cake } } // ConcreteCreator class ChocolateCakeCreator: CakeCreator { func createCake() -> Cake { var cake = ChocolateCake() doSomethingForCake(cake: cake) return cake } func doSomethingForCake(cake: Cake) -> Cake{ cake.doWork() return cake } } class MongoCake: Cake { func doWork() { print("Add some mongo") } } class ChocolateCake: Cake { func doWork() { print("Add some chocolate") } } // If we want to add a type of cake call "PinapleCake", just need to // make it conform to Cake and add a creator that conform to the CakeCreator for the "PinapleCake" let cakeOne = MongoCakeCreator().createCake() Abstract Factory Base on the factory method, add an abstract factory. We can call the same abstract factory method to create different mode’s product. If we want to create another mode’s product, we need to change the concrete factory. ...

July 11, 2022

Advanced Operators

Unlike arithmetic operators in C, arithmetic operators in Swift don’t overflow by default. If want to overflow by default, use the overflow operation begin with ampersand (&). For example, the overflow addition operator (&+). It’s so free to define custom infix, prefix, postfix and assignment operators, precedence and associativity values. Bitwise Operators Here we use a function to pad 0 for the number’s print result. func pad(num: UInt8, count: Int) -> String { var str = String(num, radix: 2) var res: String = str for _ in 0..<(count - str.count) { res = "0" + res } return res } ~ NOT ...

June 19, 2022

Access Control

Access control restrict access to part of the code form code in other source files and modules. It enable us to hide the implement detail of the code, and to specify a preferred interface which that code can be accessed and used. Set access levels to individual types (classes, structures, enumerations), as well as to properties, methods, initializers, and subscripts belonging to those types. Protocols can be restricted to a certain context, as can global constants, variable, and functions. ...

June 18, 2022

Memory Safty

Most of the time we don’t have to think about accessing memory, but it’s important to understand where potential conflicts can occur, so we can avoid writing code that has conflicting access to memory. Here we are talking about the situation that happen on a single thread. Memory Access var one = 1 // write access to the memory one is stored. print("\(one)") // read access from the memory one is stored. The conflicting access to memory can occur when different part of the code are trying to access the same location in memory at the same time. ...

June 12, 2022

Automatic Reference Counting

Swift use ARC to track and manage the app’s memory usage. ARC frees up the memory used by class instances when those instances are no longer needed. Reference counting applies only to instance of classes. Reference: strong: retain the obj. (default) weak: don’t retain the object referred to, track the object referred to. unowned: don’t retain the object referred to, don’t tract the object referred to. How ARC Work Allocate a chunk of memory to store information about that instance ...

June 12, 2022

Opaque Type

A function with an opaque type hides its return value’s type information. Hiding type information at some boundaries between a module and code that calls into the module. Unlike returning a value whose type is a protocol type, opaque type preserve type identity —the compile has access to the type information, but clients of the module don’t. The Situation Here we have a Shape protocol. protocol Shape { func draw() -> String } The struct Triangle conform to the Shape. Describe how to draw(). ...

June 5, 2022

Generics

Define a class with template type , then should illustract the type when use the class.

June 5, 2022

Optional Chaining

A process for querying and calling properties, methods, and subscripts on an optional that might currently be nil .Multiple queries can be chained together, and the chain fails gracefully if any link in the chain is nil . Optional Chaining as an Alternative to Forced Unwrapping ! force unwrapping triggers a runtime error when the optional is nil . Use the optional chaining to check if the optional value querying is succeed. the chain return optional value is nil , the optional chaining fail. the chain return optional contains a value, the optional chaining succeed. Force Unwrapping ...

May 24, 2022