lizhimiao

lizhimiao

twitter

memos From Beginner to Deleting the Database and Running Away

memos is a lightweight note-taking software similar to flomo, written in golang. The note format uses Markdown, and the database uses sqlite for storage. The official Docker image is provided, which is very suitable for personal use as a simple note or text sharing service.

Official website: https://usememos.com/
Source code: https://github.com/usememos/memos

memos_demo_op

Installation#

It is recommended to use Docker for installation.

version: "3.0"
services:
  memos:
    image: neosmemo/memos:latest
    container_name: memos
    volumes:
      - /var/memos/:/var/opt/memos #Modify /var/memos to a commonly used file storage path for easy regular backups
    ports:
      - 5230:5230

Custom Configuration#

1. Hide the askai button in memos#

#Version 0.11.2
header > div.w-full.px-2.py-2.flex.flex-col.justify-start.items-start.shrink-0.space-y-2 > button:nth-child(4) {display:none;}

2. Drafts app sends to Memos Action#

Visit the Drafts website below for installation: https://directory.getdrafts.com/a/2HU
When running for the first time, it prompts for the API address. Paste the complete URL under My Account.

3. Use the LXGW WenKai font#

The LXGW WenKai font is already installed locally.

body{font-family: "LXGW WenKai", sans-serif !important;}

For more information, please refer to: https://immmmm.com/memos-diy-style/

Chrome Extension#

https://chrome.google.com/webstore/detail/memos-bber/cbhjebjfccgchgbmfbobjmebjjckgofe/

Delete the Database and Run Away#

After using it for a while, I still feel that my notes are too scattered, so I'm going back to Obsidian. Before running away, I need to back up and export my notes. Use the following script to export markdown files. The files in the resources cannot be exported directly.

#!/usr/bin/env python3
import requests
import os

# Configuration information, modify to your own address, pay attention
host = "http://192.168.2.2:8090"
openId = "e184c398-8849-4126-b3cb-c47413c0127d"

url = "https://{host}/api/memo?openId={openId}".format(host=host,openId=openId)

payload={}
headers = {}

# Create the memos folder
if not os.path.exists: os.mkdir("memos")

# Create the request
response = requests.request("GET", url, headers=headers, data=payload)

if response.status_code == 200:
    print("memos data downloaded...")
    memo_list = response.json()["data"]
    for memo in memo_list:
        with open(os.path.join("memos",str(memo["id"]).zfill(3)+".md"), "w",encoding="utf-8") as mdfile:
            print("writing:" + "memos/"+str(memo["id"]).zfill(3)+".md")
            mdfile.write(memo["content"])
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.