-
Notifications
You must be signed in to change notification settings - Fork 16
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
Export subheadings and content before subheading in context of the whole file #27
base: master
Are you sure you want to change the base?
Export subheadings and content before subheading in context of the whole file #27
Conversation
I will return to this PR next week. |
I got something useful here. Now I can export notes with attachments. @orgtre, any ideas about this PR? |
This diff breaks |
The whole idea worked pretty well. But sometimes my code doesn't work properly in a big chunk of code called in |
41d78f6
to
d17b786
Compare
I replaced complex logic in map-fields with a simpler one.
d17b786
to
7b0cc5c
Compare
You should have test server running in the background. Go to the root directory and execute python3 test_server.py and then you can run tests.
What exactly doesn't work? |
@shunlog - I fixed the Now, the note is exported not from a string but from a region, and the export is now aware about the org export context. Also, I added a few unit tests to check how the export works. But I don't want to make more progress before @orgtre sees the diff. Currently, I use thia branch version of anki-editor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@renatgalimov is there anything you'd still like to do here? The code looks fine to me and the added tests are great!
N.b.: as someone who regularly pushes large subtrees of notes over to anki, I did notice a slowdown of at least one order of magnitude with this PR. I haven't profiled this yet, and I suspect it's fixable, but just something to keep in mind. Since it fixes a bunch of outstanding issues (e.g., #38 and #39) the PR still seems worth merging, although one should definitely study the performance regression further |
It seems like the reliance on @renatgalimov is it perhaps possible to keep |
@slotThe, I can try to refactor it.
Thanks! I want to refactor the tests, as I don't like having a Python program to serve them.
I can make it configurable, maintain old behavior by default, and enable the new one with a flag or setting.
I will check it. |
Fixes #24
Previous version of this code was exporting content subheadings and content before subheading aside of their context, which caused broken links for attachments (see #24).
After this PR we export subheadings and content before subheadings as a region and
org-export
remains aware of all available properties.Besides that, I added unit tests to ensure that I didn't break anything.