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

Template Signature in ciceromark_parsed #433

Open
K-Kumar-01 opened this issue Aug 3, 2021 · 5 comments
Open

Template Signature in ciceromark_parsed #433

K-Kumar-01 opened this issue Aug 3, 2021 · 5 comments
Labels
Need More Info ℹ️ Extra information is required Type: Feature Request 🛍️ New feature or request

Comments

@K-Kumar-01
Copy link
Collaborator

Feature Request 🛍️

Currently, the ciceromark_parsed does not contain the template signature. A template signature can be incorporated into the ciceromark_parsed to uniquely identify them.

Use Case

This issue was raised with respect to #432. The major use is to uniquely identify the conversions CiceroMark<->OOXML.
<w:sdt> requires a unique id to distinguish itself. The template identifier can be used as this id.

Context

While working on #432, there occurred a need to wrap the complete OOXML in <w:sdt> and hence an id was required. Randomly generating id causes test failure so this issue was created.

Detailed Description

A field template_signature in the ciceromark_parsed

@algomaster99
Copy link
Member

We would probably need something like this. My suggestion may be wrong because I don' clearly understand the difference between a clause and a contract.

{
  "$class": "org.accordproject.commonmark.Document",
  "identfier": "[email protected]",
  "xmlns": "http://commonmark.org/xml/1.0",
  "nodes": [...]
}

@dselman
Copy link
Contributor

dselman commented Aug 5, 2021

The src attribute on the Clause node contains the identifier for the template for the Clause:
https://github.com/accordproject/models/blob/master/src/markdown/ciceromark%400.3.1.cto#L53

@dselman
Copy link
Contributor

dselman commented Aug 5, 2021

If you need to generate a stable id for a clause then I suggest you compute an SHA hash of the textual content of the clause (text or JSON data as a string), including the template src (see above).

See: https://www.nodejsera.com/snippets/nodejs/sha256-hash.html

@K-Kumar-01
Copy link
Collaborator Author

@dselman
We need the identifier for a whole template.
I will try to explain in simple words.
Let us assume that a user uses cli to transform ciceromark_parsed to OOXML. In this case, we do not have an identifier present. Currently, from the templatemark-dingus also there is no identifier present.

The src attribute on the Clause node contains the identifier for the template for the Clause:

I see that this is optional, so how is there any flag which we need to pass.

@jeromesimeon
Copy link
Member

I'm not sure I understand the requirement. What's an identifier in this context? If it's something specifically needed for OOXML, then Dan's suggestion to generate a hash from (ciceromark / the data / something else) makes sense to me.

@jolanglinais jolanglinais added Need More Info ℹ️ Extra information is required Type: Feature Request 🛍️ New feature or request labels Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need More Info ℹ️ Extra information is required Type: Feature Request 🛍️ New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants