From 82fd04e4cd5f63bb52b5d2fa6734faa9fd009f0c Mon Sep 17 00:00:00 2001 From: Philipp Stadler <hello@phstadler.com> Date: Thu, 18 Jul 2024 18:29:46 +0200 Subject: [PATCH] feat(starter): add Bijection-from-Images and Facts-from-CSV starter content Add example content for Q/A and image bijections. --- README.md | 39 ++++++++++++++++-- content/Bijection-from-Images/.apkg-spec.yml | 13 ++++++ content/Bijection-from-Images/red.png | Bin 0 -> 546 bytes .../.apkg-spec.yaml | 0 .../content.csv | 0 5 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 content/Bijection-from-Images/.apkg-spec.yml create mode 100644 content/Bijection-from-Images/red.png rename content/{My-Anki-Package => Facts-from-CSV}/.apkg-spec.yaml (100%) rename content/{My-Anki-Package => Facts-from-CSV}/content.csv (100%) diff --git a/README.md b/README.md index aacbfde..5e453ae 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,45 @@ # Brand spanking new Anki Pack -Tell your users something about the pack here. +Hi, do you want to build a new Anki pack? You can start with this repository! + +## First-time setup for a new project +Create a +[new project](https://gitlab.phaidra.org/projects/new?namespace_id=2286#import_project) +in the _Anki Packs_ namespace and choose _Repository by URL_ with this repo: +``` +https://gitlab.phaidra.org/kartenaale/templates/anki-pack.git +``` + +This step will also clone this README. You can change it later to remove this +section and tell your users something about your pack instead. + +Next, enable Gitlab CI for your project. With this feature, your new content +will produce Anki packages on Merge Requests and on the main branch. To enable, +open _Settings_ in the new Gitlab project and expand +_Visibility, project features, permissions_. _CI/CD_ under _Repository_ should +be _enabled_. Customize Merge Requests and other settings to your liking ( +_Pipelines must succeed_ is highly recommended). + +## Importing the pack to your phone +Open the [releases section](-/releases) and click _Browse all APKGS…_. There, +click an APKG, download it, and import into Anki. ## Contributing To add new content to this pack, add subfolders to `content/` with a `.apkg-spec.yaml` file in it, and data in the form of CSV, images or APKGs. -The template contains a simple `My-Anki-Package`. You can remove it or -customize it to your needs. Have a look at the other packs for more examples. +You can use the content in the starter template as your basis or just have a +look to see how it works: +* [content/Facts-from-CSV](https://gitlab.phaidra.org/kartenaale/templates/anki-pack/-/tree/main/content/Facts-from-CSV) for Q/A cards imported from a CSV file, +* [content/Bijection-from-Images](https://gitlab.phaidra.org/kartenaale/templates/anki-pack/-/tree/main/content/Bijection-from-Images) for two cards, one to remember the image and one to remember the label in the filename. + +To get your changes back into the repository and test them, create a new branch +with your changes and open a merge request. Check the APKGs in the CI/CD build +job on the MR and if you are happy, merge to main. ### Releasing a new version Bump the version number in `package.json` and merge the pull request. + +A new release will be created in the [releases section](-/releases) of the +project and the kartenaale whatsapp group will be notified (if you go to the +CI/CD job and link with your Whatsapp to send out the notification - restart +the job if necessary). diff --git a/content/Bijection-from-Images/.apkg-spec.yml b/content/Bijection-from-Images/.apkg-spec.yml new file mode 100644 index 0000000..7728197 --- /dev/null +++ b/content/Bijection-from-Images/.apkg-spec.yml @@ -0,0 +1,13 @@ +content_version: 2.0.3 + +templates: +- bijective + +content: +- import_images: + content_version: 2024-02-22 19:00:00+00:00 + note_type: Bijection + deck_name_pattern: 'Chinese Hand Gestures' + fields_mapping: + A: 'The color {{from_basename}}' + B: '{{image}}' diff --git a/content/Bijection-from-Images/red.png b/content/Bijection-from-Images/red.png new file mode 100644 index 0000000000000000000000000000000000000000..45963e5fca95e06822eef5da0ac0ece43c2a8c30 GIT binary patch literal 546 zcmeAS@N?(olHy`uVBq!ia0y~yU|<Ac4kiW$h6&}t_ZS!$TQZ%U13aCb6$*;-(=u~X z85lGs)=sqbIP4(Nc7K^ycZkSag+~(>THSPYmD$SWx<VkUHB8n=?{BjjuV+{H;s;R$ zAJR9zdhlq?>gLr79RC_DtSvNmd34@aZ51<=yL0z&_5I&P-(?j{w0t)2N@MihezwF& zF|BxY(hE^Vo(1!-Z8)Qo>^CXsgKYeFjt_tJ&Tanl`k&0+tb0ig4l46f+cJgo1^n}G zu|2PSq@jIM>!anz9iHMUbx(FZ`Y8Q;(P^ghJ+o$hu_>Gqp;NZu(!n(;Sx1787=~Wf zj6YGers&?IHKAE+O8x&G@`#I%d}ei4P-SC>s)xYB1#L!J8w8ifsvmWlbxzpsU*dKB ziQbCgl07oqE1a6&{5tsmL3#e#Lr+?!i+D2J)$jXk$kkHTn0B{tU%%|~N+y>1joN$P zt~YC#>3`{Uu5KC2mt1D?>$$!+nf1yW7OFd&rG|4|65(Qf@V955COgkPCfn?|`%%v= zY8i~KtiHlqP{7e6s#$&a`Q3--_Wg~%{OUfx=GUT5ljEX+3=9mM1s;*b3=De8Ak0{? z)V_>?fq}im)7O>#1-p;{hf&gPj?D}V43Z_T5hc#~xw)x%B@E6*sfi`2DGKG8B^e6t wp1uL$jeOz^3=BM;E{-7_*OPyoKfu7i%*e<fakqB^0|Nttr>mdKI;Vst0G;ID5&!@I literal 0 HcmV?d00001 diff --git a/content/My-Anki-Package/.apkg-spec.yaml b/content/Facts-from-CSV/.apkg-spec.yaml similarity index 100% rename from content/My-Anki-Package/.apkg-spec.yaml rename to content/Facts-from-CSV/.apkg-spec.yaml diff --git a/content/My-Anki-Package/content.csv b/content/Facts-from-CSV/content.csv similarity index 100% rename from content/My-Anki-Package/content.csv rename to content/Facts-from-CSV/content.csv -- GitLab