Giter Site home page Giter Site logo

obsidian-orgmode-cm6's Introduction

Obsidian Orgmode CM6

Orgmode for Obsidian.

Screenshot

This plugin is using a separate codemirror 6 instance with a custom lezer grammar (not everything is implemented). Inspired by https://github.com/ryanpcmcquen/obsidian-org-mode and https://github.com/nothingislost/obsidian-cm6-attributes.

Features

  • collapsable headings
  • customizable todo keywords in the settings
  • customizable colors via css (use the styles.css as a css snippet and tweak it)
  • text markup (bold, italic, underline, strike-through)
  • links (url, vault file, a link to an image is rendered)
  • show orgmode tasks in markdown files (unstable feature, see the dedicated section)

Usage

By default org files are not shown in the sidebar. To display them you need to go into the obsidian settings, section Files and links and check Detect all file extensions.

detect-all-file-extensions

To create an org file in your vault, you currently have to create outside obsidian as obsidian doesn't allow to create a non-markdown file.

If you don't already have an org file, try to create a file called todo.org with the following content:

* TODO [#A] A task with *high* priority

The description of the task

* A collapsed section

You cannot see the description when collapsed

* DONE something done already :sometag:
SCHEDULED: <2023-12-08 Fri 11:13>
:PROPERTIES:
:CREATED: [2023-12-03 Sun 10:48]
:END:

a [[https://github.com/BBazard/obsidian-orgmode-cm6][link]]

Show orgmode tasks in markdown files

This feature is unstable and will likely change in breaking ways in the future.

Currently only TODO and DONE are handled.

orgmode-tasks.mp4

Development

git clone https://github.com/bbazard/obsidian-orgmode-cm6
cd obsidian-orgmode-cm6
npm install
npm run build
npm test
cp main.js styles.css manifest.json "$OBSIDIAN_VAULT"/.obsidian/plugins/obsidian-orgmode-cm6/

obsidian-orgmode-cm6's People

Contributors

bbazard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

xiyuefox

obsidian-orgmode-cm6's Issues

npm install fails with TS2307: Cannot find module './orgmode.grammar' or its corresponding type declarations.

Thank you very much for making this!

I would like to build according to the instructions in the readme. However, after following all instructions, npm install fails as follows:

obsidian-orgmode-cm6 % npm install

> prepare
> lezer-generator --typeScript codemirror-lang-orgmode/src/orgmode.grammar -o codemirror-lang-orgmode/src/parser && rollup -c

Wrote codemirror-lang-orgmode/src/parser.ts and codemirror-lang-orgmode/src/parser.terms.ts

codemirror-lang-orgmode/src/index.ts → codemirror-lang-orgmode/dist/index.cjs, ./codemirror-lang-orgmode/dist...
[!] (plugin Typescript) TS2307: Cannot find module './orgmode.grammar' or its corresponding type declarations.
codemirror-lang-orgmode/src/index.ts (1:24)

1 import { parser } from "./orgmode.grammar"
                         ~~~~~~~~~~~~~~~~~~~


npm ERR! code 1
npm ERR! path /Users/charlbotha/build/obsidian-orgmode-cm6
npm ERR! command failed
npm ERR! command sh -c lezer-generator --typeScript codemirror-lang-orgmode/src/orgmode.grammar -o codemirror-lang-orgmode/src/parser && rollup -c

This is with node 20.11.1 and npm 10.2.4.

I also tried replacing that orgmode.grammar include with the auto-generated parser.ts (just in case this could work around the issue), but then ran into:

npm install

> prepare
> lezer-generator --typeScript codemirror-lang-orgmode/src/orgmode.grammar -o codemirror-lang-orgmode/src/parser && rollup -c

Wrote codemirror-lang-orgmode/src/parser.ts and codemirror-lang-orgmode/src/parser.terms.ts

codemirror-lang-orgmode/src/index.ts → codemirror-lang-orgmode/dist/index.cjs, ./codemirror-lang-orgmode/dist...
[!] (plugin Typescript) TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
codemirror-lang-orgmode/src/external-tokens.ts (37:28)

37   const words = [...global.todoKeywords, ...global.doneKeywords]
                              ~~~~~~~~~~~~


npm ERR! code 1
npm ERR! path /Users/charlbotha/build/obsidian-orgmode-cm6
npm ERR! command failed
npm ERR! command sh -c lezer-generator --typeScript codemirror-lang-orgmode/src/orgmode.grammar -o codemirror-lang-orgmode/src/parser && rollup -c

respect ID: link format in .org files

Hi there, thanks for making such a great plugin!

As discussed on the obsidian forum, I'd love to see this plugin format and obey the "ID:" link format in org-mode.

discussion in orgmode manual here

and two screenshots (link display toggled on and off in emacs)
image

image

Make properties drawer collapsible?

Hi - is it possible to make the the :PROPERTIES: ... :END: construct collapsible, similar to nodes, to match the behavior of *.org files in org-mode buffers in emacs?

*.org files in graph view?

imagen

Is it possible to display relationships between *.org files in the graph view? Or is it way outside the scope of the project?

Org files use Vim bindings but I don't have Vim bindings enabled

When opening an .org file in Obsidian, the plugin does a nice job of highlighting, etc. But it also seems to start out using Vim bindings, even though I have Vim key bindings disabled. Is this a CM setting/issue with the plugin?

Is there a way to not enable Vim bindings by default when editing .org documents? Perhaps it could follow the built-in "Vim key bindings" setting.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.