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

Does or Can Substance support a "strict" concept of "schema" for documents ? #1124

Open
Annakan opened this issue Sep 10, 2017 · 3 comments
Open

Comments

@Annakan
Copy link

Annakan commented Sep 10, 2017

Hello
I am returning to exploring substance has great basis for an online / collaborative editor.
I understand that you use the term "schema" in a very loose sense meaning more "collection of node types that can appear in a document" thane "structure of the document tree".

Is is possible (or do you think is is possible to implement ) a more "structured document schema" approach where some node can only appear in the context of some other nodes.

In a naive way this could be implemented by a test function canAppear(Parent_node_context) and/or a function allowedSubnodes()=>list of allowed subnodes types:.

The goal is to allow editing "strongly structured" documents where edition is guided by a schema, allowing for instance to have code-editor like shortcuts CTRL+space who display a contextual menu of the allowed sub nodes before continuing edition in place.
All of this subnodes would not have a "visual" effect (bold, etc, ) but could have a visual indication. For instance a node could be "law reference" (underlined in yellow) or "actor reference" (underlined in blue) displaying a law book name and position in it, or a the full tittle of a person, while storing a reference to an UUID to it ... etc ...

Maybe I missed this already or maybe substance is lower level and this needs to be build on it ...

Thanks a lot for your time.

@Annakan Annakan changed the title Does or Can Substance support a "true" concept of "schema" for documents ? Does or Can Substance support a "strict" concept of "schema" for documents ? Sep 10, 2017
@obuchtala
Copy link
Member

Hey @Annakan
This is actually a tough problem which we are also experimenting with in the course of developing Texture (https://github.com/substance/texture).
Our approach is using an XML data schema, providing on-the-fly validation, but also real-time enabling/inhibition of UI elements according to the schema.
As you noticed, in the current version of substance this is not built-in -- this is our major goal for substance 2.0 (while 1.0 is not out yet ;) )
So, there is hope, but ATM it is still experimental. You could take a look at our latest development in Texture.

@obuchtala
Copy link
Member

obuchtala commented Sep 10, 2017

Just some more hints:
e.g. here we define a schema using RNG: https://github.com/substance/texture/blob/develop/src/article/JATS4R.rng

All models and converters are generated automatically.
Of course, the UI still needs to be implemented manually.
As you presumed, this is all built on top of the low-level API.

@gagarine
Copy link

@oliver---- can you provide a updated link?

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

3 participants