From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason at zx2c4.com (Jason A. Donenfeld) Date: Wed, 27 Jun 2018 19:18:57 +0200 Subject: [PATCH v4 00/16] Render READMEs inline in tree view In-Reply-To: <152948941145.29466.10223016890282865269.stgit@mail.warmcat.com> References: <152885510454.7253.3542488576272033383.stgit@mail.warmcat.com> <152948941145.29466.10223016890282865269.stgit@mail.warmcat.com> Message-ID: Hey Andy, Thanks for this patchset. It looks like this is shaping up into a nice direction. However, I'm a bit concerned about our nobs becoming slightly overlapping and incoherent, and I think that with this series, we should also unify how we handle rendering. With the current state of this series, cgit would have the following options: - render. - inline-readme - render-filter - about-filter - commit-filter - source-filter - owner-filter - readme=file - readme=:file Whoa nelly. Of these, about-filter, commit-filter, source-filter, and owner-filter all have analogs in the repo.* namespace, which makes sense; it seems this was omitted from the render-filter introduced by this series. The thing that unifies about-filter, commit-filter, source-filter, and owner-filter is that they all modify some aspect of the rendered output, either via fork/exec or via lua. In adding readme files under the tree view, the obvious observation is that this is pretty much the same type of rendering that we're doing in about-filter. In adding rendering of arbitrary files in blob view, this is essentially a fancy source view, with the one caveat of our interesting handling of line numbers. So, I'd propose the following re-organization (and after we nail it down, we can bikeshed about compatibility with old configs, but for now let's focus on ideal design): - We retain commit-filter, source-filter, and owner-filter as we have them now. - We rename about-filter to readme-filter. - We remove `readme` and instead introduce `readme-filename`, which can be specified multiple times as is habit. This would simply take the set of filenames considered to be readme files (readme.md, readme.txt, etc). [Bikeshed discussion: case insensitive?] - We introduce an options at the global level and at the .repo level of `about-readme=/path/to/absolute/file` and `about-readme=:` and `about-readme=:`. The first would replace our original usage of `readme=/path/to=file`, and the second would replace the use of `readme=branch:whatever`, specifying an explicit branch (like cgit.git's wiki branch), and the third would indicate the default branch. - We introduce an option at the global level and at the .repo level of `tree-readme=1/0` to display (or not) the readme under each tree. - We do not introduce render-filter. We do not introduce render.; such extension selection is successfully handled by the various filters themselves already. John, Christian -- what are your thoughts on this? Regards, Jason