Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can the index folder changed to somewhere else? #2

Closed
AndyLiu9 opened this issue Aug 24, 2021 · 6 comments
Closed

Can the index folder changed to somewhere else? #2

AndyLiu9 opened this issue Aug 24, 2021 · 6 comments

Comments

@AndyLiu9
Copy link

AndyLiu9 commented Aug 24, 2021

Can the index folder(.obsidian/regex-rulesets) be changed to somewhere else such as[.obsidian/plugins/obsidian-regex-pipeline]?

@AndyLiu9 AndyLiu9 changed the title Can Can the index folder changed to somewhere else? Aug 24, 2021
@No3371
Copy link
Owner

No3371 commented Aug 25, 2021

Will add an option for this, but not sure when.

At the moment, if you really need it right now, you can go into the plugin folder and modify line 38, 39:

        this.pathToRulesets = this.app.vault.configDir + "/regex-rulesets";
        this.pathToIndex = this.app.vault.configDir + "/regex-rulesets/index.txt";

the this.app.vault.configDir is ".obsidian".
The modification will be overwritten when you update the plugin.

@AndyLiu9
Copy link
Author

OK thanks for your reply. So that if I want to change the path to outside /.obsidian, I can use “this.app.vault” to represent the root path of my vault, is this true?

@No3371
Copy link
Owner

No3371 commented Aug 25, 2021

No, only this.app.vault.configDir is a string(text), this.app.vault is a complex stuff contains it, not a string. If you are interested, you can checkout how Javascript (or other common programming language) works.

I'm not sure, it seems not possible to access path outside .obsidian with small change, it's also not encouraged by Obsidian.

@AndyLiu9
Copy link
Author

I have tried and I just delete the “ this.app.vault.configDir” part and it works for me~

@No3371
Copy link
Owner

No3371 commented Aug 25, 2021

Oh, so you meant the vault folder itself? That's ok for sure, I thought you want somewhere else.

@AndyLiu9
Copy link
Author

Haha true, what I want is to change the path from “Vault/.obsidian/regex-rulesets” to “Vault/regex-rulesets” because files in “Vault/.obsidian/regex-rulesets” won’t be synced by Obsidian Sync. After the change I can get all my regex synced across my devices with Obsidian Sync service. Anyway, I really appreciate your plug-in and many thanks for your patience in offering me help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants