Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom field name option for Cards #2

Closed
ImplyingICheck opened this issue May 9, 2023 · 1 comment
Closed

Add custom field name option for Cards #2

ImplyingICheck opened this issue May 9, 2023 · 1 comment

Comments

@ImplyingICheck
Copy link
Owner

ImplyingICheck commented May 9, 2023

Allow ability to set specific field_names. That is, the ability to name Field3 to "Term" and Field4 to "Definition" and leave the rest of the fields as Field1, Field2, ..., FieldN

This involves refactoring the way Card is constructed

[ankideckconstructor] card.py (Lines 11-12)


  def __init__(self, fields, has_html=False, tags=None, field_names=None,
               note_type=None, deck=None, guid=None):

Open in IDE

and changing the logic for setting generic field names

[ankideckconstructor] card.py (Line 22)


 def __set_field_names(field_names, n_fields):

Open in IDE

Created from JetBrains using CodeStream

ImplyingICheck pushed a commit that referenced this issue May 16, 2023
Change scoping of _generate_field_dict to module level
declaration
rather than @staticmethod tag. Follow project coding style.
@ImplyingICheck
Copy link
Owner Author

ImplyingICheck commented Jul 19, 2023

Implemented by [#25].

As of [#35], the generic field_names are of form Field<idx> where "" is the corresponding column of the tab separated value file.

Any value which evaluates as False can be used to designate a generic file name. For example:

['', False, 'Some Wanted Name'] #=> ['Field0', 'Field1', 'Some Wanted Name']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant