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

Only create a target for object descriptions #10478

Merged
merged 32 commits into from Jul 28, 2023

Commits on Jun 4, 2022

  1. ObjectDescription: Add option :hidden:

    Add option :hidden: to ObjectDescription.  Currently, this option has no
    effect except being stored as attribute in the resulting node.
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    415eed4 View commit details
    Browse the repository at this point in the history
  2. ObjectDescription: Hide contents if :hidden: is given

    Do not produce any output only a target node if option :hidden: is
    given.  In this case all nodes representing this ObjectDescription are
    replaced by a single target where the target gets assigned all ids of
    the replaced nodes.
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    46f13ec View commit details
    Browse the repository at this point in the history
  3. ObjectDescription: Record source location for targets

    Record the source information (class attributes source and line) when
    replacing an object description node with a target node.
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    477d3f1 View commit details
    Browse the repository at this point in the history
  4. ObjectDescription: Replace collect_ids() with pure function

    The collect_ids() function uses the its second parameter ``ids:
    List[str]`` as in- and output parameter and always returns None.
    Rewrite the function to become pure and side effect free: return the
    list of ids as the return value not as an output parameter.
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    30f9cc8 View commit details
    Browse the repository at this point in the history
  5. ObjectDescription: Make replace_node_with_target() a static method

    replace_node_with_target() does not access the self-instance.  Thus,
    declare it as a static method.
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    a8ffd73 View commit details
    Browse the repository at this point in the history
  6. ObjectDescription: Factor out collect_ids() method

    Move the collect_ids() method from inside the replace_node_with_target()
    into the class scope (as static method) since it does not need the
    closure of the surrounding replace_node_with_target() method.  This also
    gives a potential speed boost.
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    4b9116c View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    61693f1 View commit details
    Browse the repository at this point in the history
  8. ObjectDescription: Inline replace_node_with_target()

    Inline the one-line method replace_node_with_target() into its only call
    site.  Since there are no call sites left, remove the method afterwards.
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    f97de0b View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    54b909e View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    2a3f189 View commit details
    Browse the repository at this point in the history
  11. Domain CPP: Update option_spec of superclass instead replacing it

    Instead of overriding the `option_spec` variable copy the `option_spec`
    of the superclass and update it.  This way changes in the superclass
    propagate to its children.  This is in line how other classes use
    "`option_spec`-inheritance".
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    0ebf888 View commit details
    Browse the repository at this point in the history
  12. Domain C and CPP: Drop :notypesetting: from alias object

    The alias objects override the run() method and thus do not support
    ``:notypesetting:`` option.
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    a6ff71c View commit details
    Browse the repository at this point in the history
  13. Domain JavaScript: Fix order of index and target nodes

    Correct node order generated by the .. js:module:: directive:  When
    generating an index entry, the index node must come before the target
    node.
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    28633ef View commit details
    Browse the repository at this point in the history
  14. Domain Python: Fix order of index and target nodes

    Correct node order generated by the .. py:module:: directive:  When
    generating an index entry, the index node must come before the target
    node.
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    3fdcc97 View commit details
    Browse the repository at this point in the history
  15. ObjectDescription: Do not create a target node without ids

    It might be that a object description has no ids associated with it,
    e.g. if the option :noindex: is passed.  In this case we would replace
    the object description node with a target node, which has no ids.  This
    breaks docutils assumption about a target node and leads not errors.
    Therefore, do only create a target node if we have ids to work with.
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    fd01cd0 View commit details
    Browse the repository at this point in the history
  16. Copy the full SHA
    d975c60 View commit details
    Browse the repository at this point in the history
  17. Reorder consecutive index and target nodes

    An index directive creates a index node followed by a target node.  Two
    consecutive index directives::
    
    .. index:: first
    .. index:: second
    
    create index, target, index, target, i.e. a mixture.  The interspersed
    index nodes prevent other transformations, e.g. PropagateTargets to
    properly work on the target nodes.
    
    Apply a transformation which reorders mixed and consecutive index and
    target nodes such that first all index nodes are before all target
    nodes:
    
    Given the following document as input:
    
        <document>
            <target ids="id1" ...>
            <index entries="...1...">
            <target ids="id2" ...>
            <target ids="id3" ...>
            <index entries="...2...">
            <target ids="id4" ...>
    
    The transformed result will be:
    
        <document>
            <index entries="...1...">
            <index entries="...2...">
            <target ids="id1" ...>
            <target ids="id2" ...>
            <target ids="id3" ...>
            <target ids="id4" ...>
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    3e791c9 View commit details
    Browse the repository at this point in the history
  18. Domain Python: Fix tests due to new index/target node order

    The post transform ReorderConsecutiveTargetAndIndexNodes reorders index
    and target nodes.  A snipped like::
    
       .. py:module:: mymodule
       .. py:data:: myvar
    
    generates the nodes::
    
       <index mymodule>
       <target mymodule>
       <index myvar>
       <descr myvar>
    
    which get reordered to::
    
       <index mymodule>
       <index myvar>
       <target mymodule>
       <descr myvar>
    latosha-maltba committed Jun 4, 2022
    Copy the full SHA
    0b6ed33 View commit details
    Browse the repository at this point in the history
  19. Copy the full SHA
    d1db8f2 View commit details
    Browse the repository at this point in the history
  20. Copy the full SHA
    fb0ad6c View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2023

  1. Merge branch 'master' into object_description_run_5.x

    # Conflicts:
    #	doc/usage/restructuredtext/domains.rst
    #	sphinx/directives/__init__.py
    #	sphinx/domains/c.py
    #	sphinx/domains/cpp.py
    #	sphinx/domains/javascript.py
    #	sphinx/domains/python.py
    #	sphinx/transforms/__init__.py
    AA-Turner committed Jul 28, 2023
    Copy the full SHA
    c3885db View commit details
    Browse the repository at this point in the history
  2. typing

    AA-Turner committed Jul 28, 2023
    Copy the full SHA
    6f73587 View commit details
    Browse the repository at this point in the history
  3. style

    AA-Turner committed Jul 28, 2023
    Copy the full SHA
    2857f26 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    75977dd View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    a5a708a View commit details
    Browse the repository at this point in the history
  6. Add to reST domain

    AA-Turner committed Jul 28, 2023
    Copy the full SHA
    5050ec5 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    6f45edb View commit details
    Browse the repository at this point in the history
  8. Updates

    AA-Turner committed Jul 28, 2023
    Copy the full SHA
    184773c View commit details
    Browse the repository at this point in the history
  9. Quotation marks

    AA-Turner committed Jul 28, 2023
    Copy the full SHA
    321816b View commit details
    Browse the repository at this point in the history
  10. rename

    AA-Turner committed Jul 28, 2023
    Copy the full SHA
    40484b5 View commit details
    Browse the repository at this point in the history
  11. rename

    AA-Turner committed Jul 28, 2023
    Copy the full SHA
    3c46064 View commit details
    Browse the repository at this point in the history
  12. Update CHANGES entry.

    AA-Turner committed Jul 28, 2023
    Copy the full SHA
    1db991f View commit details
    Browse the repository at this point in the history