nedbat / dinghy

A GitHub activity digest tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Alternative output formats

rpdelaney opened this issue · comments

Could dinghy be configured to output in different formats than HTML? Like plain text, json, or markdown etc.

Related #31

I like this idea, and (other than the "public API" question from #31), might not be hard to implement. As it is now, you can get some JSON data dumped out (for debugging): set DINGHY_SAVE_RESULT=1 in your environment, and run dinghy. You will have .json files, one for each of the .html files that is produced.

Take a peek, and let me know if that would be a useful form to make real.

I've just made a change on main to prefix all of the dinghy keys in the data to make it easier to distinguish between the data direct from GraphQL and the data computed or rearranged by dinghy: f9feac9.

Nice! Yeah, this is good. Having a jinja template for markdown and plain text would still be handy though -- I'm working on alternative publishing solutions since we have a lot of private repos.

Just to be clear, I'm not recommending using this debugging output for real, it's just a way to talk about the internals.

I'm curious though: why do private repos require alternative publishing solutions? Dinghy just makes HTML files, it's up to you how to publish them.

I just don't want to engineer a separate access control solution.

I must be missing something about how you are using Dinghy. All it does is write an HTML file. It has no say over who can see it, that depends entirely on where you put the file.

(from a separate conversation:) The issue is that HTML is not served well from GitHub repos. To piggy-back on the access controls of repos, a more readily rendered format like Markdown or ReStructured Text would be more useful.

In commit b4e750a, you can specify a template setting to choose your own Jinja2 template. I haven't made a new release yet; let me know if you try it.

Custom templates is now released as part of dinghy 1.1.0. Let me know if there's anything else needed.

Sweet! I haven't had a chance to try it yet, but I'll let you know if I have problems :) Thanks!