Skip to content

Transform HTML to DOCX#563

Merged
dselman merged 42 commits intomainfrom
ds-wordml
Sep 25, 2023
Merged

Transform HTML to DOCX#563
dselman merged 42 commits intomainfrom
ds-wordml

Conversation

@dselman
Copy link
Copy Markdown
Contributor

@dselman dselman commented Sep 22, 2023

Adds some new transformations to allow CiceroMark -> HTML -> DOCX -> WordProcessingML (XML) data transformation. This pipeline allows someone to inline formatted text within an DOCX file.

It also allows generation of DOCX from all input formats.

Changes

  • HTML to DOCX
  • DOCX to WordProcessingML (extracts word processing XML file from the DOCX zip)
  • Updates test files to use versioned namespaces

transformations

Flags

  • Uses html-to-docx to convert HTML to DOCX
  • Uses jszip to grab WordProcessingML XML file from the DOCX zip file

Screenshots or Video

Related Issues

  • Issue #
  • Pull Request #

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 main from fork:branchname

algomaster99 and others added 30 commits June 18, 2021 01:19
Signed-off-by: Aman Sharma <mannu.poski10@gmail.com>
Signed-off-by: Aman Sharma <mannu.poski10@gmail.com>
… cicero-word-add-in

Signed-off-by: Aman Sharma <mannu.poski10@gmail.com>
Signed-off-by: Aman Sharma <mannu.poski10@gmail.com>
…d add-in

Signed-off-by: Aman Sharma <mannu.poski10@gmail.com>
Signed-off-by: Aman Sharma <mannu.poski10@gmail.com>
* feat: sets-up class for CiceroMark to OOXML transformer

Defines constructor
Defines the function for converting CiceroMark to OOXML

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

* feat: sets-up class for CiceroMark to OOXML transformer

Removes contructor
Nodes declared as class variable

Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
* refactor: roundtrip test logic - #407

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

* refactor: roundtrip test logic - #407

Read files from directory
Run test for each read file

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

* refactor: roundtrip test logic - #407

Test inequality hardcore file name

Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
…roMark (JSON) - #397 (#411)

Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
…#412)

Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Rules: STRONG_RULE
Class in definedNodes
Transformer(CiceroMark JSON <-> OOXML)
Corresponding Test

Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
…397 (#418)

* feat(markdown-docx): text and emphasis transformer

Remove old transformer
Rules: EMPHASIS, TEXT, TEXT_STYLES, TEXT_WRAPPER, PARAGRAPH_WRAPPER
Tests: Check only for text-and-emphasis using if

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

* feat: heading transformer

Logic to transform headings
Rule: PARAGRAPH_PROPERTIES_RULE
Hardcore check the test for heading using condition

Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>

* feat: variable transformer

Logic to transform variables
Rules: Variable Rule
Conditionally check for tests

Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>

* feat: softbreak transformer

Logic for softbreak transformation
Rule: SOFTBREAK_RULE
Conditionally exclude the test for strong(file:strong.json)

Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>

* feat: strong transformer

Logic for strong transformation
Rule: STRONG_RULE
Check for all tests

Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>

* feat: add headingStyles and relationship specs

Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>

* refactor(markdown-docx): coding practices

Spread operator use inplace of push
Define constants as per convention
Add test for nesting

Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>

* refactor: Heading Properties

remove argument value from Rule
remove the condition to insert runtime properties in transformer

Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>
…etween OOXML and CiceroMark into one class - `OOXMLTransformer` (#425)

Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>

Signed-off-by: Aman Sharma <mannu.poski10@gmail.com>

Co-authored-by: Aman Sharma <mannu.poski10@gmail.com>
Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: K-Kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
K-Kumar-01 and others added 8 commits August 18, 2021 20:49
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: Dan Selman <danscode@selman.org>
Signed-off-by: Dan Selman <danscode@selman.org>
Signed-off-by: Dan Selman <danscode@selman.org>
Signed-off-by: Dan Selman <danscode@selman.org>
Signed-off-by: Dan Selman <danscode@selman.org>
@dselman dselman added the Type: Feature Request 🛍️ New feature or request label Sep 22, 2023
Signed-off-by: Dan Selman <danscode@selman.org>
Signed-off-by: Dan Selman <danscode@selman.org>
@github-actions
Copy link
Copy Markdown
Contributor

Pull Request Test Coverage Report for Build 6300882159

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 69.978%

Files with Coverage Reduction New Missed Lines %
packages/markdown-transform/lib/builtinTransforms.js 5 91.43%
Totals Coverage Status
Change from base Build 5830656148: 0.02%
Covered Lines: 2785
Relevant Lines: 3811

💛 - Coveralls

Signed-off-by: Dan Selman <danscode@selman.org>
Signed-off-by: Dan Selman <danscode@selman.org>
@dselman dselman merged commit b81ad36 into main Sep 25, 2023
@dselman dselman deleted the ds-wordml branch September 25, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature Request 🛍️ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants