@@ -80,41 +80,47 @@ def __repr__(self) -> str:
8080
8181 return "\n " .join (lines )
8282
83- def pprint (self , print_raw : bool = False , list_cards : bool = False ) -> None :
83+ def pprint (
84+ self , print_raw : bool = False , list_cards : bool = False , verbose : bool = False
85+ ) -> None :
8486 """Print to screen"""
8587 from anki import latex
8688
8789 header = f"[green]# Note (nid: { self .n .id } )[/green]"
8890 if self .suspended :
8991 header += " [red](suspended)[/red]"
90-
91- created = strftime ("%F %H:%M" , localtime (self .n .id / 1000 ))
92- modified = strftime ("%F %H:%M" , localtime (self .n .mod ))
93- columned = [
94- f"[yellow]model:[/yellow] { self .model_name } ({ len (self .n .cards ())} cards)" ,
95- f"[yellow]tags:[/yellow] { self .get_tag_string ()} " ,
96- f"[yellow]created:[/yellow] { created } " ,
97- f"[yellow]modified:[/yellow] { modified } " ,
98- ]
99- if self .a .n_decks > 1 :
100- columned += ["[yellow]deck:[/yellow] " + self .get_deck ()]
101-
102- if not list_cards :
103- flagged = [
104- cards .get_flag (c , str (c .template ()["name" ]))
105- for c in self .n .cards ()
106- if c .flags > 0
92+ consolePlain .print (header + "\n " )
93+
94+ if verbose :
95+ created = strftime ("%F %H:%M" , localtime (self .n .id / 1000 ))
96+ modified = strftime ("%F %H:%M" , localtime (self .n .mod ))
97+ details = [
98+ f"[yellow]model:[/yellow] { self .model_name } ({ len (self .n .cards ())} cards)" ,
99+ f"[yellow]tags:[/yellow] { self .get_tag_string ()} " ,
100+ f"[yellow]created:[/yellow] { created } " ,
101+ f"[yellow]modified:[/yellow] { modified } " ,
107102 ]
108- if flagged :
109- columned += [f"[yellow]flagged:[/yellow] { ', ' .join (flagged )} " ]
103+ if self .a .n_decks > 1 :
104+ details += ["[yellow]deck:[/yellow] " + self .get_deck ()]
105+
106+ if not list_cards :
107+ flagged = [
108+ cards .get_flag (c , str (c .template ()["name" ]))
109+ for c in self .n .cards ()
110+ if c .flags > 0
111+ ]
112+ if flagged :
113+ details += [f"[yellow]flagged:[/yellow] { ', ' .join (flagged )} " ]
110114
111- consolePlain . print ( header )
112- consolePlain .print (Columns ( columned , width = 37 ) )
115+ for detail in details :
116+ consolePlain .print (detail )
113117
114118 if list_cards :
115119 self .print_cards ()
116120
117- console .print ()
121+ if verbose or list_cards :
122+ console .print ()
123+
118124 imgs : list [Path ] = []
119125 for name , field in self .n .items ():
120126 is_markdown = check_if_generated_from_markdown (field )
@@ -441,6 +447,7 @@ def review(
441447 "N" : "Change model" ,
442448 "s" : "Save and stop" ,
443449 "v" : "Show cards" ,
450+ "V" : "Show details" ,
444451 "x" : "Save and stop" ,
445452 }
446453
@@ -471,14 +478,15 @@ def review(
471478 )
472479
473480 print_raw_fields = False
474- refresh = True
481+ verbose = cfg [ "review_verbose" ]
475482 show_cards = cfg ["review_show_cards" ]
483+ refresh = True
476484 while True :
477485 if refresh :
478486 console .clear ()
479487 console .print (menu )
480488 console .print ("" )
481- self .pprint (print_raw_fields , list_cards = show_cards )
489+ self .pprint (print_raw_fields , list_cards = show_cards , verbose = verbose )
482490
483491 refresh = True
484492 choice = readchar .readchar ()
@@ -560,6 +568,12 @@ def review(
560568
561569 if action == "Show cards" :
562570 show_cards = not show_cards
571+ cfg ["review_show_cards" ] = show_cards
572+ continue
573+
574+ if action == "Show details" :
575+ verbose = not verbose
576+ cfg ["review_verbose" ] = verbose
563577 continue
564578
565579
0 commit comments