{"id":26362563,"url":"https://github.com/mooerslab/markdown-chat-to-org-mode","last_synced_at":"2026-05-04T11:35:27.571Z","repository":{"id":282406154,"uuid":"948479453","full_name":"MooersLab/markdown-chat-to-org-mode","owner":"MooersLab","description":"Convert downloaded chats from markdown to org","archived":false,"fork":false,"pushed_at":"2025-03-14T13:19:20.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-10T08:02:50.777Z","etag":null,"topics":["basb","bash","chats-from-chatbot-sessions","denote","ekg","emacs","file-conversion-with-pandoc","information-retrieval","knowledge-management","markdown-to-org-mode","org-roam","personal-knowledge-management","pkm","zettelkasten","zk"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/MooersLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2025-03-14T12:11:41.000Z","updated_at":"2025-03-21T20:56:16.000Z","dependencies_parsed_at":"2025-03-14T13:32:09.273Z","dependency_job_id":"479df259-0d2e-4f7c-b664-6f32f4dd0c89","html_url":"https://github.com/MooersLab/markdown-chat-to-org-mode","commit_stats":null,"previous_names":["mooerslab/markdown-chat-to-org-mode"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MooersLab/markdown-chat-to-org-mode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MooersLab%2Fmarkdown-chat-to-org-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MooersLab%2Fmarkdown-chat-to-org-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MooersLab%2Fmarkdown-chat-to-org-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MooersLab%2Fmarkdown-chat-to-org-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MooersLab","download_url":"https://codeload.github.com/MooersLab/markdown-chat-to-org-mode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MooersLab%2Fmarkdown-chat-to-org-mode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278740839,"owners_count":26037481,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["basb","bash","chats-from-chatbot-sessions","denote","ekg","emacs","file-conversion-with-pandoc","information-retrieval","knowledge-management","markdown-to-org-mode","org-roam","personal-knowledge-management","pkm","zettelkasten","zk"],"created_at":"2025-03-16T18:18:20.094Z","updated_at":"2025-10-07T08:08:34.013Z","avatar_url":"https://github.com/MooersLab.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Version](https://img.shields.io/static/v1?label=markdown-chat-to-org-mode\u0026message=0.1\u0026color=brightcolor)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n# markdown-chat-to-org-mode\n\n## Problem addressed\nMost of the chatbots generate chats in markdown.\nIf you want to save these chats and store them as org-mode files that you may include in a knowledge graph under the subfolder called *projects*, *protocols*, *resources*, or *code*, you have to carry out the conversion of the org file format.\nThe program pandoc does a good job of this, but I have trouble remembering the syntax for the pandoc command, and pandoc does not add the frontmatter of the org file.\n\n## My solution\nI developed a bash function that runs pandoc and adds the front matter to the file.\nOther solutions out there enable this operation to be done from inside of Emacs while running a chatbot inside Emacs (e.g., gptel).\nHowever, if you run a chatbot outside of Emacs, you will probably handle the downloaded file outside of Emacs.\nBecause you are already outside of the Emacs, you could use a little Bash.\n\nThis bash function takes the single argument of the markdown file's filestem.\nTo incorporate this new note into the org-roam database, you must run the command `M-x org-id-get-create` to add a unique identifier to this file.\n\n```bash\nm2o () {\n\techo \"Convert chat in markdown into org-mode. Uses pandoc.\"\n\techo \"Takes only the filestem of the markdown file.\"\n\tif [ $# -lt 1 ]\n\tthen\n\t\techo \"$0: not enough arguments\" \u003e\u00261\n\t\techo \"Supply the mp3 file stem.\"\n\t\techo \"Usage: m2o fileStem\"\n\t\treturn 2\n\telif [ $# -gt 1 ]\n\tthen\n\t\techo \"$0: too many arguments\" \u003e\u00261\n\t\techo \"Supply the mp3 file stem.\"\n\t\techo \"Usage: m2o fileStem\"\n\tfi\n\tpandoc -f markdown -t org $1.md -o $1.org\n\t(\n\t\techo \"#+Title: $1.\"\n\t\techo \"#+Date: $(date +%Y-%m-%d)\"\n\t\techo \"#+Author: Claude 3.5 Sonnet\"\n\t\techo \"\\n\"\n\t\tcat $1.org\n\t) \u003e temp\n\tmv temp $1.org\n}\n```\n\nSave the function where you save your bash aliases or, better yet, a dedicated `~/.bashFunctions` file.\nSource this file from your .bashrc or .zshrc file so it is always available.\nYou can display the code in the terminal from any directory by entering `which m2o`.\nI call this a bash function, but I use it in zsh.\n\nThis trivial function was generated ab inito.\n\n\n## Update history\n\n|Version      | Changes                                                                                                                                                                         | Date                 |\n|:-----------|:------------------------------------------------------------------------------------------------------------------------------------------|:--------------------|\n| Version 0.1 |   Added badges, funding, and update table.  Initial commit.                                                                                                                | 2025 March 14  |\n\n## Sources of funding\n\n- NIH: R01 CA242845\n- NIH: R01 AI088011\n- NIH: P30 CA225520 (PI: R. Mannel)\n- NIH: P20 GM103640 and P30 GM145423 (PI: A. West)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooerslab%2Fmarkdown-chat-to-org-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmooerslab%2Fmarkdown-chat-to-org-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooerslab%2Fmarkdown-chat-to-org-mode/lists"}