List for cgit developers and users
 help / color / mirror / Atom feed
* Render markdown files in tree view
@ 2016-12-08 15:06 lukasz
  2016-12-08 20:18 ` john
  0 siblings, 1 reply; 4+ messages in thread
From: lukasz @ 2016-12-08 15:06 UTC (permalink / raw)


Hey there,

First of all, thanks for all the great work on cgit. Awesome stuff!

In my setup, I like to have the markdown files in the repos rendered as
HTML instead of having them highlighted as code. Turns out it's fairly
easy to achieve using filters. I attach the necessary patches. Feel free
to commit if you think they are generally useful.

Cheers,
   Lukasz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ui-tree-don-t-assume-that-a-source-filter-must-rende.patch
Type: text/x-patch
Size: 1109 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20161208/195f668b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ui-tree-pass-full-file-path-to-source-filters.patch
Type: text/x-patch
Size: 2405 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20161208/195f668b/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-filters-add-source-filter-highlighting-code-and-rend.patch
Type: text/x-patch
Size: 5365 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20161208/195f668b/attachment-0002.bin>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Render markdown files in tree view
  2016-12-08 15:06 Render markdown files in tree view lukasz
@ 2016-12-08 20:18 ` john
  2016-12-08 22:53   ` lukasz
  0 siblings, 1 reply; 4+ messages in thread
From: john @ 2016-12-08 20:18 UTC (permalink / raw)


On Thu, Dec 08, 2016 at 04:06:01PM +0100, Lukasz Janyst wrote:
> First of all, thanks for all the great work on cgit. Awesome stuff!
> 
> In my setup, I like to have the markdown files in the repos rendered as
> HTML instead of having them highlighted as code. Turns out it's fairly
> easy to achieve using filters. I attach the necessary patches. Feel free
> to commit if you think they are generally useful.

In relation to the first patch specifically, I posted a more
comprehensive series a couple of months ago following a request on the
list, the thread starts here:

	https://lists.zx2c4.com/pipermail/cgit/2016-September/003289.html

Does that series work for your use case?  I think your patch will break
rendering for genuine source code and that remains a key use case for
CGit.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Render markdown files in tree view
  2016-12-08 20:18 ` john
@ 2016-12-08 22:53   ` lukasz
  0 siblings, 0 replies; 4+ messages in thread
From: lukasz @ 2016-12-08 22:53 UTC (permalink / raw)


On Thu, Dec 8, 2016, at 21:18, John Keeping wrote:
> On Thu, Dec 08, 2016 at 04:06:01PM +0100, Lukasz Janyst wrote:
> In relation to the first patch specifically, I posted a more
> comprehensive series a couple of months ago following a request on the
> list, the thread starts here:
> 
> 	https://lists.zx2c4.com/pipermail/cgit/2016-September/003289.html
> 
> Does that series work for your use case?  I think your patch will break
> rendering for genuine source code and that remains a key use case for
> CGit.

I checked the default syntax-highlighting.py and it still works fine
with my patches because it inserts all the tags it needs. The ones that
I removed were redundant. I did not check the other highlighter.

I have skimmed through your patches. I think it would work for my use
case. I especially like the idea of applying filters to binary blobs.
However, it seems to be pretty complicated. I can handle most of the use
cases I can think of with regular source filters provided that the two
patches to the C code are applied and I would be able to handle all of
them if I could apply source filters to binary blobs.

   Lukasz


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Render markdown files in tree view
@ 2016-12-14 13:39 andy
  0 siblings, 0 replies; 4+ messages in thread
From: andy @ 2016-12-14 13:39 UTC (permalink / raw)


Hi -

Thanks to John and Lukasz on the tree view rendering patches.  I joined
the list just now to ask about it and saw the recent posts.

After screenscraping and updating a little John's patches against HEAD:
they seem to work OK for me.  That's no ding on Lukasz's patches, I
don't know enough about cgit internals to make an informed choice, I
just picked John's on the basis they had been around longer.

I basically had to append:

render.md=/usr/lib/cgit/filters/about-formatting.sh

to the config and I could see rendered .md in tree view.

So I wanted to relate my experience and gently encourage the maintainer
to include some implementation of this valuable feature.  It basically
allows nice generic documentation and "git based wiki" without any
special support over just having cgit anyway.  "Culturally" in-tree
markdown docs have become a thing thanks to github, this is a small
additional feature but it goes quite a long way with enabling that for
sites using cgit.

-Andy


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-14 13:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-08 15:06 Render markdown files in tree view lukasz
2016-12-08 20:18 ` john
2016-12-08 22:53   ` lukasz
2016-12-14 13:39 andy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).