GeezerVison is showing github.com — Add ability to restart numbering by yurac · Pull Request #210 · python-openxml/python-docx
Conversation
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi @yurac. I'm sorry to bother you. I'm trying to get ordered list resetting working, but attempting to do so while using the main python-docx distribution in my environment for now (waiting until such time as your patch, or a similar one, is incorporated).
Anyway, I just copy/pasted what you've got going on here: #25, and I'm trying to simply use it directly in my script.
However, my elements aren't renumbering between separated ordered lists, and I'm a bit stumped. Can I beg three minutes of your time?
Here's my clumsy attempt to use your method in-line in my script:
https://gist.github.com/photuris/8f71166deec7f8f5a774
No errors, just nothing's happening (I'd rather have errors). My two lists simply continue numbering, 1 2 3 4 5 6, rather than 1 2 3 1 2 3.
Thanks in advance! I'll be forever in your debt.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi,
I am not sure I understand your code. You can take my pull request as is
together with the example and see if it works for you. If it does not, you
will have to create a docx template corresponding to the example. Such as
adding there abstract numbering with id "10" as used in the example. Then
you can continue from there. You will probably have to read through
python-docx code and some of docx oxml documentation. There is another
project - olebole/python-docx that has a different solution for restart
numbering
Hi @yurac https://github.com/yurac. I'm sorry to bother you. I'm trying
to get ordered list resetting working, but attempting to do so while using
the main python-docx distribution in my environment for now (waiting until
such time as your patch, or a similar one, is incorporated).
Anyway, I just copy/pasted what you've got going on here: #25
#25, and I'm trying
to simply use it directly in my script.
However, my elements aren't renumbering between separated ordered lists,
and I'm a bit stumped. Can I beg three minutes of your time?
Here's my clumsy attempt to use your method in-line in my script:
https://gist.github.com/photuris/8f71166deec7f8f5a774
No errors, just nothing's happening (I'd rather have errors). My two lists
simply continue numbering, 1 2 3 4 5 6, rather than 1 2 3 1 2 3.
Thanks in advance! I'll be forever in your debt.
—
Reply to this email directly or view it on GitHub
#210 (comment)
.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Ok, I figured it out.
- I had to poke around in the xml source for my template file, to figure
out that the abstract numbering ID I needed was "12." So I hard-coded that
in.
- I created a function called _reset_list() which manually adds XML
elements to the first item in my list, to reset the numbering (which I
deduced by poking around on the OpenXML spec on MSDN). I call this function
on the first iteration of my item list.
Ugly, but it works, so for the time being I'm satisfied.
(Tangentially, I used a similar manual XML manipulation technique to edit
my template's header, found in headers1.xml in the source document).
Thank you for taking the time to respond.
On Sat, Jan 30, 2016 at 9:46 AM, yurac [email protected] wrote:
Hi,
I am not sure I understand your code. You can take my pull request as is
together with the example and see if it works for you. If it does not, you
will have to create a docx template corresponding to the example. Such as
adding there abstract numbering with id "10" as used in the example. Then
you can continue from there. You will probably have to read through
python-docx code and some of docx oxml documentation. There is another
project - olebole/python-docx that has a different solution for restart
numbering
Hi @yurac https://github.com/yurac. I'm sorry to bother you. I'm trying
to get ordered list resetting working, but attempting to do so while using
the main python-docx distribution in my environment for now (waiting until
such time as your patch, or a similar one, is incorporated).
Anyway, I just copy/pasted what you've got going on here: #25
#25, and I'm trying
to simply use it directly in my script.
However, my elements aren't renumbering between separated ordered lists,
and I'm a bit stumped. Can I beg three minutes of your time?
Here's my clumsy attempt to use your method in-line in my script:
https://gist.github.com/photuris/8f71166deec7f8f5a774
No errors, just nothing's happening (I'd rather have errors). My two lists
simply continue numbering, 1 2 3 4 5 6, rather than 1 2 3 1 2 3.
Thanks in advance! I'll be forever in your debt.
—
Reply to this email directly or view it on GitHub
<
#210 (comment)
.
—
Reply to this email directly or view it on GitHub
#210 (comment)
.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Good to hear that you got it working. I also had to spend some time to make
it work. What I did is a script that converts a subset of asciidoc to docx.
Works good for me since then.
On Feb 1, 2016 9:47 PM, "Joshua Pruitt" [email protected] wrote:
Ok, I figured it out.
- I had to poke around in the xml source for my template file, to figure
out that the abstract numbering ID I needed was "12." So I hard-coded that
in.
- I created a function called _reset_list() which manually adds XML
elements to the first item in my list, to reset the numbering (which I
deduced by poking around on the OpenXML spec on MSDN). I call this function
on the first iteration of my item list.
Ugly, but it works, so for the time being I'm satisfied.
(Tangentially, I used a similar manual XML manipulation technique to edit
my template's header, found in headers1.xml in the source document).
Thank you for taking the time to respond.
On Sat, Jan 30, 2016 at 9:46 AM, yurac [email protected] wrote:
Hi,
I am not sure I understand your code. You can take my pull request as is
together with the example and see if it works for you. If it does not,
you
will have to create a docx template corresponding to the example. Such as
adding there abstract numbering with id "10" as used in the example. Then
you can continue from there. You will probably have to read through
python-docx code and some of docx oxml documentation. There is another
project - olebole/python-docx that has a different solution for restart
numbering
Hi @yurac https://github.com/yurac. I'm sorry to bother you. I'm
trying
to get ordered list resetting working, but attempting to do so while
using
the main python-docx distribution in my environment for now (waiting
until
such time as your patch, or a similar one, is incorporated).
Anyway, I just copy/pasted what you've got going on here: #25
#25, and I'm
trying
to simply use it directly in my script.
However, my elements aren't renumbering between separated ordered lists,
and I'm a bit stumped. Can I beg three minutes of your time?
Here's my clumsy attempt to use your method in-line in my script:
https://gist.github.com/photuris/8f71166deec7f8f5a774
No errors, just nothing's happening (I'd rather have errors). My two
lists
simply continue numbering, 1 2 3 4 5 6, rather than 1 2 3 1 2 3.
Thanks in advance! I'll be forever in your debt.
—
Reply to this email directly or view it on GitHub
<
#210 (comment)
.
—
Reply to this email directly or view it on GitHub
<
#210 (comment)
.
—
Reply to this email directly or view it on GitHub
#210 (comment)
.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi, first of all thanks for all your work.
What is the state of this pull request? Is something missing or not working correctly? I would be very interested in having this feature on master :-)
Best, Andi
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi,
It works for me but requires some changes in the user docx template.
Would be nice if this or other solution is integrated into python-docx.
Best,
Yuri
On Mon, Jun 6, 2016 at 12:43 PM, Andreas Kobler [email protected]
wrote:
Hi, first of all thanks for all your work.
What is the state of this pull request? Is something missing or not
working correctly? I would be very interested in having this feature on
master :-)
Best, Andi
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#210 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABCdOLmLBcX6obEwlNkfjjjyu6ispOHwks5qI-vJgaJpZM4GC5wB
.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
whtsky
added a commit
to whtsky/python-docx
that referenced
this pull request
Oct 23, 2019
ncrecruitment reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Any update on this, is there a fork to check, there are no commits in the Master branch for 2 years.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
It's an old PR, but it would be really nice if python-docx could support restating a number list. Is there anything left to be done for this PR to be merged? I can help if you want.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
hello i want to achieve this:
a xxxx
b xxxx
c xxxx
a yyy
b yyy
c yyy
can anyone help me
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
这是一个旧的 PR,但如果可以支持重述数字列表,那就太好了。合并此 PR 还需要做些什么吗?如果你愿意,我可以帮忙。python-docx
hello i want to achieve this:
a xxxx
b xxxx
c xxxx
a yyy
b yyy
c yyy
can anyone help me
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|