Migrating an old in-house system to Trac

39 views
Skip to first unread message

s mcgraw

unread,
May 13, 2024, 4:57:07 PMMay 13
to Trac Users
Hello all,

I am new to Trac and am looking into migrating an old in-house task tracking system to Trac and had a couple questions.

1. Most of the existing tickets and doc being migrated are rst and we will continue that practice so not requiring every entry to be wrapped in a "{{{#!rst" block would be nice.  Is it possible make the default wiki formatting engine the reStructuredText one rather than Trac's native one?

2. I would like dates/times to display in absolute format but in an ISO-like format with the "T" replaced with a space and with seconds and timezone left off: "2024-02-01 13:26".  Is this possible?

Thanks for any info...

-- Stuart

RjOllos

unread,
May 20, 2024, 6:12:56 PMMay 20
to Trac Users
On Monday, May 13, 2024 at 1:57:07 PM UTC-7 s mcgraw wrote:
Hello all,

I am new to Trac and am looking into migrating an old in-house task tracking system to Trac and had a couple questions.

1. Most of the existing tickets and doc being migrated are rst and we will continue that practice so not requiring every entry to be wrapped in a "{{{#!rst" block would be nice.  Is it possible make the default wiki formatting engine the reStructuredText one rather than Trac's native one?

You can do that with a plugin. MarkdownMacro has the feature for Markdown. It would be straightforward to copy the implementation for RST.
 
2. I would like dates/times to display in absolute format but in an ISO-like format with the "T" replaced with a space and with seconds and timezone left off: "2024-02-01 13:26".  Is this possible?

There are some configuration options:

If you want to remove the "T" and other mods, maybe some JavaScript customization. Or you can write likely write a plugin that hooks into the datetime formatting methods.

Clemens Feige

unread,
May 21, 2024, 7:37:02 AMMay 21
to trac-...@googlegroups.com

RjOllos wrote on 21.05.2024 at 00:12:
On Monday, May 13, 2024 at 1:57:07 PM UTC-7 s mcgraw wrote:
[snip]

 
2. I would like dates/times to display in absolute format but in an ISO-like format with the "T" replaced with a space and with seconds and timezone left off: "2024-02-01 13:26".  Is this possible?

There are some configuration options:

If you want to remove the "T" and other mods, maybe some JavaScript customization. Or you can write likely write a plugin that hooks into the datetime formatting methods.

I have the same wish as Stuart. For my users the full ISO-format the date is too long and hard to read. They would be happy with just YYYY-MM-DD, i.e. omitting hours, minutes, seconds and time-zone. I would appreciate if somebody can offer a ready solution. 

I am not a TRAC developer but I searched in the TRAC 1.4 source code. In file "util/datefmt.py", method "_format_datetime()" calls method "_format_datetime_iso8601" with a "long" format. If this is changed to "short" format, then the seconds and timezone are omitted.

JavaScript has been proposed, too ...

Clemens

Stuart McGraw

unread,
May 30, 2024, 2:54:00 AMMay 30
to trac-...@googlegroups.com
Thanks for the pointer to MarkdownMacro, I'll take a close look at that. I'm still trying to grok the plugin architecture and the Trac code in general so it may take a bit.

I'm not sure I understand your suggestion of using a plugin for modifying the ISO datetime format. That would require some existing extension points in the datetime module wouldn't it? I don't think I saw anything that looked like that. For now I made a hack in the datetime module to modify the ISO format output which seems work ok but it's quite possible I'll discover down the line that I broke something else so it would be nice to find a way that's more "approved".

-- Stuart

Stuart McGraw

unread,
May 30, 2024, 2:54:03 AMMay 30
to trac-...@googlegroups.com
For now I ended up just modifying the ISO formatted output of that function. I agree that the default ISO format is too hard to read and too verbose (I already know what timezone I'm in, don't need it mentioned in every timestamp.)

As for Javascript, that will be a bit of effort given my JS knowledge is at the Google search-copy-paste level. :-)

-- Stuart

Reply all
Reply to author
Forward
0 new messages