The articles need a support for snippets - a reference to dynamic code. It may contain Javascript code which a user shall not enter because of security.
Create snippet / select a snippet from a library
Editor in chief may create a snippet for an existing article.
POST ../post_id/snippets
Saved inside the article item, properties: code, author, date, type (JS, Vue, Poll), content
Use the snippet
New button in Editor menu, enabled when the article contains at least one snippet. It can act as a menu and individual snippets as menu items. When selected, new div will be inserted:
[code="animated_chart"]
. Editor will not render the actual snippet. Though it would be nice if div has a special visualization like a box with borders.
Render the snippet
When the blog post is being displayed, it must replace all snippets with their content.
The articles need a support for snippets - a reference to dynamic code. It may contain Javascript code which a user shall not enter because of security.
Create snippet / select a snippet from a library
Editor in chief may create a snippet for an existing article. POST ../post_id/snippets Saved inside the article item, properties: code, author, date, type (JS, Vue, Poll), content
Use the snippet
New button in Editor menu, enabled when the article contains at least one snippet. It can act as a menu and individual snippets as menu items. When selected, new div will be inserted:
Render the snippet
When the blog post is being displayed, it must replace all snippets with their content.