nvim-neorg / neorg

Modernity meets insane extensibility. The future of organizing your life in Neovim.
GNU General Public License v3.0
6.32k stars 209 forks source link

Feature request for better presentations #373

Open hamiecod opened 2 years ago

hamiecod commented 2 years ago

Issues

Feature description

Hey, I have been diving into Neorg and have been finding it pretty interesting. I like creating presentations using neovim and they are pretty minimalistic. Although the core.presenter module has a lot of cool features already, I think that a lot of things can be added to it.

We can take inspiration from presenting.vim to format the headings using figlet fonts and other things like text highlighting for different levels of headings. Also, syntax highlighting code be added in code blocks in Neorg 0.2 when snippet support would be added.

Better presentations might be a long-term goal of Neorg because it really needs some stepping stones like code evaluation and others which would make the presentations in Neorg look and feel good. Really excited about the great functionality that Neorg adds to Neovim. Would love to help in developing this ecosystem.

Help

Maybe

Implementation help

I would be able to help in implementing these features but I currently do not have much experience in dealing with the Neovim API and developing Lua plugins for Neovim although I have a little experience using Lua for my Neovim configuration.

max397574 commented 2 years ago

so, syntax highlighting code be added in code blocks in Neorg 0.2 when snippet support would be added.

That already exists

max397574 commented 2 years ago

do you have any specific suggestion what we should add @hamiecod ?

danymat commented 2 years ago

Linked PR: #376

hamiecod commented 2 years ago

do you have any specific suggestion what we should add @hamiecod ?

Some of the features that I currently have in my mind are:

Another idea that popped into my mind while writing this comment was to actually generate a web-based presentation using reveal.js or something else. But that kind of requires a big PR. If somebody wants to issue a PR for that, then the functionality of presenting inside of neovim is a matter of debate because I think that most of the people who use neovim have a GUI environment where they can run a browser. Maybe neorg could have both the functionalities of presenting inside of neovim and as well as in the browser. This idea was inspired by yjwen/org-reveal.

I know that some of the above features are substantial changes to core.presenter and fully respect you if you criticize any of the above stated feature requests. I'd write down any other ideas that I might get for core.presenter.

danymat commented 2 years ago

Hello, I'm the original creator of the idea of the presenter module, so I am very interested in this issue !

I can provide some feedback on those feature requests:

Formatted Headings: The headings should be figlet font formatted or should have a larger font size as compared to normal text. Different level headings should have different types of formatting.

We can for sure generate figlets for the different headings, but I don't have any idea about which filet to use. This would require an external integration, being a plugin or a cli app that generates those figlets. So I don't know about the usefulness of this. Futhermore, I think changing font size if not possible to do so for a tui application.

Images: Images should be supported in the presentation. hologram.nvim which utilizes the Kitty Graphics Protocol can be used. You can also maybe use ueberzug. Although, https://github.com/goolord/alpha-nvim/issues/15 had some problems while integrating the above-mentioned functionality into alpha-nvim.

This will require external integration too, and I haven't played around with these plugins. Note that this integration is dependent of your terminal. For instance, I'm in iTerm and I don't know if this could work in my terminal.

Graphs: Graphs and other models should be integrated into the presenter module. They should be generated using .norg text. Currently, I can think of one way this can be implemented. You can use the norg text to generate image graphs and then integrate them using the image integration functionality. Another way that this may be implemented is by hacking around some UI elements which would be kinda difficult and unstable. TBH a lot of stuff can be added in this feature which includes generating flowcharts, UML, math typesetting, etc from text, but if these things are added they must be a submodule of core.presenter, like core.presenter.uml. You can use some of the things used by iamcco/markdown-preview.nvim to generate images from text.

I think this kind of feature could be a neorg module per se, and not presenter one only.

I can imagine doing something like this:

@code mermaidjs
--- Mermaid code...
@end

That generates a mermaid chart. But this will have the same issue as stated above, which is: how to render graphics.

Another idea that popped into my mind while writing this comment was to actually generate a web-based presentation using reveal.js or something else. But that kind of requires a big PR. If somebody wants to issue a PR for that, then the functionality of presenting inside of neovim is a matter of debate because I think that most of the people who use neovim have a GUI environment where they can run a browser. Maybe neorg could have both the functionalities of presenting inside of neovim and as well as in the browser. This idea was inspired by yjwen/org-reveal.

This idea could be quite easy to do when the neorg pandoc parser is out (https://github.com/Simre1/neorg-haskell-parser). When this is released, we could in theory convert our norg file into a markdown file, or html one. We could then use the markdown generated file to display with reveal.js.

hamiecod commented 2 years ago

So I don't know about the usefulness of this.

Figlet formatted headings give a somewhat fancier look to the slides. They also emphasize the heading, a heading with a large font size would look better but as you said, we cannot have differently sized text in TUI applications. Also, if somebody wants to work on a PR for figlet formatted text, they can take some help from sotte/presenting.vim#26.

Note that this integration is dependent of your terminal.

Yeah, that is the sad part that not all terminals do no support the high-end terminal graphics protocols. Chafa can be used for rendering the graphics in any 256color terminal but the images rendered by chafa are not that high quality and do not provide a great experience.

domas-v commented 2 years ago

Images: Images should be supported in the presentation. hologram.nvim which utilizes the Kitty Graphics Protocol can be used. You can also maybe use ueberzug. Although, https://github.com/goolord/alpha-nvim/issues/15 had some problems while integrating the above-mentioned functionality into alpha-nvim.

This. I would love to see this. Thanks to maintainers for all the work by the way!