Edgewall Software
Modify

Opened 6 years ago

Closed 5 years ago

Last modified 4 years ago

#13056 closed enhancement (fixed)

Allow macros to be hidden from documentation

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.3.6
Component: wiki system Version:
Severity: normal Keywords: macro
Cc: Branch:
Release Notes:
API Changes:

Macros can be hidden from the MacroList index by setting WikiMacroBase.hide_from_macro_index to True or returning None from IWikiMacroProvider.get_macro_description.

Internal Changes:

Description (last modified by Ryan J Ollos)

For "internal use only" macros like WikiMacros#LatestRelease-macro, it would be good to hide from the wiki macro help. We could either hide the macros with no documentation, or have a class attribute that indicates the macro should be hidden.

Another possible application is to hide documentation for that require a permission that the user does not possess.

Attachments (0)

Change History (9)

comment:1 by Ryan J Ollos, 6 years ago

Description: modified (diff)

comment:2 by Ryan J Ollos, 6 years ago

Description: modified (diff)
Milestone: next-major-releases1.3.4
Owner: set to Ryan J Ollos
Status: newassigned

The proposed changes (log:rjollos.git:t13056_hidden_macros)

  • Are backward-compatible
  • Allow hiding a macro help using _description = None

If that change looks okay I'll add tests.

To hide macro documentation based on user permissions we'd need to pass formatter to get_macro_description, so that formatter.req could be used. To be consistent with arguments of other methods we'd have to change:

- def get_macro_description(self, name):
+ def get_macro_description(self, formatter, name):

I don't have a particular use for that change now, so I'll skip it.

comment:3 by Jun Omae, 6 years ago

I like to add property to hide (e.g. hidden_macro_index) like IRequestHandler.is_valid_default_handler rather than _description = None.

If you'd like to use macro description is None, I think we should add the same document to IWikiMacroProvider.get_macro_description(). Macro can be implemented IWikiMacroProvider without WikiMacroBase.

Also, th:WikiAutoCompletePlugin uses WikiSystem.macro_providers and get_macro_description(). It might be good to provide patch.

comment:4 by Ryan J Ollos, 6 years ago

Milestone: 1.3.41.3.5

comment:5 by Ryan J Ollos, 5 years ago

Milestone: 1.3.51.3.6

in reply to:  3 comment:6 by Ryan J Ollos, 5 years ago

Replying to Jun Omae:

I like to add property to hide (e.g. hidden_macro_index) like IRequestHandler.is_valid_default_handler rather than _description = None.

Sounds good. I will make those changes.

comment:8 by Ryan J Ollos, 5 years ago

Added test coverage: [e20f620b1/rjollos.git].

Version 0, edited 5 years ago by Ryan J Ollos (next)

comment:9 by Ryan J Ollos, 5 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in r17053, r17054.

comment:10 by Ryan J Ollos, 4 years ago

API Changes: modified (diff)
Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.