Skip to content

Commit 0d7f3df

Browse files
Added description and feature section to readme.
1 parent d547e2d commit 0d7f3df

File tree

3 files changed

+35
-18
lines changed

3 files changed

+35
-18
lines changed

README.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,41 @@ This repository contains a script to convert the LinkedIn Skill Assessment Quizz
1515

1616
This repository includes:
1717

18-
- the script itself needed to convert one of [Ebazhanov's](https://github.com/Ebazhanov/linkedin-skill-assessments-quizzes) markdown files to a .csv file that can be imported into Anki. This conversion
19-
- reformats the markdown
20-
- moves any image associated to a question into the anki collections folder
21-
-
18+
- the script itself needed to convert all of [Ebazhanov's](https://github.com/Ebazhanov/linkedin-skill-assessments-quizzes) markdown files into a .csv file that can be imported into Anki. Any images referenced in the markdown files are copied into Anki's collection.media folder and properly referenced in the flashcard. As of this writing, Anki does not support Markdown style code formatting such as `[nums[j] for j in range(n) if bitmask[j] == '1']`. Therefore, the code examples embedded in the flashcards are sometimes hard to read.
19+
- all of the Markdown file's as ready to import [.csv files](https://github.com/johanneshagspiel/markdown-to-anki-csv-converter/tree/main/resources/csv_files)
2220

2321
## Tools
2422

25-
| Purpose | Name |
26-
|----------------------|-------------------------------------------------------------------------------------------------|
27-
| Programming language | [Python 3.10] |(
28-
| Version | [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install) with Ubuntu |
23+
| Purpose | Name |
24+
|------------------------|--------------------------------------------------------------|
25+
| Programming language | [Python 3.10](https://www.python.org/) |
26+
| Version control system | [Git](https://git-scm.com/) |
2927

3028
## Installation Process
3129

32-
It is assumed that the users operating system is Windows.
30+
To import the .csv files in Anki, it is assumed that you already have installed [Anki](https://apps.ankiweb.net/).
3331

34-
- Download and install [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install-win10) preferably with the Ubuntu 18.04 LTS distribution.
35-
- To run the shell scripts, start WSL, move into the directory of this repository and execute the scripts with ./{name_of_script}.sh
32+
Open Anki and go to `File -> Import` or press `Ctrl + Shift + I` and select the .csv file you want to import. Make sure that you select as type `Basic` and that you toggle the `Allow HTML in fields` option. You will most likely also want to change the name of the deck from `Default`. Now you have imported the .csv file.
33+
34+
If you want to convert the markdown files for yourself, it is assumed that your operating system is Windows and that you have installed [Python](https://www.python.org/) and [Git](https://git-scm.com/) .
35+
36+
Clone this repository with the following command:
37+
38+
`git clone https://github.com/johanneshagspiel/markdown-to-anki-csv-converter.git`
39+
40+
You will also need [Ebazhanov's markdown files](https://github.com/Ebazhanov/linkedin-skill-assessments-quizzes). First go into the resources folder:
41+
42+
`cd resources`
43+
44+
In case there is already a `linkedin-skill-assessments-quizzes` folder, delete it. Now clone Ebazhanov's repository with:
45+
46+
`git clone https://github.com/Ebazhanov/linkedin-skill-assessments-quizzes.git`
47+
48+
Lastly, you need to add the path to the `collection.media` folder of your Anki installation in the main method. Most likely, you can find this directory at:
49+
50+
`"C:\Users\@Username\AppData\Roaming\Anki2\@Username\collection.media"`
51+
52+
Now you can run the main method and convert the Markdown files yourself.
3653

3754
## Licence
3855

resources/csv_files/git-quiz.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<b> How can you check your current git version?</b><br><ul><li>git --v</li><li>git --version</li><li>git --option</li><li>git --current</li></ul>,git --version
2-
"<b> What command lets you create a connection between a local and remote repository?</b><br><ul><li>git remote add new</li><li>git remote add origin</li><li>git remote new origin</li><li>git remote originThe command is git remote add. The new added connection can be named origin or new. The only constraints, although it is not documented AFAIK, is that the connection name needs to be acceptable to git-check-ref-format, and it cannot be repeated.<br>If the LinkedIn assessment asks this and you can choose just one option, then leave feedback.<br></li></ul>",<ul><li>git remote add new</li><li>git remote add origin</li></ul>
2+
<b> What command lets you create a connection between a local and remote repository?</b><br><ul><li>git remote add new</li><li>git remote add origin</li><li>git remote new origin</li><li>git remote origin</li></ul>,"<ul><li>git remote add new</li><li>git remote add origin</li></ul><br><br>**Explanation:**<br>The command is git remote add. The new added connection can be named origin or new. The only constraints, although it is not documented AFAIK, is that the connection name needs to be acceptable to git-check-ref-format, and it cannot be repeated.<br>If the LinkedIn assessment asks this and you can choose just one option, then leave feedback.<br>"
33
"<b> Describe what these Git commands do to the commit history:</b><br><br>```bash<br>git reset --hard HEAD~5<br>git merge --squash HEAD@{1}<br>```<br><br><ul><li>They reset the HEAD to the fifth commit in the repo, then merge to the master branch.</li><li>The current branch's HEAD is reset back five commits, then prior commits are squashed into a single commit.</li><li>They delete the last five commits.</li><li>They merge the last five commits into a new branch.</li></ul>","The current branch's HEAD is reset back five commits, then prior commits are squashed into a single commit.<br><br>**Explanation:**<br>- `git reset --hard HEAD~5` resets the current branch to the commit just before the last 5 (see `man gitrevisions` for details about this notation and other cool alternatives like `HEAD@{2 days ago}`). As it is a hard reset, it will also overwrite every change in the working tree as well. See `man git-reset`.<br>- `git merge --squash HEAD@{1}` HEAD@{1} is where the branch was just before the previous command (again, see `man gitrevisions`). This command sets the state of the index to be as it would just after a merge from that commit. This whole operation could be a way to take 5 commits from a branch in which you started a new feature and squash them to a single commit, a meaningful one.<br>"
44
"<b> Your current project has several branches; master, beta, and push-notifications. You've just finished the notification feature in the push-notification branch, and you want to commit it to beta branch. How can you accomplish this?</b><br><ul><li>Checkout the push-notifications branch and run git merge beta</li><li>Checkout the master branch and run git merge beta -> push-notification</li><li>Delete the push-notification branch and it will be committed to the master branch automatically</li><li>Checkout the beta branch and run git merge push-notification</li></ul>",Checkout the beta branch and run git merge push-notification
55
<b> Which of the following is true you when you use the following command?</b><br><br>`git add -A`<br><br><ul><li>All new and updated files are staged</li><li>Files are staged in alphabetical order.</li><li>All new files are staged</li><li>Only updated files are staged</li></ul>,All new and updated files are staged
@@ -13,11 +13,11 @@
1313
<b> How could you squash multiple commits together without using git merge --squash?</b><br><ul><li>Caching</li><li>You can't. git merge --squash is the only git command for that operation.</li><li>Rebasing</li><li>Reflogging</li></ul>,Rebasing
1414
"<b> If you cloned an existing git repository, what would happen?</b><br><ul><li>A new copy would overwrite the central repository</li><li>A copy of the repository would be created on your local machine</li><li>Nothing, cloning is not a supported git function</li><li>A copy of the repository would be created on the hosting platform</li></ul>",A copy of the repository would be created on your local machine
1515
"<b> How can you display a list of files added or modified in a specific commit?</b><br><ul><li>Find the commit in the remote repository, as that's the only place that kind of information is stored.</li><li>Use the `diff-tree` command with the commit hash.</li><li>Run `git commit --info` with the commit hash.</li><li>Access the commit stash data with `git stash`.</li></ul>",Use the `diff-tree` command with the commit hash.
16-
"<b> What files is this .gitignore programmed to leave out?</b><br><br>```shell<br>#.swift<br>build/<br>*.txt<br>*.metadata<br>```<br><br><ul><li>All files with a .swift, .txt, or metadata file extension, as well as the entire build directory</li><li>Only the build directory</li><li>All files in the build directory, as well as files ending with .txt or .metadata</li><li>Only files with .swift and .txt extensions.A line starting with `#` serves as a comment. Hence `# .swift` does not do anything. See `man gitignore`.<br></li></ul>","All files in the build directory, as well as files ending with .txt or .metadata"
16+
"<b> What files is this .gitignore programmed to leave out?</b><br><br>```shell<br>#.swift<br>build/<br>*.txt<br>*.metadata<br>```<br><br><ul><li>All files with a .swift, .txt, or metadata file extension, as well as the entire build directory</li><li>Only the build directory</li><li>All files in the build directory, as well as files ending with .txt or .metadata</li><li>Only files with .swift and .txt extensions.</li></ul>","All files in the build directory, as well as files ending with .txt or .metadata<br><br>**Explanation:**<br>A line starting with `#` serves as a comment. Hence `# .swift` does not do anything. See `man gitignore`.<br>"
1717
"<b> After you make changes to a local repository, you run the following command. What will this do?</b><br><br>`git commit -a -m ""Refactor code base""`<br><br><ul><li>Nothing, you can't use multiple options in the same command</li><li>Adds all new files to the staging area</li><li>Commits all new files with a message</li><li>Adds all modified files to the staging area, then commits them with a message</li></ul>","Adds all modified files to the staging area, then commits them with a message"
1818
"<b> After checking your git status you get the following output, which shows the file beta-notes.js in the commit but also unstaged. How can this situation occur?</b><br><br>```shell<br>Change to be committed:<br>(use ""git reset HEAD <file>..."" to unstage)<br>modified: beta-notes.js<br>Changes not staged for commit:<br>(use ""git add <file>..."" to update what will be committed)<br>(use ""git checkout --<file>..."" to discard changes in working directory)<br>modified: beta-notes.js<br>```<br><br><ul><li>There were two copies of beta-notes.js but one was deleted</li><li>beta-notes.js was staged, then modified afterwards, creating two different versions of the file</li><li>Two copies of beta-notes.js were created, but only one is being tracked</li><li>There are two tracked copies of beta-notes.js, but one was removed from the commit</li></ul>","beta-notes.js was staged, then modified afterwards, creating two different versions of the file"
1919
<b> Where are files stored before they are committed to the local repository?</b><br><ul><li>Saved files</li><li>git documents</li><li>Staging area</li><li>git cache</li></ul>,Staging area
20-
"<b> What commands would you use to force an overwrite of your local files with the master branch?</b><br><ul><li>⠀```bash<br>git pull --all<br>git reset --hard origin/master<br>```<br></li><li>⠀```bash<br>git pull -u origin master<br>git reset --hard master<br>```<br></li><li>⠀```bash<br>git pull origin master<br>git reset --hard origin/myCurrentBranch<br>```<br></li><li>⠀```bash<br>git fetch --all<br>git reset --hard origin/master<br>```<br>- The command `pull` is `fetch` followed by either `merge` or `rebase` (in this case, `merge`). We don't want to merge. Merge would be an action to our **repository**. We just want to overwrite our **local files**.<br></li></ul>","⠀```bash<br>git fetch --all<br>git reset --hard origin/master<br>```<br>- The command `pull` is `fetch` followed by either `merge` or `rebase` (in this case, `merge`). We don't want to merge. Merge would be an action to our **repository**. We just want to overwrite our **local files**.<br>"
20+
<b> What commands would you use to force an overwrite of your local files with the master branch?</b><br><ul><li>⠀```bash<br>git pull --all<br>git reset --hard origin/master<br>```<br></li><li>⠀```bash<br>git pull -u origin master<br>git reset --hard master<br>```<br></li><li>⠀```bash<br>git pull origin master<br>git reset --hard origin/myCurrentBranch<br>```<br></li><li>⠀```bash<br>git fetch --all<br>git reset --hard origin/master<br>```<br></li></ul>,"⠀```bash<br>git fetch --all<br>git reset --hard origin/master<br>```<br><br><br>**Explanation:**<br>- The command `pull` is `fetch` followed by either `merge` or `rebase` (in this case, `merge`). We don't want to merge. Merge would be an action to our **repository**. We just want to overwrite our **local files**.<br>"
2121
<b> Which statement is true when you use the git add -A command?</b><br><ul><li>Only new files in the working directory are staged to the index.</li><li>All new and updated files from the working directory are staged to the index.</li><li>All files in the working directory are staged to the index in alphabetical order.</li><li>Only updated files in the working directory are staged to the index.</li></ul>,All new and updated files from the working directory are staged to the index.
2222
"<b> You find that your project has a tag and branch both named push-notifications, which causes confusion when trying to print out given reference. How can you specify which branch you want to look at?</b><br><ul><li>use git show refs/push-notifications</li><li>use git show push-notifications</li><li>use git show heads/refs/push-notifications</li><li>use git show refs/heads/push-notifications</li></ul>",use git show refs/heads/push-notifications<br><br>[Reference](https://geedew.com/fixing-git-branch-and-tag-name-collision/)<br>
2323
<b> Your team lead needs a list of all commits that will be moved before you perform a rebase. Which command can you use to access that information?</b><br><ul><li>git rebase -log</li><li>git rebase -i</li><li>git rebase -verbose</li><li>git rebase -all</li></ul>,git rebase -i

src/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
import os.path
44
import re
55
import shutil
6-
import sys
76
from pathlib import Path
87

98
from question import Question
109

1110
if __name__ == '__main__':
1211

1312
# In window,s this path is typically found at "C:\Users\@Username\AppData\Roaming\Anki2\@Username\collection.media"
14-
path_to_anki_collection_folder = r"C:\Users\Johannes\AppData\Roaming\Anki2\User 1\collection.media"
13+
path_to_anki_collection_folder = r""
14+
15+
if len(path_to_anki_collection_folder) == 0:
16+
raise Exception("Please add the path to the collection.media folder of your Anki installation")
1517

1618
root_path = Path(__file__).parents[1]
1719
resources_folder_path = root_path.joinpath("resources", "linkedin-skill-assessments-quizzes")
1820
storage_folder = root_path.joinpath("resources", "csv_files")
1921

20-
#folder_path = resources_folder_path.joinpath("android")
21-
2222
sub_folders = [f.path for f in os.scandir(resources_folder_path) if f.is_dir()]
2323

2424
for folder_path in sub_folders:

0 commit comments

Comments
 (0)