gingko / client

Gingko Writer. Tree-based writing software, written in Elm.
https://gingkowriter.com
MIT License
361 stars 49 forks source link

Configurable export #108

Open vladdu opened 6 years ago

vladdu commented 6 years ago

It would be nice if as an user I could define a template to use to export the tree as. For example:

A template could have some simple markup to indicate where the node's content is inserted, together with some logical conditions to associate a certain chunk with a category of nodes. This would need more thought, of course.

If I knew Elm, I could help. Maybe I will learn it, but I have a long list of things to do....

AdrianoFerrari commented 6 years ago

Thanks for the input, Vlad!

For when I get to adding more export options (like this and others), it'd be helpful to have concrete examples of what you'd want to be able to do. Exporting as structured to enable expand/collapse is one concrete example.

Could you clarify "together with some logical conditions to associate a certain chunk with a category of nodes"?

vladdu commented 6 years ago

The simple way to define a structured html is to associate "

{{content}}
" to each node, where {{content}} is replaced by the actual content followed by the children, using the same pattern for each node.

For a more complex example, one might want

for first level,
for the second and
for the rest. Then there has to be some way to declare what to use where.

Another example is to output it in a format suitable for online slideshow presentations (different tools have slightly different formats). I think this would be a good selling point for Gingko.

I only have a fuzzy idea about this, and I was aware that it won't be a high priority (which is ok for me), so I wanted to make a note and when you get to it (or when I learn Elm), we can discuss further.

Of course, it would be completely acceptable to have a few hardcoded variants, and let people reformat them manually. Maybe they will require more flexibility, maybe they won't. This is much easier to implement.

AdrianoFerrari commented 6 years ago

Thanks for adding more details.

Have you had a look at the way the online version works for this? There's an "Advanced" section that allows you to specify what to prepend and append to each child: screenshot_2018-08-15_17-52-18

Something similar, but also having the option to render each card nested into its parents (instead of in a list), might be enough flexibility to start with.

Will give it more thought, but feel free to add more examples and concrete use cases.

(PS: Slide show is an option already on online, using "Presentation (impress.js)"...)

vladdu commented 6 years ago

I haven't noticed the advanced settings there. That would be good enough - but even nicer to be able to save different settings, so that the user doesn't have to copy and paste them every time there is a change. I think even my more advanced examples can be handled by adding a marker in the provided snippets where the depth level of the card can be inserted (for example class="{{depth}}"), then the right CSS can do whatever needed.

Also, it might be useful to add some HTML before and after everything.

SquidLord commented 6 years ago

And while we are on this particular usage case (varying exports), it would be good to have all of the online versions' export options plus "export only the leaf nodes," for those times when you're doing something like the snowflake development format and all of the things higher in the hierarchy don't need to be in the document. Only the things down at the end of the branches need to be in the document.

It would need to be a toggle/switch, since you would probably want to combine that with either "whole tree" or "current card and sub cards", but I have definitely been in situations where that would be the tool to have.

MajorMajorMajorMajor commented 5 years ago

For me, the most important part would be to allow export in a nested fashion, i.e. all cards from Column 1 are unindented, cards from Column 2 are indented once, cards from Column 3 indented twice, etc.