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

feat(markdown-docx): add API to return frequency of variables in CiceroMark (JSON) - #397 #411

Conversation

K-Kumar-01
Copy link
Collaborator

@K-Kumar-01 K-Kumar-01 commented Jun 17, 2021

Return counter for variables in CiceroMark

Signed-off-by: k-kumar-01 kushalkumargupta4@gmail.com

Enhancement to the CiceroMarkToOOXMLTransformer by returning the counter for variables in CiceroMark of a template.

Changes

  • Use a class variable counter to store the counter.
  • A function getCounter() that returns the counter.

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to master from fork:branchname

Return counter for variables in CiceroMark

Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Copy link
Member

@algomaster99 algomaster99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See changes.

@@ -51,6 +52,15 @@ class CiceroMarkToOOXMLTransfomer {
return node.$class;
}

/**
* Returns the counter holding variable counts for a CiceroMark.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"count" (singular)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CiceroMark (JSON)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@algomaster99
Updated

@@ -138,6 +148,7 @@ class CiceroMarkToOOXMLTransfomer {
this.getNodes(node, counter);
});
this.globalOOXML = wrapAroundDefaultDocxTags(this.globalOOXML);
this.counter = counter;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since counter is an instance variable now, you don't need to maintain a separate counter. Use this.counter wherever required.

Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Copy link
Member

@algomaster99 algomaster99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 🎉

Not sure if you noticed but ooxml = '' is also not needed in toOOXML. Maybe you can change it similarly in separate PR.

@algomaster99 algomaster99 changed the title feat(markdown-docx): counter for variables - #397 feat(markdown-docx): add API to return frequency of variables in CiceroMark (JSON) - #397 Jun 17, 2021
@algomaster99 algomaster99 merged commit a170dec into algoo-ooxml Jun 17, 2021
@algomaster99 algomaster99 deleted the k-kumar-01/i397/return-counter-CiceromarkToOOXMLTransformer branch June 17, 2021 15:52
algomaster99 pushed a commit that referenced this pull request Jun 17, 2021
…roMark (JSON) - #397 (#411)

Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
algomaster99 pushed a commit that referenced this pull request Jun 17, 2021
…roMark (JSON) - #397 (#411)

Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
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

Successfully merging this pull request may close these issues.

None yet

2 participants