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

Foot/endnotes, Indexes, Char styles #393

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

spacecat56
Copy link

I needed these features - applying a named character style, inserting index entries and index fields, and adding footnotes - for a project. I worked them into fork of the latest FOSS version of DocX, and the library so modified is serving my needs. I noticed some others are interested in at least some of this, e.g. footnotes, and offer my changes for consideration. There are some interdependencies and when I started I did not anticipate pushing the work back to github, so, "sorry", they are not separately tagged, I just copied the changes all together over a fresh fork/clone.

@XceedBoucherS
Copy link
Collaborator

Thank you,
We will review it before merging it.

@spacecat56
Copy link
Author

I had occasion to process a large input that produced a report with tens of thousands of footnotes. It was very slow, and in profiling I saw that MaxFootnoteId() function was dominating the CPU usage; the optimization I made reduces its CPU to triviality and improved my total process by about 70%. Also in one case there was a failure due to a malformed URL in the input data, it was inconvenient to anything more than catch and ignore, so, that's what I did with it.

Do I need to do anything to amend the Pull request or is that automatic?

@XceedBoucherS
Copy link
Collaborator

Hi,
No the Pull Request is not automatic. We need to review and adapt your suggestion in order to respect the code architecture from this project. Your suggestion (usually adapted) will appear in a future release.
Thank you.

@spacecat56
Copy link
Author

Thanks, but I'm not clear if that's answering the question I meant to ask; I didn't even imagine that the pull would be merged in automatically, rather I am wondering about the additional commits I made to fix things; perhaps more clearly:

"when I make a further commit to the fork/branch that I previously made the pull request for, do I need to do something to the pull request for you to include the new commit in your consideration?"

thanks,

/t

@XceedBoucherS
Copy link
Collaborator

Hi,
No, you don't have anything to do. I saw your new commit to the initial Pull Request. I can update based on your suggestion.
Thank you for your suggestion.

@XceedBoucherS
Copy link
Collaborator

Hi,

Based on your suggestion, the structure of the project and the users demand, it has been decided that footnotes/endnotes will be added to the project DocX. But a bit different than your suggestion. It will be included in v1.9.

Here are the base lines:
-Footnotes/Endnotes will work in the same way
-Footnotes/Endnotes will have the following properties:
-CustomMark: to use specific symbol instead of the standard numbering
-Paragraphs: to modify the content of the Footnote/Endnote
-A document can add a Footnote/Endnote by specifying its content: string, Hyperlink, Picture, Table...
-A Paragraph can append a Footnote/endnote and modify the numbering formatting

Cross reference Footnotes/Endnotes are still under evaluation.
The features "applying a named character style, inserting index entries and index fields" are still under evaluation.

Thank you

@spacecat56
Copy link
Author

Thanks for the update (info). Of course, I'd prefer to eventually be able to drop my fork, still however much of the work you adopt/adapt will be helpful. I did notice that I only allowed for one Paragraph in a Xnote and saw it was a limitation, though not impacting my use case; I guess you got past that, that sounds good.

I've noticed that my "brackets" around Xnote numbers are not understood by Libre Office, and I assume also not by Open Office. They work OK in Word, and I did not see the point addressed in the spec, so, I guess it's pot-luck. I'm sure I'll be interested to see how your CustomMark works, at that future date.

Finally, I think now that my "named character style" may be redundant / unnecessary (though it is odd to have the property ignored)... it seems that if I call Paragraph.Style(id) immediately after using Paragraph.Append(text), it applies the style to the run the was just added... the code seems a bit confusing and I'm clear if that is exactly, or all, what it does.

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