out-of-cheese-error / the-way

A code snippets manager for your terminal.
MIT License
352 stars 16 forks source link

Support more export formats #127

Open jgarte opened 2 years ago

jgarte commented 2 years ago

Here are some formats that might be relevant taken from jrnl for inspiration:

  --format TYPE         Display selected entries in an alternate format.
                        TYPE can be: boxed, dates, fancy, json, markdown, md,
                        pretty, short, tags, text, txt, xml, or yaml.
                        Optional parameters:

Not all apply but having yaml, markdown, xml, and plain text output of all or a selected range of snippets might be useful.

WDYT?

Ninjani commented 2 years ago

Some of these, specifically those with serde crates, are easy to add as both import/export formats.

plaintext / markdown would be difficult to support as an import format, but easier for export. What would be the difference between plaintext and running the-way view?

jgarte commented 2 years ago

Some of these, specifically those with serde crates, are easy to add as both import/export formats.

I primarily would like to have markdown and plaintext export.

sexps would be awesome too!

plaintext / markdown would be difficult to support as an import format, but easier for export. What would be the difference between plaintext and running the-way view?

It requires an index so I would need to write a for loop to get all the snippets out. I'd prefer to be able to just dump all the snippets to stdout or to dump snippets to stdout filtered by tags, etc... from the CLI directly.

I tried the-way view 14 but my cursor gets stuck. When I press Ctrl+d it kills the whole terminal:

2022-02-07-231638_1573x876_scrot

I'm running the-way 0.15.0.

Ninjani commented 2 years ago

It requires an index so I would need to write a for loop to get all the snippets out. I'd prefer to be able to just dump all the snippets to stdout or to dump snippets to stdout filtered by tags, etc... from the CLI directly.

Ah oops I meant the-way list which has filtering options.

I tried the-way view 14 but my cursor gets stuck. When I press Ctrl+d it kills the whole terminal:

This shouldn't happen as it's just a print statement - could you file this as a separate issue?