Coder Social home page Coder Social logo

logseqtoobsidian's People

Contributors

asuth avatar daguar avatar dapperdanman avatar nirvdrum avatar nishanttharani avatar sunboyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

logseqtoobsidian's Issues

Images from URLs causing issues?

Error is:

INFO:Destination path: C:\Users\goku\Obsidian\wz_r1.md
Old note path: C:\Users\goku\logseq\journals\2022_12_01.md
Old asset path: C:\Users\goku\logseq\journals\https:\website.com\cdn\2022\20221201.jpg
New asset path: C:\Users\goku\Obsidian\journals\attachments\https:\website.com\cdn\2022\20221201.jpg
Traceback (most recent call last):
  File "C:\Users\goku\LogSeqToObsidian\convert_notes.py", line 441, in <module>
    line = update_assets(line, new_to_old_paths[fpath], fpath)
  File "C:\Users\goku\LogSeqToObsidian\convert_notes.py", line 211, in update_assets
    line = re.sub(r"!\[(.*?)]\((.*?)\)", fix_asset_embed, line)
  File "C:\Users\goku\miniconda3\lib\re.py", line 210, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "C:\Users\goku\LogSeqToObsidian\convert_notes.py", line 191, in fix_asset_embed
    shutil.copyfile(old_asset_path, new_asset_path)
  File "C:\Users\goku\miniconda3\lib\shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc:
OSError: [Errno 22] Invalid argument: 'C:\\Users\\goku\\LS\\journals\\https:\\website.com\\cdn\\2022\\20221201.jpg'

Line in journal is:

	- ![](https://website.com/cdn/2022/20221201.jpg)

I nosed through the script and did not see any code nearby that attempts to download these, would you like me to implement that? For now I've just removed the offending URLs from my journal.

Thank you for writing this.

Syntax error thrown when running on Ubuntu 20.04

Python 2.7.18

python convert_notes.py -logseq ~/nextcloud/Notes/ --output ~/Documents/obsidian
  File "convert_notes.py", line 37
    def is_markdown_file(fpath: str) -> bool:
                              ^
SyntaxError: invalid syntax

Python 3.8.1

Traceback (most recent call last):
  File "convert_notes.py", line 58, in <module>
    def get_markdown_file_properties(fpath: str) -> tuple[dict, int]:
TypeError: 'type' object is not subscriptable

I'm not sure why this is throwing this syntax error when I run

Seeking Assistance to Improve the Script and Resolve Markdown Issues

Hi, there

First of all, I want to express my gratitude for your script. I am delighted to inform you that the script has been successfully executed and has performed well in certain aspects.

  1. The script has run successfully and has shown promising results.

  2. I have noticed that the script has made some improvements in handling properties. The previous :: has been successfully converted to a colon (:). For example, Public:: true is now transformed into Public: true. This improvement aligns the property format with the expected standard.

  3. However, there are still some issues that need to be addressed. The hyphen symbol (-) in unordered lists is still present before the highest-level item, and we would like to remove it.

  4. Additionally, a forward slash (/) has been added before the quotation symbol (>) which causes the quotation symbol to be incorrectly recognized.

  5. Furthermore, there is still a significant amount of indentation present, and we would like to remove it to align the content to the left.

I would appreciate it if you could provide suggestions to help optimize this script and achieve the desired outcome. Thank you for your assistance.

Best regards,
KL

Assertion Error Line 330

Can anyone help diagnose this error?

Traceback (most recent call last):
File "~/Desktop/convert_notes.py", line 330, in
assert os.path.exists(old_base) and os.path.isdir(old_base)
AssertionError

Feature Request: Convert tasks

Thank you so much for making this utility! I'm testing out Obsidian, and your script has been a time saver.

Would it be possible to convert task items to Obsidian's standard, and remove Logseq specific markup like :LOGBOOK:

So...

TODO My task
DONE Finished

... would become ...

- [ ] My task
- [x] Finished

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 79: invalid continuation byte

This error is mostly caused by my own mistake.Nevertheless I'm sharing it here in case others may encouter the same thing.
I'm using this script to convert my Logseq note to Obsidian, while getting this error below:

Traceback (most recent call last):
  File "/Users/mettli/Documents/code/LogSeqToObsidian/convert_notes.py", line 397, in <module>
    lines = f.readlines()
            ^^^^^^^^^^^^^
  File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 79: invalid continuation byte

0xd5 is a character used by windows, since I changed my computer to mac before, this may have been the cause of the issue.
The soultion is quiet simple though, finding the 396th lines code and modify it as follow:

    with open(fpath, "r", errors="ignore") as f:

This worked for me, and I hope it may be helpful for others who facing the similar issue.

results are not deterministic

I stumbled upon that sometimes the order of processing for the files is different and produces different results. I have realized it that sometimes the - TODO are not translated to - [ ] and sometimes they are. Same content, same line, just different executions.

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.