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

item-matrix: Show item content #382

Merged
merged 10 commits into from
Jul 31, 2024
Merged

item-matrix: Show item content #382

merged 10 commits into from
Jul 31, 2024

Conversation

JasperCraeghs
Copy link
Member

@JasperCraeghs JasperCraeghs commented Jul 11, 2024

In HTML, when you right-click a row, the content of all internal items in the row are fetched and displayed.
Successive right-clicks toggle the visibility of the items' content.

The item content is now displayed in a <div> element instead of a <blockquote> to get rid of the unwanted indentation reported in #377.

  • tested in internal project

FYI @gcrabbe

@JasperCraeghs JasperCraeghs requested a review from Letme July 11, 2024 16:52
@gcrabbe
Copy link

gcrabbe commented Jul 12, 2024

You might also want to consider putting the item contents inside the admonition used for the title:

class TraceableBaseNode(nodes.General, nodes.Element, ABC):
    """ Base class for all Traceability node classes. """

    def create_top_node(self, title, app=None, hide_title=False):
        ''' Creates the top node for the Element node.

        When the title should be shown, an admonition object with given title is added.

        Args:
            title (str): Title or item ID of the top node
            app (sphinx.application.Sphinx): Optional application object, needed when item ID is given to create link
            hide_title (bool): True to add the title in an admonition node; False to return an empty container node

        Returns:
            nodes.container: Top level replacement node to which other nodes can be appended
        '''
        top_node = nodes.admonition()
        top_node['classes'].append('item')
        if not hide_title:
            title_node = nodes.title()
            if app:
                title_node += self.make_internal_item_ref(app, title).children[0]
            else:
                title_node += nodes.Text(title)
            top_node += title_node
        return top_node

Note that the code snippet above hasn't been tested, so take it with a grain of salt.

@JasperCraeghs JasperCraeghs changed the title Draft: Show item content in item-matrix Draft: item-matrix: Show item content Jul 24, 2024
@JasperCraeghs JasperCraeghs changed the title Draft: item-matrix: Show item content item-matrix: Show item content Jul 29, 2024
@JasperCraeghs JasperCraeghs marked this pull request as draft July 30, 2024 08:05
@JasperCraeghs JasperCraeghs marked this pull request as ready for review July 30, 2024 08:37
@Letme
Copy link
Member

Letme commented Jul 31, 2024

Right-click does not work for me (opens menu), and can we get a expand all by default option? Also when on mobile, you dont really have option for right-click so might be better to add maybe a down-ward arrow as we have in item itself.

@JasperCraeghs
Copy link
Member Author

Right-click does not work for me (opens menu), and can we get a expand all by default option?

Have you cleared your browser cache for the example documentation? The traceability.js has been altered. And are you hosting the webpage on a local server, if not, nothing happens?

@Letme
Copy link
Member

Letme commented Jul 31, 2024

True, cache was the problem.

@Letme Letme merged commit 3fd420b into master Jul 31, 2024
8 checks passed
@Letme Letme deleted the description-in-matrix branch July 31, 2024 20:28
Letme added a commit that referenced this pull request Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants