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: add heading transformer - #397 #404

Merged
merged 1 commit into from
Jun 12, 2021

Conversation

K-Kumar-01
Copy link
Collaborator

Signed-off-by: k-kumar-01 [email protected]

Partial improvement #397

Changes

  • Heading transformer for CiceroMark->OOXML
  • Roundtrip(CiceroMark <-> OOXML) test for above

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

Heading transformer for CiceroMark->OOXML
Roundtrip(CiceroMark <-> OOXML) test for above

Signed-off-by: k-kumar-01 <[email protected]>
@K-Kumar-01 K-Kumar-01 requested a review from algomaster99 June 12, 2021 10:48
@K-Kumar-01
Copy link
Collaborator Author

@algomaster99
Requesting your review.

PS: I will replace jest with mocha after this PR gets merged.

Comment on lines +45 to +57
let textandHeadingCiceroMark = await fs.readFileSync(
'test/data/ciceroMark/text-and-heading.json',
'utf-8'
);
// converts from string to JSON object
textandHeadingCiceroMark = JSON.parse(textandHeadingCiceroMark);

const ciceroMarkTransformer = new CiceroMarkToOOXMLTransfomer();
const ooxml = ciceroMarkTransformer.toOOXML(textandHeadingCiceroMark);

const ooxmlTransformer = new OoxmlTransformer();
const convertedObject = ooxmlTransformer.toCiceroMark(ooxml);
expect(convertedObject).to.deep.equal(textandHeadingCiceroMark);
Copy link
Member

Choose a reason for hiding this comment

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

The logic is similar to what you did for text and paragraph test. I think this can be reused but not in this PR. You can refactor this in a separate PR but do create an issue to keep track of it.

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.

@algomaster99 algomaster99 merged commit 0d380c1 into algoo-ooxml Jun 12, 2021
@algomaster99 algomaster99 deleted the k-kumar-01/i397/heading-transformer branch June 12, 2021 13:59
@algomaster99
Copy link
Member

PS: I will replace jest with mocha after this PR gets merged.

Sure. Keep this on priority.

algomaster99 pushed a commit that referenced this pull request Jun 17, 2021
algomaster99 pushed a commit that referenced this pull request Jun 17, 2021
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.

2 participants