Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ Find the definition of the current word using Ellama.
Summarize a selected region or the current buffer using Ellama.
![ellama-summarize](imgs/ellama-summarize.gif)

### ellama-make-flash-cards
Create flashcards in org-mode headline format, which could later be used with packages such as [org-anki](https://github.com/eyeinsky/org-anki).

### ellama-code-review

Review code in a selected region or the current buffer using Ellama.
Expand Down
20 changes: 20 additions & 0 deletions ellama.el
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,26 @@ In BUFFER at POINT will be inserted result between PREFIX and SUFFIX."
(buffer-substring-no-properties (point-min) (point-max)))))
(ellama-instant (format "Text:\n%s\nSummarize it." text))))

;;;###autoload
(defun ellama-make-flash-cards ()
"Create flash cards from active region or current buffer."
(interactive)
(let ((text (if (region-active-p)
(buffer-substring-no-properties (region-beginning) (region-end))
(buffer-substring-no-properties (point-min) (point-max)))))
(ellama-chat (concat (format "Text:\n%s\n" text)
"Instructions:\n"
"Create anki flash cards for the above text. Break the text down into different flashcards.\n"
"Each flashcard should be clear, precise and consistent. Try extracting info about attributes/tendencies, similarities/differences,causes/effects, significance/implications etc and mention them in the flashcards wherever relevant."
"If there is a link in markdown format, you can skip it.\n\n"
"Format for flashcards (2 lines):\n"
"- First line: Front of the card (question), put an asterisk symbol and a space character infront as a prefix.\n"
"- Second line: Back of the card (answer), keep the answer short and precise\n\n"
"Example:\n"
"* What is an apple?\n"
"A fruit"
))))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, move closing parens to previous line.


;;;###autoload
(defun ellama-code-review ()
"Review code in selected region or current buffer."
Expand Down