import json


def to_comment(value):
  """
  Builds a comment.
  """
  if value is None:
    return
  else:
    comment = []
    lines = value.strip().splitlines()
    for index, line in enumerate(lines):
        comment.append(line)
        if index+1 != len(lines):
            comment.append(",\n")
        else:
            comment.append("\n")
    return json.dumps(str.join('', comment))