Skip to content

Feature: Add Bookmark #425

@Benjamin-T

Description

@Benjamin-T

As multiple issues have stated before, it would be great if we the captions supported in python-docx. Previous issues already should temporary fixes to similar problems like the IndexedEntry (#137) and the figure caption in (#359).
Also bookmarks have been investigated: (#109)
As I understood from: feature analysis: section columns and Feature: Paragraph.add_hyperlink() (wip)
Is that there are a few mandatory steps to take before a pull request is accepted:

  • Feature analysis:
    1. XML schema analysis
    2. Candidate API (preferably based on the VBA API
    3. Specimen XML
  • Tests:
    1. Acceptance Test
    2. Unittests

Finally: Focus is key, one feature should only by a single functionality, to quote @scanny:

  • No code gets merged without its corresponding unit test.
  • No unit test gets written without a failing acceptance test.
  • Each commit is one atomic piece of functionality, generally a single property or method.

Now I've collected the available issues and pull request my question is, how to go from here. I would assume that we start at the beginning: Feature analysis

Adding the caption to a paragraph isn't directly the issue, the main goal is to create a feature which can be used together with a crossreference. Therefore the number of references or bookmarks that are created should be stored in an object. This object should be available to the caption method, in order to be support a sort of 'guessed figure/table number'. What I mean by this is best explained with an example:

The proposed solution in #359 works. Only he user first has to create a print view to force a fieldcode refresh to make the numbers visible. Therefore, it would be nice if the caption method could already place a "guessed" number. (Comparable as how Word behaves)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions