vriteio / vrite

Open-source developer content platform
https://vrite.io
Other
1.62k stars 64 forks source link

GitOps support? #64

Closed jcrben closed 7 months ago

jcrben commented 7 months ago

I really like this - especially the way the WYSIWG tables work! I haven't found anything that looks this powerful other than Confluence, and it looks like something which might replace how I use Confluence.

I'd like to persist using markdown, using a sort of GitOps approach.

One thing I noticed is that the export looks to be either Markdown or HTML. In the case of these advanced tables, will the markdown table work for the round-trip - will it be able to maintain the complexity of your WSYIWYG tables? Is it possible to export markdown but have the tables embedded as HTML inside the markdown? Once tables get complex and edited via WSYIWYG I've found that HTML is more worthwhile than markdown.

areknawo commented 7 months ago

I'm not sure I understand fully what you mean. That said, I think you're looking for some kind of sync with your Git repository in a special format, i.e. MD with HTML tables.

For that, there are no built-in options, but Vrite can support something like this. You can use bi-directional Git sync (currently only with a GitHub provider) with a custom, "remote" transformer.

Transformers are functions that can convert content between your custom and Vrite-compatible formats. There are 2 types of transformers:

The Markdown transformer is built-in and MDX (with support for frontmatter and block JSX elements) is provided via an extension. You can register custom remote transformers from the settings, providing remote functions/endpoints that can be used to transform the content.

There are no docs on this feature right now, but you can check out the MDX extension source file and (more importantly) related backend routes. Docs and better tooling for creating transformers are in the backlog, but currently, you can use something like unifiedjs for all sorts of content processing.

For MDX with HTML tables, just editing these existing transformer endpoints should be enough. Host them as cloud functions and add them as a custom transformer in the settings.

jcrben commented 7 months ago

Thanks for all the suggestions! I've used unifiedjs before and that provides a lot of good guidance. Feel free to close this.

areknawo commented 7 months ago

Sounds good. Will work on better docs and tooling for that. Feel free to open a new issue or discussion if you have any issues/questions/feature requests. Thanks!