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

feat: add namespace processing logic #143

Merged
merged 1 commit into from
Jan 25, 2023
Merged

feat: add namespace processing logic #143

merged 1 commit into from
Jan 25, 2023

Conversation

kilesduli
Copy link
Contributor

@kilesduli kilesduli commented Jan 21, 2023

Did a lot of trivial work.

1.When the option is on, namespace are parsed permanently.
2.When the option is off and the root page has the property parsens is true, the namespace will still be parsed and will update on next sync.

Hope to merge.

@kilesduli
Copy link
Contributor Author

#140

@debanjandhar12 debanjandhar12 merged commit 161c457 into debanjandhar12:main Jan 25, 2023
@debanjandhar12
Copy link
Owner

Thank you for the PR. I have checked and merged it.

Also, just curious but is there any specific reason for using while loop to get the root namespace here instead of regex?

@kilesduli
Copy link
Contributor Author

kilesduli commented Jan 25, 2023

There is no specific reason. When I read the documentation, I didn't notice that it is possible to do. It's later when I realized. You could change it maybe shorten the time.

Thank you for the PR. I have checked and merged it.

Also, just curious but is there any specific reason for using while loop to get the root namespace here instead of regex?

@kilesduli
Copy link
Contributor Author

@debanjandhar12 Sorry, it seems like there is expected behavior that is not being handled. When the option is off, parsens exist or not will bring deck change. For example, When I have root page do not have parsens, and I have already created card in leaf page, I add parsens property true won't take decks change. I think parsens property change will bring decks change. What do you think?

@kilesduli
Copy link
Contributor Author

For example, (In all the cases the parsens option is turn off)

  1. Having oldcard in nested anki deck and no parsens or parsens is false in root page. need to update to default deck.
  2. Having oldcard in default anki deck and parsens in page is true. need to update to nested deck.
    The root page have property or not won't get dependecyhash update. So it won't take affect where the card is. I tryed in latest commit.

@debanjandhar12
Copy link
Owner

debanjandhar12 commented Jan 25, 2023

Reproduced it. I think its because the note hash is not changing when properties of root namespace page is changing. I think adding the root namespace page to note hash calculation will fix it.

I will try to fix it over the weekend before next release.

@kilesduli
Copy link
Contributor Author

Reproduced it. I think its because the note hash is not changing when properties of root namespace page is changing. I think adding the root namespace page to note hash calculation will fix it.

I will try to fix it over the weekend before next release.

Thanks for your contribution. 👍

debanjandhar12 added a commit that referenced this pull request Jan 27, 2023
@debanjandhar12
Copy link
Owner

For example, (In all the cases the parsens option is turn off)

1. Having oldcard in nested anki deck and no parsens or parsens is false in root page. need to update to default deck.

2. Having oldcard in default anki deck and parsens in page is true. need to update to nested deck.
   The root page have property or not won't get dependecyhash update. So it won't take affect where the card is. I tryed in latest commit.

I believe the issue should be fixed now.

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

Successfully merging this pull request may close these issues.

None yet

2 participants