Modify

Opened 6 years ago

Last modified 7 months ago

#3620 assigned enhancement

Add wiki page revision support

Reported by: anonymous Owned by: rjollos
Priority: normal Component: IncludeMacro
Severity: normal Keywords: revision
Cc: Trac Release: 0.10

Description

It would be nice to allow for selecting specific revisions of wiki pages. This can be done with links to source files in the repository, but I envision a need to do this for wiki pages as well.

For example, if I have a set of wiki pages that make up the documentation for my component, I can use an "include" macro to collect the pages onto a single page for generation of a user manual. While that page should change over time (as revisions to the manual are made), I'd like to be able to fix a specific version of that page to a specific version of my user manual. So, a specific version of the user manual will be made up of the set of specific versions of each wiki page that makes up the user manual. Once I've "released" my user manual, I don't want additional changes to the manual to be made. The wiki pages that make up the user manual may change as new items get added and updated, but without approval, they should not be incorporated into the previous version of the user manual.

I see two approaches...

[[Include(PageName@rev#)]] to pick a specific version of the page.

or,

[[Include(PageName, rev#, ...)]] to pick a specific version of the page.

The former may be preferable since it parallels the source file selection in wiki links.

Attachments (0)

Change History (5)

comment:1 Changed 4 years ago by hasienda

  • Keywords revision added
  • Summary changed from Add wiki page revision support... to Add wiki page revision support

#4011 was closed as a duplicate, but proposes following code to actually fix this

try:
    source_format, source_obj = source.split('#', 1)

except ValueError?: # If no : is present, assume its a wiki page
    source_format, source_obj = 'wiki', source

try:
    source_obj, source_ver = source_obj.split(':', 1)

except ValueError?: # If no : is present, assume its a wiki page
    source_ver, source_obj = None, source_obj

. . .

page = WikiPage?(self.env, source_obj, version=source_ver)

comment:2 Changed 2 years ago by rjollos

  • Owner changed from coderanger to rjollos
  • Status changed from new to assigned

I'm not understanding the need for the trailing # in comment:description, and the example in comment:1 appears to be a little mixed-up as well, with regard to the characters that are used for splitting. I'll commit an implementation of this shortly, and please let me know if I'm overlooking something.

comment:3 Changed 2 years ago by rjollos

(In [11628]) Refs #3620: Added support for specifying the revision of a wiki page.

comment:4 Changed 14 months ago by rjollos

  • Status changed from assigned to new

comment:5 Changed 7 months ago by rjollos

  • Status changed from new to assigned

Add Comment

Modify Ticket

Action
as assigned .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.