-
-
Notifications
You must be signed in to change notification settings - Fork 0
Copilot/turn repo into obsidian plugin #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| node_modules/ | ||
| *.log | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,206 +1,51 @@ | ||
| # Obsidian Style CaseMap Database | ||
| # CaseMap Database (Obsidian Community Plugin) | ||
|
|
||
| A comprehensive, extensible Obsidian vault and workflow inspired by LexisNexis CaseMap. | ||
| Includes advanced fileClass design, custom field templates, evidence/chronology/matrix management, automation scripts, and plugin-neutral organization. | ||
| **Works great on desktop and iPad (see iPad instructions below).** | ||
| This repository is now an Obsidian community plugin that creates and manages a CaseMap-style legal knowledge base directly inside your vault. | ||
|
|
||
| --- | ||
| ## Plugin Commands | ||
|
|
||
| ## 📂 Folder Structure | ||
| - **Initialize CaseMap database structure** | ||
| - Creates folders: `Cases`, `Facts`, `People`, `Issues`, `Evidence`, `Chronology`, `Matrix`, `FileClasses`, `Templates` | ||
| - Seeds starter templates and fileClass definition files | ||
| - **Generate CaseMap indexes** | ||
| - Updates `_index.md` files in primary folders | ||
| - **Generate master chronology** | ||
| - Builds `Chronology/master_chronology.md` from date-tagged notes | ||
| - **Generate evidence matrix** | ||
| - Builds `Matrix/evidence_matrix.md` from Evidence note relationships | ||
| - **Generate FileClass field index** | ||
| - Builds `FileClasses/_fileclass_index.md` | ||
|
|
||
| ``` | ||
| obsidian-style-case-map-database/ | ||
| ├── .obsidian/ | ||
| ├── templates/ | ||
| │ ├── fileClass/ | ||
| │ │ ├── Case.fileclass.md | ||
| │ │ ├── Fact.fileclass.md | ||
| │ │ ├── Person.fileclass.md | ||
| │ │ ├── Evidence.fileclass.md | ||
| │ │ ├── Issue.fileclass.md | ||
| │ │ └── Chronology.fileclass.md | ||
| │ ├── Case Template.md | ||
| │ ├── Fact Template.md | ||
| │ ├── Person Template.md | ||
| │ ├── Evidence Template.md | ||
| │ ├── Issue Template.md | ||
| │ └── Chronology Item Template.md | ||
| ├── scripts/ | ||
| │ ├── generate-index.js | ||
| │ ├── generate-chronology.js | ||
| │ ├── generate-evidence-matrix.js | ||
| │ └── generate-fileclass-fields.js | ||
| ├── vault/ | ||
| │ ├── Cases/ | ||
| │ ├── Facts/ | ||
| │ ├── People/ | ||
| │ ├── Evidence/ | ||
| │ ├── Issues/ | ||
| │ ├── Chronology/ | ||
| │ ├── Matrix/ | ||
| │ └── FileClasses/ | ||
| │ ├── Case.fileclass.md | ||
| │ ├── Fact.fileclass.md | ||
| │ ├── Person.fileclass.md | ||
| │ ├── Evidence.fileclass.md | ||
| │ ├── Issue.fileclass.md | ||
| │ └── Chronology.fileclass.md | ||
| └── README.md | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 🚀 Features | ||
|
|
||
| - **FileClass System:** | ||
| Every entity gets its own `fileClass` specification (`/FileClasses/`) for structured notes, automation, and compatibility with YAML-aware plugins like Dataview & Properties. | ||
| - **Ready-to-use Markdown Templates:** | ||
| Find starter templates for every entity in `/templates/`. | ||
| - **Evidence Management:** | ||
| Handle PDF/image evidence, link notes, annotate, and generate an evidence matrix. | ||
| - **Chronology Timeline:** | ||
| Maintain a sortable, linked timeline of all facts, evidence, and events. | ||
| - **Evidence Matrix:** | ||
| Auto-generated matrix showing relationships between evidence, facts, issues, people, and cases. | ||
| - **Scripted Automation:** | ||
| - Section indexes (`generate-index.js`) | ||
| - FileClass field documentation (`generate-fileclass-fields.js`) | ||
| - Chronology updater (`generate-chronology.js`) | ||
| - Evidence matrix updater (`generate-evidence-matrix.js`) | ||
| - **iPad-friendly:** | ||
| All organizational and linking features work on iPad (some desktop-only scripts, see below). | ||
|
|
||
| --- | ||
|
|
||
| ## 📝 Getting Started | ||
|
|
||
| 1. **Copy/repo clone the project to your computer or iPad (see iPad instructions below).** | ||
| 2. Open the vault in Obsidian. | ||
| 3. Use templates for all new notes. | ||
| Each note starts with YAML frontmatter tying it to the correct `fileClass`. | ||
| 4. Interlink notes with `[[WikiLinks]]`. | ||
| 5. To run automation scripts, use Node.js on desktop or laptop. | ||
|
|
||
| --- | ||
|
|
||
| ## 🔧 Scripts & Automation | ||
| ## Development | ||
|
|
||
| - **`generate-index.js`** – Master index files in every main folder. | ||
| - **`generate-fileclass-fields.js`** – Lists all fileClasses and their defined fields (see `/vault/FileClasses/_fileclass_index.md`). | ||
| - **`generate-chronology.js`** – Updates a master timeline in `/vault/Chronology/master_chronology.md`. | ||
| - **`generate-evidence-matrix.js`** – Updates evidence matrix in `/vault/Matrix/evidence_matrix.md`. | ||
| - _Usage:_ Run from terminal with `node scripts/scriptname.js` | ||
| *(Not supported directly on iPad — see workflow below.)* | ||
|
|
||
| --- | ||
|
|
||
| ## 📚 FileClass & Custom Fields | ||
|
|
||
| Every note begins with YAML frontmatter, for example: | ||
|
|
||
| ```yaml | ||
| --- | ||
| fileClass: Case | ||
| CaseName: | ||
| DateOpened: | ||
| Court: | ||
| ... | ||
| --- | ||
| ```bash | ||
| npm install | ||
| npm run build | ||
| ``` | ||
|
|
||
| - Use `/vault/FileClasses/*.fileclass.md` to define schema for each entity. | ||
| - Customize fields at will. | ||
|
|
||
| --- | ||
|
|
||
| ## 📱 Obsidian on iPad Instructions | ||
|
|
||
| 1. **Install [Obsidian on iOS](https://obsidian.md/mobile).** | ||
| 2. **Transfer this project:** | ||
| - ZIP on computer, send to iPad via AirDrop, iCloud Drive, or email. | ||
| - Unarchive in the Files app. Open as a new vault in Obsidian (“Open folder as vault”). | ||
| - Or, use Working Copy app to clone/sync from GitHub and link the folder to Obsidian. | ||
| 3. **Templates & Daily Use:** | ||
| - Use templates (move/copy `/templates/`) as needed to your Vault, or Templates plugin folder. | ||
| - Add notes with YAML and fileClass fields. | ||
| - Interlink notes. | ||
| 4. **Syncing Between Devices:** | ||
| - Use iCloud, Dropbox, or GitHub (plus Working Copy) to sync your vault between iPad and desktop. | ||
| 5. **Scripts:** | ||
| - Scripts **cannot run on iPad/iOS directly** (no Node.js runtime). | ||
| - To update indexes, timeline, or matrix: run scripts on your computer and sync updated `.md` files back to iPad using cloud storage or GitHub. | ||
|
|
||
| **Tip:** Core features (linking, templates, note schema) work natively on iPad. Use plugins like [Dataview](https://github.com/blacksmithgu/obsidian-dataview) and [Templater](https://github.com/SilentVoid13/Templater) for extra power. | ||
|
|
||
| --- | ||
|
|
||
| ## 🖥️ Running Scripts on iPad (a-Shell/iSH) | ||
|
|
||
| You can use a-Shell or iSH to run project scripts directly on your iPad. | ||
|
|
||
| ### a-Shell Usage (recommended for Node.js scripts): | ||
|
|
||
| 1. [Download a-Shell from the App Store](https://apps.apple.com/us/app/a-shell/id1473805438). | ||
| 2. Copy the `/scripts/` folder from your vault to an accessible location in Files. | ||
| 3. Open a-Shell: | ||
| - Ensure Node.js is available: | ||
| ``` | ||
| pip install nodejs | ||
| ``` | ||
| or check with: | ||
| ``` | ||
| node -v | ||
| ``` | ||
| - Change to your scripts directory: | ||
| ``` | ||
| cd /path/to/your/vault/scripts | ||
| ``` | ||
| - Run scripts as you would on desktop: | ||
| ``` | ||
| node generate-index.js | ||
| ``` | ||
| 4. If your vault is in iCloud, you may need to copy files back/forth as required. | ||
|
|
||
| ### iSH Usage (bash/python; NOT for Node.js scripts): | ||
|
|
||
| - [Download iSH Shell from the App Store](https://apps.apple.com/us/app/ish-shell/id1436902243). | ||
| - iSH works for bash/python automation, but **Node.js does not run natively** in iSH. | ||
| - If you want bash/Python versions of scripts, adapt the provided JS scripts—ask if you need help! | ||
|
|
||
| > **File/script locations must be accessible to your shell environment.** | ||
| > You can copy outputs back into Obsidian’s vault via the Files app. | ||
|
|
||
| --- | ||
|
|
||
| ## 🛠️ Plugins (Optional but Recommended) | ||
|
|
||
| - [Dataview](https://github.com/blacksmithgu/obsidian-dataview): query, table, and summary views by YAML fields. | ||
| - [Properties](https://help.obsidian.md/Editing+and+formatting/Properties): visual field management. | ||
| - [Templater](https://github.com/SilentVoid13/Templater): powerful template fills. | ||
| - Most plugins work on iPad, but confirm compatibility if using non-core plugins. | ||
|
|
||
| --- | ||
|
|
||
| ## ✅ Example Workflow | ||
|
|
||
| - Open vault in Obsidian (iPad or desktop). | ||
| - When creating a Case/Fact/Person/Evidence/Issue/Chronology/Event, start from the proper template. | ||
| - Fill YAML fields! | ||
| - Link notes using `[[ ]]`. | ||
| - On desktop, or with a-Shell, run scripts for smart indexes and reporting, then re-sync your vault to mobile. | ||
|
|
||
| --- | ||
|
|
||
| ## 💡 Tips | ||
|
|
||
| - You can extend any entity or fileClass with more fields as needed. | ||
| - The matrix and chronology let you get a 360° view of case facts, issues, and supporting evidence. | ||
| - If using GitHub to sync, always pull before running scripts and push after updating your indexes/timelines. | ||
|
|
||
| --- | ||
|
|
||
| ## 👩💻 Support, Ideas, & Feedback | ||
|
|
||
| Open a GitHub issue at [https://github.com/carlymariec](https://github.com/carlymariec) or submit a pull request for improvements or fixes. | ||
|
|
||
| *This project is not affiliated with LexisNexis. It’s for creative, research, and educational use.* | ||
| Build output is written to `main.js`. | ||
|
|
||
| ## Install for Local Testing | ||
|
|
||
| 1. Build the plugin: | ||
| ```bash | ||
| npm install | ||
| npm run build | ||
| ``` | ||
| 2. Copy these files into your vault plugin folder: | ||
| - `manifest.json` | ||
| - `main.js` | ||
| - `versions.json` | ||
| 3. Place them at: | ||
| - `<your-vault>/.obsidian/plugins/obsidian-style-casemap-database/` | ||
| 4. In Obsidian: | ||
| - Open **Settings → Community plugins** | ||
| - Turn off **Restricted mode** | ||
| - Enable **CaseMap Database** | ||
|
|
||
| ## Repository Contents | ||
|
|
||
| - `src/main.ts` – plugin source code | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| - `manifest.json` – Obsidian plugin metadata | ||
| - `versions.json` – plugin version compatibility | ||
| - `templates/` and `vault/` – legacy project content retained for reference | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||||||||||||||||||
| const esbuild = require("esbuild"); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const isWatch = process.argv.includes("--watch"); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const buildOptions = { | ||||||||||||||||||||||
| entryPoints: ["src/main.ts"], | ||||||||||||||||||||||
| bundle: true, | ||||||||||||||||||||||
| outfile: "main.js", | ||||||||||||||||||||||
| format: "cjs", | ||||||||||||||||||||||
| platform: "browser", | ||||||||||||||||||||||
| target: "es2020", | ||||||||||||||||||||||
| sourcemap: false, | ||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||
| external: ["obsidian", "electron", "@codemirror/state", "@codemirror/view"] | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if (isWatch) { | ||||||||||||||||||||||
| esbuild.context(buildOptions).then((ctx) => ctx.watch()); | ||||||||||||||||||||||
| } else { | ||||||||||||||||||||||
| esbuild.build(buildOptions).catch(() => process.exit(1)); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
Comment on lines
+16
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Suggested change
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that the
node_modules/directory has been committed to the repository, despite being added to.gitignore. Committingnode_modules/significantly bloats the repository size and is a bad practice. You should untrack these files usinggit rm -r --cached node_modulesand commit the deletion.