bramses / chatgpt-md

A (nearly) seamless integration of ChatGPT into Obsidian.
MIT License
863 stars 65 forks source link

Use Markdown syntax whenever possible #86

Open jancbeck opened 1 year ago

jancbeck commented 1 year ago

For the long-term future of this plugin, I think you should use (Obsidian) Markdown whenever possible so that the generated notes are as compatible as possible.

For example, rather than requiring role::system|assistant|user and <hr class="__chatgpt_plugin">, consider using blockquotes for user input, frontmatter for system commands and everything else assistant response.

This

---
system_commands: ['I am a helpful assistant.']
---

## role::user
should i use CommonJS (CJS) or ESM (EcmaScript modules)?

<hr class="__chatgpt_plugin">

## role::assistant 

Choosing between CommonJS (CJS) and ECMAScript modules (ESM) depends on your project requirements, the environment you are targeting, and personal preference. Here are some factors to consider: [TRUNCATED]

would become

---
system_commands: ['I am a helpful assistant.']
---

> should i use CommonJS (CJS) or ESM (EcmaScript modules)?

Choosing between CommonJS (CJS) and ECMAScript modules (ESM) depends on your project requirements, the environment you are targeting, and personal preference. Here are some factors to consider: [TRUNCATED]

Yes, this could make parsing more difficult and could introduce errors e.g. when the model outputs a ">" on the first line (which I have never seen it do before but maybe it would in some contexts).

Alternatively, consider callouts e.g.

---
system_commands: ['I am a helpful assistant.']
---

> [!note] User:
> should i use CommonJS (CJS) or ESM (EcmaScript modules)?

> [!done] Assistant:
> Choosing between CommonJS (CJS) and ECMAScript modules (ESM) depends on your project requirements, the environment you are targeting, and personal preference. Here are some factors to consider:

which would render as

Screenshot 2023-06-08 at 17 31 38
einarpersson commented 1 year ago

Callouts etc. do look visually appealing at first glance but if any features like this are added, I would def want/need a "raw output" option in the settings. I have already customized my prompt templates on how I want the output to be formatted, eg. custom code blocks etc.

I often copy stuff back and forth, and don't want extra > littered everywhere necessarily.

jancbeck commented 1 year ago

I have now settled on a compromise by using the linter plugin with a custom regex that cleans up the markup after I'm done with a chat like so

Screenshot 2023-06-29 at 11 24 33

This gets rid of the html horizontal line and adds a nice callout but keeps the output "raw" i.e. without > intentation