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

Preserving the order of the output markdown by adding a incremental numeric prefix #81

Open
YoungY620 opened this issue Feb 5, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@YoungY620
Copy link

Describe the feature here.

I mean is it possible to define a rule so we can change the file name of output Markdown?

I think this is the only drawback of this tool.

@alxnbl alxnbl added the enhancement New feature or request label Feb 5, 2023
@alxnbl
Copy link
Owner

alxnbl commented Feb 5, 2023

Hey @YoungY620 , could you give more detail of your use case, and how you would expect the new feature to solve your issue.
Thanks

@YoungY620
Copy link
Author

I want to export my notes in Onenote to Markdown files. As described in the README, ordering of output markdown files is based on their file names. So, I want to add a number before original names so the files will be ordered by its numeric prefix. For example, "fileA" is the 1st file in a notebook and "fileB" is the second, so the output files are "1-fileA.md" and "2-fileB.md". It is also the way I control the ordering of files when I take notes with Markdown now.

However, there still exists a problem. When the total number of files in a folder is more than 10 or 100 for example, the output file must be "01-fileA.md" or "001-fileA.md".

I was going to add this feature myself and pull a request, but I found it is implemented in C#, about which I know nothing....XD). So, I dont know whether it is difficult for you.

@alxnbl
Copy link
Owner

alxnbl commented Feb 5, 2023

I understand, indeed it can be useful.
It should not be tricky to implement, but not straightforward either. We need to add a new setting, add a counter inside folder loop, and add a new function to generate page file name. Most of the change are located in MdExportService.cs
I will try to implement it in a future version, but probably not before some months...
If you want to experiment C#, feel tree to send a PR :).

@YoungY620
Copy link
Author

Thank you for your reply! It is interesting. Unfortunately, I also have little free time now. After the current rush is over, I would really love to try it if you haven't do that then.

@alxnbl
Copy link
Owner

alxnbl commented Dec 10, 2023

We can imagine to have a setting that allow to define the template of file name. This template would support some tag like like $filenumber$ allowing the alphabetic order to follow the original ordering of pages inside a section.

MR welcome from any volunteer ;)

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

No branches or pull requests

2 participants