Giter Site home page Giter Site logo

Comments (10)

lishid avatar lishid commented on May 25, 2024 2

Ok so it makes sense to alias to line one and line two, which is the current behavior.

from obsidian-importer.

daledesilva avatar daledesilva commented on May 25, 2024 1

Agree with all of this. That was my thinking when I did it.

To reiterate

  • Notes can often just be a title.
  • The obsidian note name is just what keep exported as filename so it's already sanitised.
  • Because the original title can have any character or even line breaks, the filename can be different, so the original title is added as an alias.
  • To prevent multi line aliases, new line chars are replaced with spaces.

Note, on the original ticket question...
I considered checking whether the title matched the filename and only adding the alias if different, but I decided to just keep it simple and consistent for every note. Which could definitely be reconsidered if necessary.

from obsidian-importer.

lishid avatar lishid commented on May 25, 2024

@daledesilva I am not sure I understand the purpose of using keepJson.title.split('\n') for aliases. Can notes have multiple titles?

from obsidian-importer.

NomarCub avatar NomarCub commented on May 25, 2024

Notes can have titles that are more than one line long, but I only noticed that accidentally.
The data then looks like this: "title": "line one\nline two",. It can even have trailing newlines.

from obsidian-importer.

lishid avatar lishid commented on May 25, 2024

For "line one\nline two", what does the filename become?

from obsidian-importer.

NomarCub avatar NomarCub commented on May 25, 2024

With 1.1.0, it's line one_line two
The alias becomes line one line two

from obsidian-importer.

lishid avatar lishid commented on May 25, 2024

Hmm ok, so we should probably ignore the title field altogether? What do you think @daledesilva?

from obsidian-importer.

NomarCub avatar NomarCub commented on May 25, 2024

Definitely don't ignore the title, at least for file names. Notes can even be only a title. I don't think many people use multi line titles, you'd have to know and press shit enter, or a normal enter would take you to the note content when you input it. (Or you can just copy text there that has more lines.)
I think it's fine as is, collapsing multi line titles with a single space, and keeping the file name with underscores.

from obsidian-importer.

lishid avatar lishid commented on May 25, 2024

The file name is created from what Keep exports as file names in the zip. If it's always some combination of flattened "title" field then it would make sense to ignore.

from obsidian-importer.

NomarCub avatar NomarCub commented on May 25, 2024

I think that's what it is, yes, and if there's no title, it's the date instead. But I would not ignore it, unless you have some better mechanism for creating a file name or title. It makes a lot of sense to me, to have the OS friendly file name, and if it differs from the original, have an alias field with the original title with special characters if there were any.

from obsidian-importer.

Related Issues (20)

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.