Move Emacs, Obsidian plugin code out from under src/khoj directory

- What
  - The Emacs and Obsidian interfaces stay in their original
    directories under src/
  - src/khoj now only contains code meant for pypi packaging

- Benefits
  - This avoids having to update khoj MELPA, Obsidian plugin config as
    the Emacs, Obsidian code is under their original directories
  - It separates the code in src/khoj meant for python packaging from
    code for external interfaces like Emacs and Obsidian
This commit is contained in:
Debanjum Singh Solanky 2023-02-14 15:44:22 -06:00
parent f83cf4ebc6
commit bc7477ea3e
28 changed files with 39 additions and 39 deletions

View file

@ -7,13 +7,13 @@ on:
branches: branches:
- 'master' - 'master'
paths: paths:
- src/khoj/interface/emacs/*.el - src/interface/emacs/*.el
- .github/workflows/build_khoj_el.yml - .github/workflows/build_khoj_el.yml
pull_request: pull_request:
branches: branches:
- 'master' - 'master'
paths: paths:
- src/khoj/interface/emacs/*.el - src/interface/emacs/*.el
- .github/workflows/build_khoj_el.yml - .github/workflows/build_khoj_el.yml
jobs: jobs:
@ -33,7 +33,7 @@ jobs:
- name: Run - name: Run
env: env:
# Khoj recipe from https://github.com/melpa/melpa/pull/8321/files # Khoj recipe from https://github.com/melpa/melpa/pull/8321/files
RECIPE: (khoj :fetcher github :repo "debanjum/khoj" :files ("src/khoj/interface/emacs/*.el")) RECIPE: (khoj :fetcher github :repo "debanjum/khoj" :files ("src/interface/emacs/*.el"))
EXIST_OK: true EXIST_OK: true
LOCAL_REPO: ${{ github.workspace }} LOCAL_REPO: ${{ github.workspace }}
run: echo $GITHUB_REF && make -C ~/melpazoid run: echo $GITHUB_REF && make -C ~/melpazoid

View file

@ -5,15 +5,15 @@ on:
branches: branches:
- 'master' - 'master'
paths: paths:
- src/khoj/interface/emacs/*.el - src/interface/emacs/*.el
- src/khoj/interface/emacs/tests/*.el - src/interface/emacs/tests/*.el
- .github/workflows/test_khoj_el.yml - .github/workflows/test_khoj_el.yml
pull_request: pull_request:
branches: branches:
- 'master' - 'master'
paths: paths:
- src/khoj/interface/emacs/*.el - src/interface/emacs/*.el
- src/khoj/interface/emacs/tests/*.el - src/interface/emacs/tests/*.el
- .github/workflows/test_khoj_el.yml - .github/workflows/test_khoj_el.yml
jobs: jobs:
@ -44,6 +44,6 @@ jobs:
(unless package-archive-contents (package-refresh-contents)) \ (unless package-archive-contents (package-refresh-contents)) \
(unless (package-installed-p 'transient) (package-install 'transient)))" \ (unless (package-installed-p 'transient) (package-install 'transient)))" \
-l ert \ -l ert \
-l ./src/khoj/interface/emacs/khoj.el \ -l ./src/interface/emacs/khoj.el \
-l ./src/khoj/interface/emacs/tests/khoj-tests.el \ -l ./src/interface/emacs/tests/khoj-tests.el \
-f ert-run-tests-batch-and-exit -f ert-run-tests-batch-and-exit

View file

@ -2,6 +2,6 @@ include README.md
graft src/khoj/interface/* graft src/khoj/interface/*
prune src/khoj/interface/web/images* prune src/khoj/interface/web/images*
prune docs* prune docs*
prune src/khoj/interface/obsidian* prune src/interface/obsidian*
prune src/khoj/interface/emacs* prune src/interface/emacs*
global-exclude .DS_Store *.py[cod] global-exclude .DS_Store *.py[cod]

View file

@ -7,8 +7,8 @@
**Supported Plugins** **Supported Plugins**
[![Khoj on Obsidian](https://img.shields.io/badge/Obsidian-%23483699.svg?style=for-the-badge&logo=obsidian&logoColor=white)](https://github.com/debanjum/khoj/tree/master/src/khoj/interface/obsidian#readme) [![Khoj on Obsidian](https://img.shields.io/badge/Obsidian-%23483699.svg?style=for-the-badge&logo=obsidian&logoColor=white)](https://github.com/debanjum/khoj/tree/master/src/interface/obsidian#readme)
[![Khoj on Emacs](https://img.shields.io/badge/Emacs-%237F5AB6.svg?&style=for-the-badge&logo=gnu-emacs&logoColor=white)](https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#readme) [![Khoj on Emacs](https://img.shields.io/badge/Emacs-%237F5AB6.svg?&style=for-the-badge&logo=gnu-emacs&logoColor=white)](https://github.com/debanjum/khoj/tree/master/src/interface/emacs#readme)
## Table of Contents ## Table of Contents
@ -59,7 +59,7 @@
- **Incremental**: Incremental search for a fast, search-as-you-type experience - **Incremental**: Incremental search for a fast, search-as-you-type experience
- **Pluggable**: Modular architecture makes it easy to plug in new data sources, frontends and ML models - **Pluggable**: Modular architecture makes it easy to plug in new data sources, frontends and ML models
- **Multiple Sources**: Search your Org-mode and Markdown notes, Beancount transactions and Photos - **Multiple Sources**: Search your Org-mode and Markdown notes, Beancount transactions and Photos
- **Multiple Interfaces**: Search using a [Web Browser](./src/khoj/interface/web/index.html), [Emacs](./src/khoj/interface/emacs/khoj.el) or the [API](http://localhost:8000/docs) - **Multiple Interfaces**: Search using a [Web Browser](./src/khoj/interface/web/index.html), [Emacs](./src/interface/emacs/khoj.el) or the [API](http://localhost:8000/docs)
## Demos ## Demos
### Khoj in Obsidian ### Khoj in Obsidian
@ -83,9 +83,9 @@ https://user-images.githubusercontent.com/6413477/184735169-92c78bf1-d827-4663-9
- Install Khoj via pip - Install Khoj via pip
- Start Khoj app - Start Khoj app
- Add this readme and [khoj.el readme](https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs) as org-mode for Khoj to index - Add this readme and [khoj.el readme](https://github.com/debanjum/khoj/tree/master/src/interface/emacs) as org-mode for Khoj to index
- Search \"*Setup editor*\" on the Web and Emacs. Re-rank the results for better accuracy - Search \"*Setup editor*\" on the Web and Emacs. Re-rank the results for better accuracy
- Top result is what we are looking for, the [section to Install Khoj.el on Emacs](https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#2-Install-Khojel) - Top result is what we are looking for, the [section to Install Khoj.el on Emacs](https://github.com/debanjum/khoj/tree/master/src/interface/emacs#2-Install-Khojel)
</details> </details>
<details><summary>Analysis</summary> <details><summary>Analysis</summary>
@ -107,8 +107,8 @@ https://user-images.githubusercontent.com/6413477/184735169-92c78bf1-d827-4663-9
## Setup ## Setup
These are the general setup instructions for Khoj. These are the general setup instructions for Khoj.
- Check the [Khoj.el Readme](https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Setup) to setup Khoj with Emacs - Check the [Khoj.el Readme](https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Setup) to setup Khoj with Emacs
- Check the [Khoj Obsidian Readme](https://github.com/debanjum/khoj/tree/master/src/khoj/interface/obsidian#Setup) to setup Khoj with Obsidian<br /> - Check the [Khoj Obsidian Readme](https://github.com/debanjum/khoj/tree/master/src/interface/obsidian#Setup) to setup Khoj with Obsidian<br />
Its simpler as it can skip the configure step below. Its simpler as it can skip the configure step below.
### 1. Install ### 1. Install
@ -132,10 +132,10 @@ khoj
### Interfaces ### Interfaces
- **Khoj via Obsidian** - **Khoj via Obsidian**
- [Install](https://github.com/debanjum/khoj/tree/master/src/khoj/interface/obsidian#2-Setup-Plugin) the Khoj Obsidian plugin - [Install](https://github.com/debanjum/khoj/tree/master/src/interface/obsidian#2-Setup-Plugin) the Khoj Obsidian plugin
- Click the *Khoj search* icon 🔎 on the [Ribbon](https://help.obsidian.md/User+interface/Workspace/Ribbon) or Search for *Khoj: Search* in the [Command Palette](https://help.obsidian.md/Plugins/Command+palette) - Click the *Khoj search* icon 🔎 on the [Ribbon](https://help.obsidian.md/User+interface/Workspace/Ribbon) or Search for *Khoj: Search* in the [Command Palette](https://help.obsidian.md/Plugins/Command+palette)
- **Khoj via Emacs** - **Khoj via Emacs**
- [Install](https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#installation) [khoj.el](./src/khoj/interface/emacs/khoj.el) - [Install](https://github.com/debanjum/khoj/tree/master/src/interface/emacs#installation) [khoj.el](./src/interface/emacs/khoj.el)
- Run `M-x khoj <user-query>` - Run `M-x khoj <user-query>`
- **Khoj via Web** - **Khoj via Web**
- Open <http://localhost:8000/> via desktop interface or directly - Open <http://localhost:8000/> via desktop interface or directly
@ -169,11 +169,11 @@ pip install --upgrade khoj-assistant
### Upgrade Khoj on Emacs ### Upgrade Khoj on Emacs
- Use your Emacs Package Manager to Upgrade - Use your Emacs Package Manager to Upgrade
- See [khoj.el readme](https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Upgrade) for details - See [khoj.el readme](https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Upgrade) for details
### Upgrade Khoj on Obsidian ### Upgrade Khoj on Obsidian
- Upgrade via the Community plugins tab on the settings pane in the Obsidian app - Upgrade via the Community plugins tab on the settings pane in the Obsidian app
- See the [khoj plugin readme](https://github.com/debanjum/khoj/tree/master/src/khoj/interface/obsidian#2-Setup-Plugin) for details - See the [khoj plugin readme](https://github.com/debanjum/khoj/tree/master/src/interface/obsidian#2-Setup-Plugin) for details
## Uninstall Khoj ## Uninstall Khoj
1. (Optional) Hit `Ctrl-C` in the terminal running the khoj server to stop it 1. (Optional) Hit `Ctrl-C` in the terminal running the khoj server to stop it

View file

@ -4,19 +4,19 @@
/Natural, Incremental Search for your Second Brain/ /Natural, Incremental Search for your Second Brain/
** Table of Contents ** Table of Contents
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#features][Features]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#features][Features]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Interface][Interface]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Interface][Interface]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Setup][Setup]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Setup][Setup]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#1-Setup-Backend][Setup Backend]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#1-Setup-Backend][Setup Backend]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#2-Install-Khojel][Install Khoj.el]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#2-Install-Khojel][Install Khoj.el]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Use][Use]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Use][Use]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Search][Search]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Search][Search]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Find-similar-entries][Find Similar Entries]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Find-similar-entries][Find Similar Entries]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Advanced-usage][Advanced Usage]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Advanced-usage][Advanced Usage]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Khoj-menu][Khoj Menu]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Khoj-menu][Khoj Menu]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Upgrade][Upgrade]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Upgrade][Upgrade]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Upgrade-Khoj-Backend][Upgrade Backend]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Upgrade-Khoj-Backend][Upgrade Backend]]
- [[https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs#Upgrade-Khojel][Upgrade Khoj.el]] - [[https://github.com/debanjum/khoj/tree/master/src/interface/emacs#Upgrade-Khojel][Upgrade Khoj.el]]
** Features ** Features
- *Natural*: Advanced natural language understanding using Transformer based ML Models - *Natural*: Advanced natural language understanding using Transformer based ML Models
@ -58,7 +58,7 @@
;; Install Khoj Package using Straight.el ;; Install Khoj Package using Straight.el
(use-package khoj (use-package khoj
:after org :after org
:straight (khoj :type git :host github :repo "debanjum/khoj" :files (:defaults "src/khoj/interface/emacs/khoj.el")) :straight (khoj :type git :host github :repo "debanjum/khoj" :files (:defaults "src/interface/emacs/khoj.el"))
:bind ("C-c s" . 'khoj)) :bind ("C-c s" . 'khoj))
#+end_src #+end_src

View file

@ -7,7 +7,7 @@
;; Keywords: search, org-mode, outlines, markdown, beancount, ledger, image ;; Keywords: search, org-mode, outlines, markdown, beancount, ledger, image
;; Version: 0.3.0 ;; Version: 0.3.0
;; Package-Requires: ((emacs "27.1") (transient "0.3.0")) ;; Package-Requires: ((emacs "27.1") (transient "0.3.0"))
;; URL: https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs ;; URL: https://github.com/debanjum/khoj/tree/master/src/interface/emacs
;; This file is NOT part of GNU Emacs. ;; This file is NOT part of GNU Emacs.

View file

@ -5,7 +5,7 @@
;; Author: Debanjum Singh Solanky <debanjum@gmail.com> ;; Author: Debanjum Singh Solanky <debanjum@gmail.com>
;; Version: 0.0.0 ;; Version: 0.0.0
;; Package-Requires: ((emacs "27.1") (transient "0.3.0")) ;; Package-Requires: ((emacs "27.1") (transient "0.3.0"))
;; URL: https://github.com/debanjum/khoj/tree/master/src/khoj/interface/emacs ;; URL: https://github.com/debanjum/khoj/tree/master/src/interface/emacs
;;; License: ;;; License:

View file

Before

Width:  |  Height:  |  Size: 378 KiB

After

Width:  |  Height:  |  Size: 378 KiB

View file

@ -28,7 +28,7 @@
;; Khoj Package for Semantic Search ;; Khoj Package for Semantic Search
(use-package khoj (use-package khoj
:after org :after org
:straight (khoj :type git :host github :repo "debanjum/khoj" :files (:defaults "src/khoj/interface/emacs/khoj.el")) :straight (khoj :type git :host github :repo "debanjum/khoj" :files (:defaults "src/interface/emacs/khoj.el"))
:bind ("C-c s" . 'khoj)) :bind ("C-c s" . 'khoj))
``` ```
- With [Quelpa](https://github.com/quelpa/quelpa#installation) - With [Quelpa](https://github.com/quelpa/quelpa#installation)