Browse Source

Create configuration command for user input configuration generation.

feature/create-config
gabriel becker 2 years ago
parent
commit
3a7cb85aee
  1. 3
      src/ankimaker/cli.py
  2. 4
      src/ankimaker/commands/from_csv.py
  3. 3
      src/ankimaker/tasks/basic_csv_to_anki.py

3
src/ankimaker/cli.py

@ -4,3 +4,6 @@ from ankimaker.commands import cli
def main():
cli(prog_name='ankimaker')
if __name__ == '__main__':
main()

4
src/ankimaker/commands/from_csv.py

@ -5,8 +5,8 @@ from ankimaker.tasks import basic_pandas_to_anki
@cli.command('csv')
@click.argument('-i', '--input', 'input_file', type=click.Path(exists=True))
@click.argument('-o', '--output', 'output_file', type=click.Path(exists=False))
@click.option('-i', '--input', 'input_file', type=click.Path(exists=True))
@click.option('-o', '--output', 'output_file', type=click.Path(exists=False))
@click.option('-c', '--conf', 'config_file', default=None, type=click.STRING)
@click.option('-n', '--name', 'name', default=None, type=click.STRING)
def generate_anki(

3
src/ankimaker/tasks/basic_csv_to_anki.py

@ -19,7 +19,8 @@ def create_model():
'qfmt': '<div style="text-align: center;">{{Question}}</div>',
'afmt': '{{FrontSide}}<hr id="answer"><div style="text-align: center;">{{Answer}}</div>',
},
])
]
)
return my_model

Loading…
Cancel
Save