rainlanguage / dotrain

.rain to rainlang composer and rain language server protocol services
3 stars 4 forks source link

feat: add 'body' field to RainDocument to store text minus frontmatter #68

Closed mattyg closed 8 months ago

mattyg commented 8 months ago

Previously the RainDocument had only one field for distinguishing the front matter from the body of a dotrain document. The field frontmatter contained the front matter, and the field text contained the entire document text.

This adds another field body which contains only the rainlang (i.e. full text minus frontmatter).

It might make more sense to make the .text() helper function return the string concat of frontmatter + body, and no longer redundantly store the full text in text, but I left that out of this PR.