Giter Club home page Giter Club logo

logseqtoobsidian's Introduction

LogSeqToObsidian

LogSeq and Obsidian: are two (awesome) note taking tools.

I: am a flawed human with a penchant for flitting between note taking apps.

These: are a couple of files to help me migrate from LogSeq to Obsidian.

Please: backup all of your files before trying the migration script on your own data. The script is highly experimental.

bonofix-snippet.css

A small CSS snippet to help Obsidian look more like a mix of the (LogSeq Bonofix Theme)[https://github.com/Sansui233/logseq-bonofix-theme] and Typora

Install the Minimal theme, and then paste it in your snippets folder and enable it. Doesn't do much more than (what I consider) the basics - any contributions welcome.

convert_notes.py

A basic Python script that converts LogSeq's markdown files to a style that plays nicer with Obsidian.

Usage

python convert_notes.py --logseq /path/to/logseq/graph --output /path/to/output/folder

Flags:

  • Add the --overwrite_output flag if you want any existing folder at the output path to be overwritten
  • Add the --unindent_once flag if you want all lines to be unindented once. If you do this, the base level of indentation will be paragraph-style text with no bullet points

Further information

Known assumptions:

  • Dots in the logseq filename are assumed to indicate namespaces
  • < and > characters are assumed to be part of text, and therefore escaped so that they display correctly in Obsidian

What this script does:

  • Creates a folder/subfolder hierarchy based on namespaces, copies notes appropriately, and updates links between notes
  • Links to notes that have not yet been created are replaced with tags
  • Copies embedded assets into an 'attachments' subfolder under the given note. Resizes embedded images in Obsidian to match any resizing that was done in Logseq
  • Removes block links and block embeds
  • Converts front matter of the title:: My Note format to the format expected by Obsidian (key: value wrapped in triple-hyphen lines)
  • If a code block has been embedded inside a list, prepends a line - without this, the code block does not display correctly
  • Minor reformatting to prettify notes: escapes < and > characters, replaces 2-4 spaces with a tab, ignores Logseq artefacts like collapsed:: true

What this script does not do:

  • Process page properties, and use them for finding namespaces
  • Get file copier to work with subfolders in logseq (right now only copies pages in the base directory)
  • Handle aliases
  • Handle namespaces under journal pages
  • Embed PDF as option
  • Seems like asset names cannot have '%20' in them - is that right?

I might also like to do the below at some point

(That is, none of the below has been done)

First, a note on content reformatting. LogSeq and Obsidian both allow for headers and outlining, but one key difference is that Obsidian lets you fold headings to collapse the content under it. LogSeq doesn't let you do this, so if you want a header to be foldable, you have to indent one level under it. My script assumes that any indents you've made after a header in LogSeq are just for the purpose of folding, and should be undone. Specifically, this is what will happen:

  • All content will be outdented one level (since everything starts off as part of an outline in LogSeq)
  • Then, anything under a H2 header will be outdented another level.
  • Then, anything under a H3 header will be outdented another level.
  • Etc.

As an example, if this is what your LogSeq note looks like:

image-20221111221326446

Then this is how your Obsidian note will end up being structured:

image-20221111231753576

logseqtoobsidian's People

Contributors

asuth avatar daguar avatar nirvdrum avatar nishanttharani avatar sunboyy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.