GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add ability to restart numbering by yurac · Pull Request #210 · python-openxml/python-docx

Conversation

@yurac

@yurac yurac commented Sep 24, 2015

Copy link
Copy Markdown

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Yuri Chernyavsky
Restart numbering
b1463a2
@yurac yurac mentioned this pull request Sep 24, 2015
Restart numbering of an ordered list in document. #25
Open
@photuris

photuris commented Jan 29, 2016

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yurac

yurac commented Jan 30, 2016

Copy link
Copy Markdown
Author

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)
.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@photuris

photuris commented Feb 1, 2016

Copy link
Copy Markdown

Ok, I figured it out.

  1. 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.
  2. 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)
.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yurac

yurac commented Feb 1, 2016

Copy link
Copy Markdown
Author

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.

  1. 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.
  2. 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)
.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@akobler

akobler commented Jun 6, 2016

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yurac

yurac commented Jun 6, 2016

Copy link
Copy Markdown
Author

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
.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Yuri Chernyavsky added 2 commits November 22, 2016 10:58
Yuri Chernyavsky Yuri Chernyavsky
Test
1034545
Yuri Chernyavsky Yuri Chernyavsky
Add shared IntOrPercent object
80ca2ea
whtsky added a commit to whtsky/python-docx that referenced this pull request Oct 23, 2019
@whtsky
Merge remote-tracking branch 'yurac/restart_numbering' into restart_n…
5be105d
…umbering

python-openxml#210
@yash-dalmia

yash-dalmia commented Sep 8, 2021

Copy link
Copy Markdown

Any update on merge?

ncrecruitment reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jjalonsoc

jjalonsoc commented May 8, 2023

Copy link
Copy Markdown

Any update on this, is there a fork to check, there are no commits in the Master branch for 2 years.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mzaveiro

mzaveiro commented Jul 5, 2024

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sweet-smile-1

sweet-smile-1 commented Jul 5, 2024

Copy link
Copy Markdown

hello i want to achieve this:
a xxxx
b xxxx
c xxxx
a yyy
b yyy
c yyy
can anyone help me

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sweet-smile-1

sweet-smile-1 commented Jul 5, 2024

Copy link
Copy Markdown

这是一个旧的 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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@toxicphreAK toxicphreAK mentioned this pull request Aug 4, 2026
Check pull request comments and evaluate pulls toxicphreAK/python-docx-ng#13
Closed
@pseudosavant pseudosavant mentioned this pull request Sep 24, 2026
Add independent list instances and continuation paragraphs #1614
Draft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

7 participants

@yurac @photuris @akobler @yash-dalmia @jjalonsoc @mzaveiro @sweet-smile-1
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.