Exemple #1
0
def tex2plain(string):
    """Parse string and return its plain text version."""
    return detex(
        silent_yacc(module=LatexParser(), ).parse(
            string,
            lexer=SimpleLexer().lexer,
        ))
Exemple #2
0
def tex2plain(string):
    """Parse string and return its plain text version."""
    return detex(
        latex_yacc().parse(
            string,
            lexer=SimpleLexer().lexer,
            )
        )
Exemple #3
0
def tex2plain(string):
    """Parse string and return its plain text version."""
    return detex(
        silent_yacc(
            module=LatexParser(),
            ).parse(
                string,
                lexer=SimpleLexer().lexer,
                )
        )
Exemple #4
0
def parse_song(content, filename=None):
    """Parse some LaTeX code, expected to be a song.

    Arguments:
    - content: the code to parse.
    - filename: the name of file where content was read from. Used only to
      display error messages.
    """
    return detex(
        latex_yacc(filename).parse(
            content,
            lexer=SongLexer().lexer,
        ).metadata)
Exemple #5
0
def parse_song(content, filename=None):
    """Parse some LaTeX code, expected to be a song.

    Arguments:
    - content: the code to parse.
    - filename: the name of file where content was read from. Used only to
      display error messages.
    """
    return detex(
        silent_yacc(module=LatexParser(filename)).parse(
            content,
            lexer=SongLexer().lexer,
            ).metadata
        )
Exemple #6
0
def tex2plain(string):
    """Parse string and return its plain text version."""
    return detex(latex_yacc().parse(
        string,
        lexer=SimpleLexer().lexer,
    ))