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

Paged content #6

Closed
danburzo opened this issue May 20, 2018 · 1 comment
Closed

Paged content #6

danburzo opened this issue May 20, 2018 · 1 comment

Comments

@danburzo
Copy link

It would be great if multi-part (paged) content could be specified via an array syntax.

My proposal looks like:

content[]:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris tincidunt convallis leo, vitae hendrerit ipsum euismod et. 

Sed sem augue, ornare eu interdum id, semper sit amet leo. Nullam a accumsan velit. Mauris sed lacus eleifend, rhoncus dui ultricies, mollis libero.

----
content[]:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris tincidunt convallis leo, vitae hendrerit ipsum euismod et. 

Sed sem augue, ornare eu interdum id, semper sit amet leo. Nullam a accumsan velit. Mauris sed lacus eleifend, rhoncus dui ultricies, mollis libero.

In the parsing stage, keys that match

/\[\]$/

can be added to JSON with Array.push().

In the serialization stage, if the object is an array but matches the above pattern, it's serialized as a series of plain text fields.

I'm not sure if this is more appropriate at the smarkt level, or should be delegated to when you process the JSON (e.g. through a delimiter inside the plain text field)

@danburzo
Copy link
Author

I came to realize this may be a bit overwrought; in my own research, I think I'll go with a different approach (still at the idea phase, fleshing out the implications).

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

No branches or pull requests

1 participant