Git Product home page Git Product logo

Comments (7)

Konfido avatar Konfido commented on May 22, 2024 1

Yeah, that's true. It may mess up the whole usage logic. It's surely a complicated problem.
Anyway, what I got here has already satisfied my need. Thanks a lot for your effort on this matter.

from logseq-plugin-luckysheet.

sethyuan avatar sethyuan commented on May 22, 2024

Glad you like the plugin, I really put some efforts on it.

Regarding the file name, the reason I didn't use "UI name" as file name is a technical one, "UI name" can have arbitrary characters but file name can't. It is highly probable that users use a name that has characters that are not accepted as a file name character. So what I did was to use a hash of the "UI name" instead, to avoid possible "bad" names which affect file saving. This however, makes identifying files difficult for a human. 😅

I need time to think about this. Maybe I can write "UI name" into the file too, in this way, you can open the file with a text editor to identify it.

from logseq-plugin-luckysheet.

sethyuan avatar sethyuan commented on May 22, 2024

I need time to think about this. Maybe I can write "UI name" into the file too, in this way, you can open the file with a text editor to identify it.

I implemented it, you can open the sheets with the new version of the plugin and the ui name will be written into the file upon saving.

from logseq-plugin-luckysheet.

Konfido avatar Konfido commented on May 22, 2024

Cool, I've tried it out. It works like a charm.

BTW, is it feasible to just filter out the unsafe characters and automatically leave the rest as the name (for both UI and the file)? Maybe you can append numbers or something to it when the duplication occurs.
I hope I am not asking too much.

from logseq-plugin-luckysheet.

sethyuan avatar sethyuan commented on May 22, 2024

Filtering unsafe characters is not easy task. Whether a character is valid or not depends on the OS you're working on. A character that is valid for macOS might be invalid for Windows, it would be buggy when you port files across operating systems.

I believe even Logseq itself had many bugs related to incorrect file name handlings in the past, there is too many corner cases (think about all the languages that exist in the world).

from logseq-plugin-luckysheet.

Konfido avatar Konfido commented on May 22, 2024

I believe even Logseq itself had many bugs related to incorrect file name handlings in the past, there is too many corner cases (think about all the languages that exist in the world).

Bingo! How about we just take the filename already processed by logseq (which is the page's name) as file name of sheets. And we can append numbers to it when adding multiple sheets in one single page.
At the same time, it does not affect the user's ability to modify the UI name.

from logseq-plugin-luckysheet.

sethyuan avatar sethyuan commented on May 22, 2024

from logseq-plugin-luckysheet.

Related Issues (18)

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.