Title: How to return the heading number · Issue #590 · python-openxml/python-docx · GitHub
Open Graph Title: How to return the heading number · Issue #590 · python-openxml/python-docx
X Title: How to return the heading number · Issue #590 · python-openxml/python-docx
Description: Hi I have managed to return the heading text in a given filename (thank you to the great experts at Stack Overflow) however I cannot return the heading number. Refer to code below. Is there a way to print/return the heading number (list ...
Open Graph Description: Hi I have managed to return the heading text in a given filename (thank you to the great experts at Stack Overflow) however I cannot return the heading number. Refer to code below. Is there a way t...
X Description: Hi I have managed to return the heading text in a given filename (thank you to the great experts at Stack Overflow) however I cannot return the heading number. Refer to code below. Is there a way t...
Opengraph URL: https://github.com/python-openxml/python-docx/issues/590
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to return the heading number","articleBody":"Hi\r\n\r\nI have managed to return the heading text in a given filename (thank you to the great experts at Stack Overflow) however I cannot return the heading number. Refer to code below. Is there a way to print/return the heading number (list numbering value not heading level). \r\n\r\nThanks\r\n```\r\nimport docx\r\n\r\ndoc=docx.Document('filename.docx')\r\n\r\ndef iter_heading(paragraphs):\r\n for paragraph in paragraphs:\r\n if paragraph.style.name('Heading 1'):\r\n yield paragraph\r\n\r\nfor heading in iter_heading(doc.paragraphs):\r\n print(heading.text)\r\n```\r\n\r\n","author":{"url":"https://github.com/tfitzhardinge","@type":"Person","name":"tfitzhardinge"},"datePublished":"2018-12-31T05:08:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/590/python-docx/issues/590"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7f095995-d71a-e25e-8a26-5233ba6ec35a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E5E8:DD69B:303C400:404BE63:696EFD5F |
| html-safe-nonce | 30937e0690d9d3623230e0da3860dc303333e05d6797d4e7dc90e27e9a71a688 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUU4OkRENjlCOjMwM0M0MDA6NDA0QkU2Mzo2OTZFRkQ1RiIsInZpc2l0b3JfaWQiOiI3ODMwNTU5MTQ3MTk4MTg0Nzk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 88eb1f84e73530f8b92d015ce0d76032818c77967998331c5014542997a758d2 |
| hovercard-subject-tag | issue:394929997 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-openxml/python-docx/590/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ad9aa1be04eff699bd5095640bca17a177b2311bae5ff6de72879d829861fd39/python-openxml/python-docx/issues/590 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ad9aa1be04eff699bd5095640bca17a177b2311bae5ff6de72879d829861fd39/python-openxml/python-docx/issues/590 |
| og:image:alt | Hi I have managed to return the heading text in a given filename (thank you to the great experts at Stack Overflow) however I cannot return the heading number. Refer to code below. Is there a way t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tfitzhardinge |
| hostname | github.com |
| expected-hostname | github.com |
| None | b278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee |
| turbo-cache-control | no-preview |
| go-import | github.com/python-openxml/python-docx git https://github.com/python-openxml/python-docx.git |
| octolytics-dimension-user_id | 3403760 |
| octolytics-dimension-user_login | python-openxml |
| octolytics-dimension-repository_id | 13592924 |
| octolytics-dimension-repository_nwo | python-openxml/python-docx |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 13592924 |
| octolytics-dimension-repository_network_root_nwo | python-openxml/python-docx |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 39aed5006635ab6f45e6b77d23e73b08a00272a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width