usr-local-ΕΨΗΕΛΩΝ
usr-local-ΕΨΗΕΛΩΝ

Reputation: 26924

Enabling syntax colouring in ViewVC for SVN

I have just installed ViewVC 1.1.21 on a machine hosting a SVN repository that was migrated from an old CVS.

I wanted to enable syntax colouring for source files (Java, properties and XML files) as Eclipse does. I have installed both python-Pygments and python3-Pygments no matter the difference between the two. I also set enable_syntax_coloration = 1.

I have noticed that all files have svn:mime-type as text/plain.

Does the mime type affect syntax highlighting? Do I have to do something else to fix colouring?

Upvotes: 1

Views: 899

Answers (2)

Kandy
Kandy

Reputation: 388

I need to add on the viewvc.conf this configuration

default_file_view = markup

Best Regards Kandy

Upvotes: 0

Paul Sweatte
Paul Sweatte

Reputation: 24637

Use the following process:

  • Set detect_encoding = 1 in viewvc.conf

  • Set enable_syntax_coloration = 1 in viewvc.conf

Here are the caveats:

Requires 'chardet' module, and is currently used only by the syntax coloration logic -- if enabled -- for the 'markup' and 'annotate' views; see 'enable_syntax_coloration'.

If that fails, use the legacy process:

  • Set use_enscript = 0 in viewvc.conf

  • Set use_highlight = 1 in viewvc.conf

  • Find highlight_path in viewvc.conf

    • Uncomment it

    • Do ls on the value

    • If Pygments is there, do nothing

    • Otherwise, use which to find the path to Pygments, then set that as the new value

  • Enable mime_types_files in viewvc.conf

  • Find mime_types_files in viewvc.conf

    • Do ls on the value

    • If mime.types is there, do nothing

    • Otherwise, use find to find the path to mime.types, then set that as the new value

References

Upvotes: 1

Related Questions