-
Notifications
You must be signed in to change notification settings - Fork 416
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
typ2anki:0.1.0 #1490
Open
sgomezsal
wants to merge
10
commits into
typst:main
Choose a base branch
from
sgomezsal:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+266
−0
Open
typ2anki:0.1.0 #1490
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
42e9b64
Add typst2anki package version 0.1.0
sgomezsal d872102
Upgrade pip version
sgomezsal b1b4857
Fix categories in typst.toml
sgomezsal 75fa3a4
Fix package manifest and refactor for kebab-case
sgomezsal 464f1cc
Fix package manifest and refactor for kebab-case
sgomezsal 6369e05
Fix package manifest and refactor for kebab-case
sgomezsal 67fb28c
Change typst2anki to typ2anki
sgomezsal bbba05e
Update uppercase for Q and A
sgomezsal def6d86
Update README
sgomezsal b75d93c
Update README and LICENSE to reflect use of Phosphor Icons under MIT
sgomezsal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Santiago | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
||
--- | ||
|
||
### Additional Notice | ||
|
||
This project includes the "cards" icon from [Phosphor Icons](https://phosphoricons.com/), which is licensed under the [MIT License](https://opensource.org/licenses/MIT). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
# Typ2Anki | ||
|
||
**Typ2Anki** is a Typst package designed to create flashcards seamlessly within Typst-based notes. This package enables users to structure flashcards directly in their documents for easy integration with study and review workflows. | ||
|
||
- Create customizable flashcards using Typst syntax. | ||
- Supports structured note-taking with consistent flashcard styling. | ||
- Ideal for educational and professional use. | ||
|
||
--- | ||
|
||
## Table of Contents | ||
|
||
1. **[Installation and Configuration](#installation-and-configuration)** | ||
|
||
- [Installing the Typst Package](#installing-the-typst-package) | ||
|
||
2. **[Usage](#usage)** | ||
|
||
- [Basic Workflow](#basic-workflow) | ||
- [Customizing Cards](#customizing-cards) | ||
|
||
3. **[Troubleshooting](#troubleshooting)** | ||
|
||
- [Common Issues](#common-issues) | ||
|
||
4. **[Roadmap](#roadmap)** | ||
|
||
5. **[Future Plans](#future-plans)** | ||
|
||
6. **[Contributing](#contributing)** | ||
|
||
7. **[License](#license)** | ||
|
||
--- | ||
|
||
## Installation and Configuration | ||
|
||
### Complete Integration | ||
|
||
To fully utilize Typ2Anki, ensure you follow the installation instructions for the Python package available at [https://github.com/sgomezsal/typ2anki](https://github.com/sgomezsal/typ2anki). | ||
|
||
### Installing the Typst Package | ||
|
||
1. Add the Typ2Anki package to your Typst document: | ||
|
||
```typst | ||
#import "@preview/typ2anki:0.1.0" | ||
``` | ||
|
||
2. Place your custom configuration file (`ankiconf.typ`) in the project directory for consistent flashcard rendering. | ||
|
||
```typst | ||
// Custom imports for flashcards | ||
#import "@preview/pkgs" | ||
|
||
#let conf( | ||
doc, | ||
) = { | ||
// Custom configurations | ||
doc | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## Usage | ||
|
||
### Examples | ||
|
||
For detailed examples, visit the [examples folder](https://github.com/sgomezsal/typ2anki/tree/main/examples) in the original repository. | ||
|
||
### Important Note | ||
|
||
For full functionality, this Typst package requires the complementary Python package. Installation and usage instructions can be found at [https://github.com/sgomezsal/typ2anki](https://github.com/sgomezsal/typ2anki). | ||
|
||
### Basic Workflow | ||
|
||
1. Create a Typst file with flashcards: | ||
|
||
```typst | ||
#card( | ||
id: "001", | ||
target-deck: "Typst", | ||
q: "What is Typst?", | ||
a: "A modern typesetting system." | ||
) | ||
``` | ||
|
||
2. Create your `ankiconf.typ` file with basic configurations: | ||
|
||
```typst | ||
// Custom imports for flashcards | ||
#import "@preview/pkgs" | ||
|
||
#let conf( | ||
doc, | ||
) = { | ||
// Custom configurations | ||
doc | ||
} | ||
``` | ||
|
||
3. Compile your Typst document using Typst's built-in commands to render the flashcards. | ||
|
||
--- | ||
|
||
### Customizing Cards | ||
|
||
To modify card appearance, you can define custom card logic: | ||
|
||
```typst | ||
#let custom-card( | ||
id: "", | ||
Q: "", | ||
A: "", | ||
..args | ||
) = { | ||
card( | ||
id: id, | ||
Q: Q, | ||
A: A, | ||
container: true, | ||
show-labels: true | ||
) | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## Troubleshooting | ||
|
||
### Common Issues | ||
|
||
- **Typst file compilation errors**: | ||
- Check for syntax issues in your Typst file. | ||
- Ensure your `ankiconf.typ` contains the necessary imports and configurations. | ||
|
||
--- | ||
|
||
## Roadmap | ||
|
||
1. **Support for Advanced Flashcard Formats**: Add enhanced support for multi-part and hierarchical flashcards. | ||
2. **Efficiency Improvements**: Optimize rendering for large Typst projects with numerous flashcards. | ||
3. **Integration Enhancements**: Explore integration with additional Typst features for more dynamic output. | ||
|
||
--- | ||
|
||
## Future Plans | ||
|
||
- Expand compatibility to support more flashcard types. | ||
- Introduce configuration options for easier customization of flashcard styles. | ||
|
||
--- | ||
|
||
## Contributing | ||
|
||
Contributions are welcome! Feel free to open issues or submit pull requests for bug fixes, feature enhancements, or documentation improvements. | ||
|
||
--- | ||
|
||
## License | ||
|
||
This project is licensed under the [MIT License](LICENSE). | ||
|
||
### Icon License | ||
|
||
This project uses the "cards" icon from [Phosphor Icons](https://phosphoricons.com/), which is licensed under the [MIT License](https://opensource.org/licenses/MIT). | ||
Phosphor Icons is an open-source and flexible icon library, allowing free use, modification, and distribution in personal and commercial projects. | ||
|
||
--- | ||
|
||
Developed with ❤️ by [sgomezsal](https://github.com/sgomezsal). Let’s make learning efficient and enjoyable! |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#import "@preview/gentle-clues:1.1.0": * | ||
|
||
#let card-container( | ||
title: "Anki", | ||
icon: image("assets/anki.svg"), | ||
..args | ||
) = { | ||
clue( | ||
title: title, | ||
icon: icon, | ||
accent-color: rgb(4, 165, 229), | ||
..args | ||
) | ||
} | ||
|
||
#let card( | ||
id: "", | ||
q: "", | ||
a: "", | ||
..args | ||
) = { | ||
let args = arguments( | ||
type: "basic", | ||
container: false, | ||
show-labels: false, | ||
..args | ||
) | ||
|
||
if args.at("container") == false { | ||
if args.at("show-labels") == true { | ||
context [ | ||
Q: #q \ | ||
A: #a | ||
] | ||
} else { | ||
context [ | ||
#q \ | ||
#a | ||
] | ||
} | ||
} else { | ||
if args.at("show-labels") == true { | ||
card-container[ | ||
Q: #q \ | ||
A: #a | ||
] | ||
} else { | ||
card-container[ | ||
#q \ | ||
#a | ||
] | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "typ2anki" | ||
version = "0.1.0" | ||
entrypoint = "src/lib.typ" | ||
authors = ["sgomezsal <[email protected]>"] | ||
license = "MIT" | ||
description = "Convert Typst files into Anki cards automatically." | ||
repository = "https://github.com/sgomezsal/typ2anki" | ||
keywords = ["anki", "flashcards", "typst", "automation"] | ||
categories = ["integration", "utility"] | ||
compiler = "0.12.0" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless this logo is under the MIT license too, there should at least be a note in the README about its license/copyright information. And if it is MIT, the copyright line in the license file should be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.