{"id":13522566,"url":"https://github.com/nil0x42/singlefile2trilium","last_synced_at":"2025-08-19T01:03:04.873Z","repository":{"id":61927000,"uuid":"226163800","full_name":"nil0x42/singlefile2trilium","owner":"nil0x42","description":"Save faithful copy of a web page in Trilium notes with SingleFile web extension :electric_plug:","archived":false,"fork":false,"pushed_at":"2022-05-26T12:02:36.000Z","size":1130,"stargazers_count":109,"open_issues_count":2,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-11T04:02:40.780Z","etag":null,"topics":["note-taking","plugin","singlefile","trilium","trilium-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nil0x42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-05T18:23:49.000Z","updated_at":"2025-07-04T21:46:23.000Z","dependencies_parsed_at":"2022-10-23T17:15:30.661Z","dependency_job_id":null,"html_url":"https://github.com/nil0x42/singlefile2trilium","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nil0x42/singlefile2trilium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nil0x42%2Fsinglefile2trilium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nil0x42%2Fsinglefile2trilium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nil0x42%2Fsinglefile2trilium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nil0x42%2Fsinglefile2trilium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nil0x42","download_url":"https://codeload.github.com/nil0x42/singlefile2trilium/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nil0x42%2Fsinglefile2trilium/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271083357,"owners_count":24696276,"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-08-18T02:00:08.743Z","response_time":89,"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":["note-taking","plugin","singlefile","trilium","trilium-plugin"],"created_at":"2024-08-01T06:00:49.160Z","updated_at":"2025-08-19T01:03:04.643Z","avatar_url":"https://github.com/nil0x42.png","language":"Python","funding_links":[],"categories":["🧚 API extensions"],"sub_categories":["🍎 iOS"],"readme":"# singlefile2trilium\r\nSave faithful copy of a web page as a [Trilium] note with [SingleFile] web extension.\r\n\r\n[![twitter follow](https://img.shields.io/twitter/follow/nil0x42?label=Follow%20nil0x42%20%21\u0026style=social)](https://twitter.com/intent/follow?screen_name=nil0x42)\r\n\r\n![](img/small-demo.png)\r\n\r\n\r\n\r\n## How it Works\r\n[SingleFile] web extension saves a faithful copy of the web page being rendered by your browser as a single HTML file.\r\nIt's default location is `~/Downloads`.\r\n\r\n#### singlefile2trilium is composed of two scripts:\r\n1. **[singlefile2trilium-sender.py]** script continuously watches `~/Downloads` directory for new html pages saved by `SingleFile` and sends them to trilium.\r\n2. **[singlefile2trilium-handler.js]** is a trilium [custom request handler]. It handles and converts data sent by `singlefile2trilium-sender.py`.\r\n\r\nThe handler wraps the html content into an html iframe, which is itself rendered by a render note.\r\n\r\n\r\n## Installation\r\n\r\nDependencies:\r\n* Python 3.x\r\n* [Trilium] \u003e= v0.38\r\n* [SingleFile]\r\n\r\n#### A) Configure [singlefile2trilium-handler.js]\r\n1. add the file to trilium as a `JS Backend` code note:\r\n   ![](img/add-handler-to-trilium.png)\r\n2. set `customRequestHandler` label to `singlefile2trilium`:\r\n   ![](img/set-label-to-handler.png)\r\n\r\n\r\n#### B) Configure [singlefile2trilium-sender.py]\r\n1. copy the script somewhere on your computer.\r\n2. change `BASEDIR` \u0026 `TRILIUM_URL` vars in script according to your needs.\r\n3. configure your system to [run the script at startup](https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html) (as a daemon):\r\n   ```bash\r\n   user@desktop $ ./singlefile2trilium-sender.py\r\n   ```\r\n\r\n\r\n## Usage\r\n1. Use **SingleFile** add-on in your browser to save a web page\r\n   ![](img/use-singlefile.png)\r\n2. You have now a new **Trilium** note rendering faithfully the web page in your [day note](https://github.com/zadam/trilium/wiki/Day-notes)\r\n   ![](img/page-rendered-in-trilium.png)\r\n\r\n\r\n## Throubleshotting\r\n* Ensure trilium installed version is \u003e 0.38\r\n* Here is a screenshot of my own singlefile config, may help if default options don't work:\r\n  ![](img/singlefile-config.png)\r\n\r\n\r\n\r\n[singlefile2trilium-sender.py]: singlefile2trilium-sender.py\r\n[singlefile2trilium-handler.js]: singlefile2trilium-handler.js\r\n\r\n[Trilium]: https://github.com/zadam/trilium\r\n[custom request handler]: https://github.com/zadam/trilium/wiki/Custom-request-handler\r\n\r\n[SingleFile]: https://github.com/gildas-lormeau/SingleFile\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnil0x42%2Fsinglefile2trilium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnil0x42%2Fsinglefile2trilium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnil0x42%2Fsinglefile2trilium/lists"}