Giter VIP home page Giter VIP logo

obsidian-to-bookstack's Introduction

Hey, I'm Jayden Pyles ๐Ÿ‘‹

๐Ÿ’ป All my projects can be found here on Github.

โš› I am currently improving my Typescript knowledge by using Next.js, and building automation tools with Python.

โœ‰๏ธ Feel free to message me, my discord/linkedin/telegram/email are linked on my website.

obsidian-to-bookstack's People

Contributors

jaypyles avatar useahawk 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

Watchers

 avatar  avatar  avatar

obsidian-to-bookstack's Issues

Error with installation

Hi.

I attempted to run pip3 install . after cloning the repo, but this was the output that I received.

Processing /home/[user]/obsidian-to-bookstack
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
  Building wheel for UNKNOWN (pyproject.toml) ... done
  Created wheel for UNKNOWN: filename=UNKNOWN-0.0.0-py3-none-any.whl size=1791 sha256=f67ed898358c271c49644b364075f741bba7813a9fec14e6773353e2b8fb43b8
  Stored in directory: /root/.cache/pip/wheels/33/14/94/5d56d8845a81dd20d28226f5d4c214057f9eb5cf5277783f8d
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
  Attempting uninstall: UNKNOWN
    Found existing installation: UNKNOWN 0.0.0
    Uninstalling UNKNOWN-0.0.0:
      Successfully uninstalled UNKNOWN-0.0.0
Successfully installed UNKNOWN-0.0.0

Is this expected output? After which I tried to run any of the commands (sync, update etc. ) but none of them worked.

I'm trying out this program alongside Bookstack for the first time so I'm unsure if I'm just running the commands wrongly.

Thanks in advance.

Script breaks when there's a / in any title

I have books, shelves etc which have a '/' in the title.
The script breaks, since it's trying to build a path from that.
I consider that a bad practice myself and have changed all the titles.
Maybe titles should be escaped or theres a better way to avoid breaking the script.

Thx for your work!

Script crashes when a book has no shelf assigned

First off, thanks a lot for working on this - it fills a need I had for my setup, and works well in most cases!

The issue I encountered: when a book is not assigned to a shelf (other books are assigned to shelves on my setup, this was a test), the script will run into an error when downloading to the local client. Here is the error text:

__main__.py:27Traceback (most recent call last):
  File "/home/username/.local/bin/obsidian_to_bookstack", line 8, in <module>
    sys.exit(main())
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/obsidian_to_bookstack/__main__.py", line 119, in main
    cli()
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/obsidian_to_bookstack/__main__.py", line 59, in local
    b.sync_local()
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/obsidian_to_bookstack/bookstack/bookstack.py", line 291, in sync_local
    self.book_collector.create_local_missing_books()
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/obsidian_to_bookstack/bookstack/collectors/local/BookCollector.py", line 71, in create_local_missing_books
    path = os.path.join(self.path, book.shelf.name, book.name)
AttributeError: 'NoneType' object has no attribute 'name'

Required to run from project folder

Issue

Currently the conf.toml is loaded like:

def load_toml():
    """Try to load config"""
    cwd = os.getcwd()
    conf_path = os.path.join(cwd, "conf.toml")

    try:
        with open(conf_path, "r") as t:
            return toml.load(t)
    except:
        print("Couldn't load 'conf.toml'")

Which requires the project to be ran from the project directory.

To Resolve

Load from ~/.config and allow multiple configs for multiple vaults

Some parts of the content not synced

When there is content in a page that occurs before the first header, all content up to and including that first header is not retrieved from BookStack. For example, given the following test page content:

*Content* before header, and <span style="color: rgb(224, 62, 45);">span styling</span>

### Header

Content after header.

Only the following is actually stored in the file when downloaded / updated to the client:

Content after header.

And when I add a header before that content like so:

##### Some header of any level

*Content* before header, and <span style="color: rgb(224, 62, 45);">span styling</span>

### Header

Content.

The result is:

*Content* before header, and <span style="color: rgb(224, 62, 45);">span styling</span>

### Header

Content.

I'm not 100% sure whether it's the span tags causing this behavior, or perhaps anything before and including the first header being skipped by default (by the script and/or the api). However, on a page that doesn't include any span content before the first header, it syncs as expected, including all content of the page.

I'm also noticing that when a span before the first header (or maybe anywhere in the page?) was added - causing the behavior described above - this behavior persists for that page even when any formatting that would trigger span classes has been removed and synced again. This makes me wonder whether it is caused by BookStack switching the page from markdown formatting to html (ie its editor options), but the resulting file does format as markdown - just with anything before the first header on the page missing.

Also, a minor issue: I noticed that while BookStack allows for pages with the same title in the same location, these duplicates are not synced. For example, if I have shelf/book/page-title twice (so same 'page-title'), but with different page contents, only one of these gets synced - it seems the first created page.

data folder

Depending from where I run the script, a new datafolder is created at the location.
I think the datafolder should reside in a fixed location.

dev_conf.toml

Instead of reading from ~/.config/obsidian_to_bookstack/conf.toml as described in the documentation, the script tries to read from ~/.config/obsidian_to_bookstack/dev_conf.toml

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.