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

Change Document Meta Format #486

Merged
merged 6 commits into from
Oct 24, 2020
Merged

Change Document Meta Format #486

merged 6 commits into from
Oct 24, 2020

Conversation

vkbo
Copy link
Owner

@vkbo vkbo commented Oct 24, 2020

This PR changes the format of the meta data written to the top of document files.

The point of the change is to make the format easier to parse and extend. Currently, the single line is getting a bit information dense and there are a few pitfalls and limitations to parsing it. Especially since it contains user controlled data (the document label).

The new format changes the format to a label/value style where the first N characters can be checked, and the remainder of the line be treated as the value, regardless of content.

The previous format was:

%%~ 6a2d6d5f4f401:e7ded148d6e4a:7031beac91f75:NOVEL:CHAPTER:Chapter One

The new format is:

%%~name: Chapter One
%%~path: e7ded148d6e4a/6a2d6d5f4f401
%%~kind: NOVEL/CHAPTER

Any line starting with %%~ will not be loaded as text (although only the first 10 lines are considered). Also, any line that does start with those characters, but don't match any of the above keywords, like %%~name:, will be discarded.

As a bonus, the new format is also more human readable.

@vkbo vkbo merged commit 39a502c into main Oct 24, 2020
@vkbo vkbo deleted the doc_meta branch October 24, 2020 17:24
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.

1 participant