Platerytter
Follow
#2603 2024-09-22 21:23:49 Join
92
Home View
1h5m
Online time
  • Import from Logseq?

    2024-10-06 15:09

    Ok so I made a small bash script to remove some Logseq specific formatting:

    find $1 -type f -name ".md" | while read file; do
    sed -i '/{{query/d' "$file" # This removes any embeds
    sed -i '/{{embed/d' "$file" # This removes any embeds
    sed -i '/{{renderer/d' "$file" # This removes any embeds
    sed -i '/::/d' "$file" # This removes any tags/properties featuring ::
    sed -i 's#../assets/#assets/#g' "$file"
    sed -i 's/(([\a-f0-9-]{36}))//g' "$file" # This removes UUID like strings
    sed -i 's/- (#+)/\1/g' "$file" # Removes "- #" Outline headers and replaces them with #
    sed -i 's/{{video\s
    (http[s]?://[^}]*)}}/\1/g' "$file" #Removes the video tags
    sed -i 's#(http[s]?://[^ ]*)#[\1](\1)#g' "$file" #Adds to any links that dont have it

    done