{"id":13760400,"url":"https://github.com/jingtaozf/literate-clojure","last_synced_at":"2025-04-16T14:26:07.499Z","repository":{"id":57713814,"uuid":"162936782","full_name":"jingtaozf/literate-clojure","owner":"jingtaozf","description":"Load Clojure/ClojureScript code blocks from Org files","archived":false,"fork":false,"pushed_at":"2024-06-02T00:42:26.000Z","size":797,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-11T17:14:18.544Z","etag":null,"topics":["clojure","emacs","literate-programming","literate-programs","org-mode"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/jingtaozf.png","metadata":{"files":{"readme":"README.org","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-24T01:29:42.000Z","updated_at":"2024-06-02T00:42:29.000Z","dependencies_parsed_at":"2024-08-03T13:14:55.537Z","dependency_job_id":null,"html_url":"https://github.com/jingtaozf/literate-clojure","commit_stats":{"total_commits":69,"total_committers":1,"mean_commits":69.0,"dds":0.0,"last_synced_commit":"f130938def6ba57689537768c9e8b2abbd712085"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingtaozf%2Fliterate-clojure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingtaozf%2Fliterate-clojure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingtaozf%2Fliterate-clojure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingtaozf%2Fliterate-clojure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jingtaozf","download_url":"https://codeload.github.com/jingtaozf/literate-clojure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249250310,"owners_count":21237873,"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":["clojure","emacs","literate-programming","literate-programs","org-mode"],"created_at":"2024-08-03T13:01:09.547Z","updated_at":"2025-04-16T14:26:07.476Z","avatar_url":"https://github.com/jingtaozf.png","language":"Clojure","funding_links":[],"categories":["Clojure"],"sub_categories":[],"readme":"# -*- encoding:utf-8 Mode: POLY-ORG;  -*- --- \n#+Startup: noindent\n#+PROPERTY:    header-args        :results silent   :eval no-export   :comments org\n#+OPTIONS:     num:nil toc:nil todo:nil tasks:nil tags:nil\n#+OPTIONS:     skip:nil author:nil email:nil creator:nil timestamp:t\n#+INFOJS_OPT:  view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js\n[[https://clojars.org/literate-clojure][file:https://img.shields.io/clojars/v/literate-clojure.svg]]\n[[https://travis-ci.com/jingtaozf/literate-clojure][file:https://travis-ci.com/jingtaozf/literate-clojure.svg?branch=master]]\n[[https://github.com/jingtaozf/literate-clojure/actions][file:https://github.com/jingtaozf/literate-clojure/workflows/Clojure%20CI/badge.svg]]\n\n* Table of Contents                                                   :TOC:\n- [[#introduction][Introduction]]\n- [[#tutorial][Tutorial]]\n  - [[#install-polymode-in-emacs][install polymode in emacs]]\n  - [[#how-to-insert-code-block-quickly][how to insert code block quickly]]\n  - [[#add-dependence-in-projectclj][Add dependence in project.clj]]\n  - [[#load-org-file][Load org file]]\n  - [[#the-special-requirement-for-org-files][The special requirement for org files]]\n  - [[#a-new-code-block-header-argument-load][a new code block header argument ~load~]]\n- [[#license][License]]\n\n* Introduction\nThis is a clojure library designed to extend the clojure syntax \nso it can load org file as source file directly.\n\nThe implementation details of [[https://github.com/jingtaozf/literate-clojure][literate-clojure]] is in file [[./src/literate_clojure/core.org][core.org]] ([[./src/literate_clojure/core.pdf][pdf version]]).\n\nThis library is provided to make litrate programming more happy in clojure,without\npain of tangling code from org files.\n\nThis library contains the following files:\n- [[./src/literate_clojure/core.org]] \\\\\n  The implementation and documentation and literate clojure reader.\n- [[./src/literate_clojure/core.clj]] \\\\\n  The tangled codes of literate clojure reader, generated from [[./src/literate_clojure/core.clj]].\n- [[./src/literate_clojure/core.pdf]] \\\\\n  The weaved documentation, generated from [[./src/literate_clojure/core.clj]] by org mode's [[https://orgmode.org/manual/Triggering-publication.html#Triggering-publication][publish feature]].\n- [[test/literate_clojure/core_test.org]] \\\\\n  The testcase of [[https://github.com/jingtaozf/literate-clojure][literate-clojure]]. \n- [[test/literate_clojure/core_test.clj]] \\\\\n  The bootstrap file of test cases.\n- [[./README.org]] \\\\\n  The usage and introduction of [[https://github.com/jingtaozf/literate-clojure][literate-clojure]].\n- [[./project.clj]] \\\\\n  the lein project file of [[https://github.com/jingtaozf/literate-clojure][literate-clojure]].\n- [[./demo/project.clj]] \\\\\n  the lein project file of a demo of how to use [[https://github.com/jingtaozf/literate-clojure][literate-clojure]].\n- [[./demo/src/demo/literate_core.clj]] \\\\  \n  The demo documentation and codes. \n- [[./demo/src/demo/core.clj]] \\\\  \n  the bootstrap file to load [[./demo/src/demo/literate_core.clj]]. \n- [[./.travis.yml]] \\\\\n  The config file used by Web service [[https://travis-ci.com/jingtaozf/literate-lisp][travis ci]] to test this library.\n\n* Tutorial\n** install polymode in emacs\nIt's better to edit the org file with [[https://polymode.github.io/][polymode]],which will make code block use its native file mode. \nThe following elisp scripts in .emacs will install it.\n#+BEGIN_SRC elisp\n(use-package poly-org\n    :ensure t)\n#+END_SRC\nUsually I will add the following line as the first line of an clojure source file (*.clj or *.cljs)\n#+BEGIN_SRC elisp\n# -*- encoding:utf-8 Mode: POLY-ORG;  -*- --- \n#+END_SRC\nBut GitHub will not render such file in org mode, to fix this issue, I will add the following line as the first line instead.\n#+BEGIN_SRC elisp\n# -*- encoding:utf-8 Mode: ORG;  -*- --- \n#+END_SRC\nAnd in my Emacs configuration file, I will add a hook to enable [[https://polymode.github.io/][polymode]] for such file:\n#+BEGIN_SRC elisp\n(defun enable-poly-org-mode ()\n  (when (and buffer-file-name (not (string= \"org\" (downcase (file-name-extension buffer-file-name)))))\n    (poly-org-mode 1)))\n(add-hook 'org-mode-hook 'enable-poly-org-mode)\n#+END_SRC\nSo Github can render such source file as org mode correctly.\n** how to insert code block quickly\nPlease have a look of the section [[https://github.com/jingtaozf/literate-elisp/blob/master/literate-elisp.org#how-to-insert-code-block-in-org-file][How to insert code block in org file]] in library [[https://github.com/jingtaozf/literate-elisp][literate-elisp]].\n** Add dependence in project.clj\nTo use this library, please add dependence in your [[./demo/project.clj][project.clj]]:\n#+BEGIN_SRC clojure\n:dependencies [[literate-clojure \"0.1.1\"]]\n#+END_SRC\n** Load org file\nThen in one of your [[./demo/src/demo/core.clj][source file]],add the following codes to install the org syntax for clojure reader:\n#+BEGIN_SRC clojure\n(require 'literate-clojure.core)\n(literate-clojure.core/install-org-dispatcher)\n(load-file \"src/demo/core.org\")\n#+END_SRC\nNow you can use [[./demo/src/demo/literate_core.clj][literate_core.clj]] to write your documentation and source codes together,\nand any codes in [[./demo/src/demo/core.org][core.org]] will be loaded automatically.\n** The special requirement for org files\nThe org files must start with a sharp and a space, for example I usually add the following line\nto the beginning of an org file:\n#+BEGIN_SRC org\n# -*- encoding:utf-8 Mode: POLY-ORG;  -*- --- \n#+END_SRC\nIt will use Emacs library [[https://github.com/polymode/poly-org][poly-org-mode]] which is a lightweight library \nto support multiple major mode in one file,\nso you can edit clojure code natively in an org file.\n** a new code block header argument ~load~\nPlease have a look of the section [[./src/literate_clojure/core.org#handle-org-syntax][handle org syntax]] in [[./src/literate_clojure/core.org][./src/literate_clojure/core.org]].\n* License\n\nCopyright © 2018 Jingtao Xu\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingtaozf%2Fliterate-clojure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjingtaozf%2Fliterate-clojure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingtaozf%2Fliterate-clojure/lists"}