Skip to content

Commit

Permalink
improve docstring and type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ickc committed Nov 17, 2020
1 parent 964b436 commit 059afb7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 5 additions & 3 deletions pantable/cli/pantable.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
from ..codeblock_to_table import codeblock_to_table


def main(doc=None):
"""
def main(doc: panflute.Doc = None):
"""a pandoc filter converting csv table in code block
Fenced code block with class table will be parsed using
panflute.yaml_filter with the fuction codeblock_to_table above.
panflute.yaml_filter with the fuction
:func:`pantable.codeblock_to_table.codeblock_to_table`
"""
return panflute.run_filter(
panflute.yaml_filter,
Expand Down
5 changes: 2 additions & 3 deletions pantable/cli/pantable2csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
from ..table_to_csv import table_to_csv


def main(doc=None):
"""
Any native pandoc tables will be converted into the CSV table format used by pantable:
def main(doc: panflute.Doc = None):
"""Covert all tables to CSV table format defined in pantable
- in code-block with class table
- metadata in YAML
Expand Down
2 changes: 1 addition & 1 deletion pantable/codeblock_to_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from .util import EmptyTableError


def codeblock_to_table(options, data, **args):
def codeblock_to_table(options: dict, data: str, **args):
use_pipe_tables = options.get('pipe_tables', False)
use_grid_tables = options.get('grid_tables', False)

Expand Down

0 comments on commit 059afb7

Please sign in to comment.