Skip to content

Enhance !contents to support filtering by Suites tag using -t option - #1568

Open
JGProg wants to merge 2 commits into
unclebob:masterfrom
JGProg:jgia/FilterContentByTags
Open

Enhance !contents to support filtering by Suites tag using -t option#1568
JGProg wants to merge 2 commits into
unclebob:masterfrom
JGProg:jgia/FilterContentByTags

Conversation

@JGProg

@JGProg JGProg commented Jun 6, 2025

Copy link
Copy Markdown

Summary

This pull request enhances the existing !contents directive by adding a new optional argument: -t, allowing users to filter listed pages based on the Suites property.


Motivation

In many projects, the same suite structure is reused across multiple contexts or products (e.g. Product A, Product B). However, some pages are only relevant to a specific product. Until now, there was no way to filter the !contents listing dynamically by tag.

This change adds that capability.


New behavior: -t option

You can now use !contents like this:

!contents -R2 -tProductA

@JGProg

JGProg commented Jun 6, 2025

Copy link
Copy Markdown
Author

@fhoeben do you mind reviewing? thanks :)

@JGProg JGProg changed the title Enhance !contents to support filtering by Suites tag using -tag / -t option Enhance !contents to support filtering by Suites tag using -t option Jun 6, 2025

@fhoeben fhoeben left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Can you also add some tests and some documentation (as a wiki page)?

import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.*;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use .* imports

@JGProg

JGProg commented Jun 24, 2025

Copy link
Copy Markdown
Author

it's ok @fhoeben :)
I creat two unit test and add documentation :)

@JGProg
JGProg force-pushed the jgia/FilterContentByTags branch 2 times, most recently from d87a23b to 86d3662 Compare June 25, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants