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

Attaching numbering to custom style #1163

Merged

Conversation

anti-the-social
Copy link
Contributor

@anti-the-social anti-the-social commented Sep 16, 2021

Issue: #1147
Here are my first deep touches on docx :) Interesting structure, I should admit, took some time to learn it.

To sum PR up:

  1. Moved numbering props level higher at src/file/paragraph/properties.ts
    from IParagraphPropertiesOptions to IParagraphStylePropertiesOptions
  2. Added numId replacer at src/export/packer/next-compiler.ts for styles.xml
  3. Added demo on how it meant to be used at demo/11-declaritive-styles-2.ts

Didn't came up with some good tests since numbering is covered, while NumberingReplacer isn't in general.

@dolanmiu
Copy link
Owner

Looks good!

@anti-the-social quick question, I can see the numbering part of the interface has been shifted to another location

Will this affect other areas of docx? Breaking change?

@dolanmiu dolanmiu merged commit 9354b99 into dolanmiu:master Sep 17, 2021
@anti-the-social
Copy link
Contributor Author

@dolanmiu it sort of expands the library, not narrows so it shouldn't break anything.
But there is a chance that IParagraphStylePropertiesOptions(where I moved numbering) used in the places where numbering things are not allowed by Word.
Have not checked that yet. I'll try to check that once have time

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