prettylogs

command module
v0.0.0-...-fbb687e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 1 Imported by: 0

README

prettylogs

make IRC logs pretty

braking changes

  • 2023-01-09: switched from external CSS to embedding CSS in the template file, this means the generated html is completely standalone.

assumptions

This makes some pretty bad assumptions about the format of the weechat log file. for it to work out of the box set:

logger.file.nick_prefix "<"
logger.file.nick_suffix ">"
weechat.look.prefix_join "→" or "->"
weechat.look.prefix_quit "←" or "<-"

it also assumes you're using the default timestamp format for the logger.

usage

Flags:
  -C, --colorfile    nick color file
  -c, --config       config file
  -v, --debug        debug verbosity
  -f, --force        force overwrite destination file
  -h, --help         help for prettylogs
  -d, --outputdir    Directory to write output file into
  -T, --template     template file (default "template.html")
  -t, --title        override title in rendered file

the following flags can be set in config by using their long names:

~/.config/prettylogs.toml:

colorfile = "/path/to/colorfile" # note these paths can be absolute or relative, but the config doesn't support "~" expansion
template = "/path/to/template.html"
outputdir = "."

or by their environment variables:

  • PRETTYLOG_NICK_COLOR_FILE
  • PRETTYLOG_TEMPLATE_FILE
  • PRETTYLOG_OUTPUT_DIR

output

the output file name and page title are inferred from the input file name.

if the input file is "channel.txt", the output file will be "output.html" with a title of "output"

templating

The template is passed the following data structure:

    Title: ""
    CSSPath: ""
    lines:
    - Who: "" # nickname
      Time: "" # timestamp
      Message: "" # the plain text message
      Kind: "" # message | join | part | act
      Style: "" # [a|b], can be used as a class name to select alternating line styles
      Color: "" # the nick color to use

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL