gin/tf/utils.py
def _markdownify_operative_config_str(self, string):
    """Convert an operative config string to markdown format."""

    # TODO: Total hack below. Implement more principled formatting.
    def process(line):
      """Convert a single line to markdown format."""
      if not line.startswith('#'):
        return '    ' + line

      line = line[2:]
      if line.startswith('===='):
        return ''
      if line.startswith('None'):
        return '    # None.'
      if line.endswith(':'):
        return '#### ' + line
      return line

    output_lines = []
    for line in string.splitlines():
      procd_line = process(line)
      if procd_line is not None:
        output_lines.append(procd_line)

    return '\n'.join(output_lines)
def _markdownify_operative_config_str(self, string):
    # TODO: Total hack below. Implement more principled formatting.
    def process(line):
      """Convert a single line to markdown format."""
      if not line.startswith('#'):
        return '    ' + line

      line = line[2:]
      if line.startswith('===='):
        return ''
      if line.startswith('None'):
        return '    # None.'
      if line.endswith(':'):
        return '#### ' + line
      return line

    output_lines = []
    for line in string.splitlines():
      procd_line = process(line)
      if procd_line is not None:
        output_lines.append(procd_line)

    return '\n'.join(output_lines)
def _markdownify_operative_config_str ( self , string ) : # TODO: Total hack below. Implement more principled formatting. def process ( line ) : """Convert a single line to markdown format.""" if not line . startswith ( '#' ) : return '    ' + line line = line [ 2 : ] if line . startswith ( '====' ) : return '' if line . startswith ( 'None' ) : return '    # None.' if line . endswith ( ':' ) : return '#### ' + line return line output_lines = [ ] for line in string . splitlines ( ) : procd_line = process ( line ) if procd_line is not None : output_lines . append ( procd_line ) return '\n' . join ( output_lines )
Convert an operative config string to markdown format.
Convert an operative config string to markdown format .