{"id":14065873,"url":"https://github.com/balaji-dutt/zettel-link-rewriter","last_synced_at":"2025-07-29T21:33:50.448Z","repository":{"id":151038162,"uuid":"272183129","full_name":"balaji-dutt/zettel-link-rewriter","owner":"balaji-dutt","description":"Python script that converts wikilinks in Markdown files into standard Markdown links ","archived":false,"fork":false,"pushed_at":"2021-10-09T06:49:53.000Z","size":48,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-30T22:51:43.000Z","etag":null,"topics":["markdown","python3","zettel","zettelkasten"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/balaji-dutt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-06-14T10:53:59.000Z","updated_at":"2024-08-18T17:01:02.000Z","dependencies_parsed_at":"2023-04-11T08:34:06.880Z","dependency_job_id":null,"html_url":"https://github.com/balaji-dutt/zettel-link-rewriter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balaji-dutt%2Fzettel-link-rewriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balaji-dutt%2Fzettel-link-rewriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balaji-dutt%2Fzettel-link-rewriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balaji-dutt%2Fzettel-link-rewriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/balaji-dutt","download_url":"https://codeload.github.com/balaji-dutt/zettel-link-rewriter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228052626,"owners_count":17862105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","python3","zettel","zettelkasten"],"created_at":"2024-08-13T07:04:47.530Z","updated_at":"2024-12-04T05:31:04.396Z","avatar_url":"https://github.com/balaji-dutt.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"## Rewrite Wikilinks in your Zettelkasten as Markdown Links\n\nThis repository contains a Python script that can take a folder of Markdown files (or any other compatible format) and \nconvert any links that are in `[[wikilink]]` format into the standard Markdown link format.\n\n### Why?\nMost Zettelkasten software today will handle linking between different notes by adding a link using the `[[wikilink]]`\nsyntax. This is great for reading and writing within the Zettelkasten ecosystem but almost no standard Markdown renderer\nwill automatically recognize the `[[wikilink]]` syntax. This script attempts to give you more inter-operability with \nother Markdown software by converting `[[wikilinks]]` into standard Markdown `[wikilink](wikilink)` syntax. \n\n### Features\n- Fully cross-platform. Script was developed in a Windows environment and is extensively tested to work in \nWindows.\n- Provides a number of parameters to configure the script. Parameters can be specified either on the command-line or \nvia a configuration file. Refer to [zettel_link_rewriter.ini](zettel_link_rewriter.ini) to see an example.\n- Handles links within Markdown code blocks correctly, i.e., does not rewrite them. This includes fenced code blocks, \ninline code snippets and code blocks indented with four spaces. Do note the [Caveats](#caveats) though.\n- Minimal dependencies. The script requires only one additional package to be installed (which is because Python's \nbuilt-in `argparse` module is _terrible_.)\n\n### Dependencies\n- Python 3.4 or higher (Script has only been tested with Python 3.8)\n- List of packages specified in `requirements.txt`\n\n### Getting Started\nYou can use this script by cloning the repo and installing Python and the script dependencies in a Python venv.\n```shell\ngit clone https://github.com/balaji-dutt/zettel-link-rewriter.git\npython -m venv .venv\n./venv/scripts/activate\npip install -r requirements.txt\npython zettel_link_rewriter.py\n```\nRunning the script as shown above will make the script run with a set of built-in defaults. But you can configure \nthe script either by supplying a list of parameters on the command-line:\n```shell\npython zettel_link_rewriter.py -v debug -p all --target_files ./dest/\n```\n\nOr you can configure the script by passing a path to a configuration file:\n\n```shell\npython zettel_link_rewriter.py -c myconfig.ini\n```\n\nAn explanation of the different parameters the script recognizes are provided below.\n\n### Parameters\n\n|Parameter|Mandatory|Description|\n|---------|---------|-----------|\n|`-h`|No|Show a help message|\n|`-c` / `--config`|No|Specify path to Configuration file. \u003cbr\u003eBy default, the script will look for a configuration file named zettel_link_rewriter.ini in the same directory|\n|`-v`|No|Verbosity option. Configures the logging level for the script. You can specify 3 levels of verbosity - `warning/info/debug`. The default is `warning`|\n|`-f` / `--file`|No|Write log messages to a file instead of on the console.|\n|`--source_files`|No|Specify path to directory containing source markdown files to be processed. \u003cbr\u003e Default is to use a \"source\" folder in the current directory.|\n|`--target_files`|No|Specify path to directory where processed markdown files should be saved. \u003cbr\u003e Default is to use a \"dest\" folder in the current directory. \u003cbr\u003e The folder where markdown files should be saved after processing will be created if it does not exist.|\n|`-p` / `--process`|No|Flag to tell the script whether it should process all files in the source directory or only receently modified files.\u003cbr\u003e The parameter supports two values - `all` or `modified`|\n|`-m` / `--minutes`|No|Specify in minutes the time-limit for finding recently modified files. Can be used with `-p modified` option. \u003cbr\u003e If this is not specified, the script will use a default value of `60` minutes.|\n\n\n### Caveats\n- In order to avoid processing wikilinks inside code blocks, the script will ignore lines beginning with 4 spaces. \nHowever, this means that a wikilink in a list that is on the 3rd level or deeper will not be converted. In other words:\n```\n- [[Level 1 wikilink]] # Will be converted\n  - [[Level 2 wikilink]] # Will be converted\n    - [[Level 3 wikilink]] # Will *NOT BE* converted\n      - Any wikilinks in this level or deeper will also not be converted. \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalaji-dutt%2Fzettel-link-rewriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalaji-dutt%2Fzettel-link-rewriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalaji-dutt%2Fzettel-link-rewriter/lists"}