{"id":18256660,"url":"https://github.com/honmaple/emacs-maple-preview","last_synced_at":"2025-10-28T14:06:28.524Z","repository":{"id":145149482,"uuid":"165162268","full_name":"honmaple/emacs-maple-preview","owner":"honmaple","description":"markdown, org-mode or html realtime preview on Emacs","archived":false,"fork":false,"pushed_at":"2024-09-19T08:23:20.000Z","size":2150,"stargazers_count":24,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T16:52:02.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/honmaple.png","metadata":{"files":{"readme":"README.org","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":"2019-01-11T02:04:17.000Z","updated_at":"2024-10-25T06:26:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"64c09161-8c22-463d-a10e-1c9b3b948dfb","html_url":"https://github.com/honmaple/emacs-maple-preview","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/honmaple%2Femacs-maple-preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honmaple%2Femacs-maple-preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honmaple%2Femacs-maple-preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honmaple%2Femacs-maple-preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/honmaple","download_url":"https://codeload.github.com/honmaple/emacs-maple-preview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247229087,"owners_count":20904978,"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":[],"created_at":"2024-11-05T10:23:05.563Z","updated_at":"2025-10-28T14:06:28.427Z","avatar_url":"https://github.com/honmaple.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"* emacs-maple-preview\n  markdown, org-mode or html realtime preview on Emacs\n\n** screenshot\n   [[https://github.com/honmaple/emacs-maple-preview/blob/master/screenshot/preview.gif]]\n\n** quickstart\n   #+begin_src elisp\n     (use-package maple-preview\n       :quelpa (:fetcher github :repo \"honmaple/emacs-maple-preview\" :files (\"*.el\" \"index.html\" \"static\"))\n       :commands (maple-preview-mode))\n   #+end_src\n\n   Or alternatively, you can download the repository and install manually by doing:\n   #+BEGIN_SRC sehll\n   git clone https://github.com/honmaple/emacs-maple-preview ~/.emacs.d/site-lisp/maple-preview\n   #+END_SRC\n\n   #+begin_src elisp\n     ;; These are dependent libraries\n     (use-package websocket)\n     (use-package web-server)\n\n     (use-package maple-preview\n       :ensure nil\n       :commands (maple-preview-mode))\n   #+end_src\n\n** customize\n   #+begin_src elisp\n     ;; only enable preview within some special modes\n     (setq maple-preview:allow-modes '(org-mode markdown-mode html-mode web-mode))\n     ;; How to preview text, export to markdown or html\n     (setq maple-preview:text-content '((t . maple-preview:markdown-content)))\n     ;; Preview http host\n     (setq maple-preview:host \"localhost\")\n     ;; Preview http port, t means use unused port\n     (setq maple-preview:port t)\n     ;; Delay preview when auto update is non-nil\n     (setq maple-preview:delay 0.1)\n     ;; Auto open browser\n     (setq maple-preview:browser-open t)\n     ;; Auto preview when insert\n     (setq maple-preview:auto-update t)\n     ;; Auto scroll when preview\n     (setq maple-preview:auto-scroll t)\n     ;; custom css or js file\n     (add-to-list 'maple-preview:js-file \"https://cdn.bootcss.com/mathjax/2.7.6/MathJax.js\" t)\n     (add-to-list 'maple-preview:css-file\n                  \"\u003cstyle type=\\\"text/css\\\"\u003e\n                     body {\n                         max-width: 800px;\n                     }\n                   \u003c/style\u003e\" t)\n   #+end_src\n\n* Static Files\n  - css\n    #+begin_example\n    wget https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.5.1/github-markdown.min.css -O static/css/markdown.css\n    wget https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css -O static/css/highlight.css\n    #+end_example\n  - js\n    #+begin_example\n    wget https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js -O static/js/jquery.min.js\n    wget https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.1/marked.min.js -O static/js/marked.min.js\n    wget https://cdnjs.cloudflare.com/ajax/libs/marked-highlight/2.1.1/index.umd.min.js -O static/js/marked-highlight.min.js\n    wget https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js -O static/js/highlight.min.js\n    wget https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.9.0/mermaid.min.js -O static/js/mermaid.min.js\n    #+end_example\n\n* FAQ\n** How to preview Latex within org-mode?\n   #+begin_src elisp\n     (setq maple-preview:text-content '((org-mode . maple-preview:html-content)\n                                        (t . maple-preview:markdown-content)))\n   #+end_src\n   Then *maple-preview* will export org-mode as html with mathjax.js, if you want to custom beautiful css, use\n\n   #+begin_example\n     #+HTML_HEAD: \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"custom.css\" /\u003e\n   #+end_example\n** How to preview mermaid within org-mode?\n   #+begin_src elisp\n     (defun maple/org-md-example-block (example-block _contents info)\n       (format \"```%s\\n%s\\n```\"\n               (org-element-property :language example-block)\n               (org-remove-indentation\n                (org-export-format-code-default example-block info))))\n     (advice-add 'org-md-example-block :override 'maple/org-md-example-block)\n\n   #+end_src\n\n   Then use src with mermaid flag\n   #+begin_src mermaid\n    graph TD\n    A[nginx]\n    B(log)\n    C(upstream)\n    A --\u003e|write| B\n    A --\u003e|send| C\n   #+end_src\n** Not available in windows?\n   Maybe it's because of the newline encoding problem in Windows\n   #+begin_src elisp\n     (defun custom-websocket-text (text)\n       (if (eq system-type 'windows-nt)\n           (replace-regexp-in-string \"\\n\" \"^M\" text)\n         text))\n\n     (advice-add 'maple-preview:websocket-text :filter-return #'custom-websocket-text)\n   #+end_src\n\n   =^M= is =C-q C-m=\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonmaple%2Femacs-maple-preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhonmaple%2Femacs-maple-preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonmaple%2Femacs-maple-preview/lists"}