Re: [fossil-users] Markdown in tickets

2018-06-27 Thread Martijn Coppoolse
On 26-6-2018 22:05, Richard Hipp wrote:
> On 6/26/18, Chad Perrin  wrote:
>> I see no Markdown formatting option for tickets when visiting the web UI
>> via `fossil serve`:
>
> Go to /Admin/Tickets and edit the scripts you find there to provide
> support for markdown.  As the scripts already provide support for
> text/plain, text/html, and text/x-fossil-wiki, it should be apparent
> how to enhance them with an extra case for text/markdown.

Rendering the markdown is not quite that easy: all the existing options
use the "wiki" command, supplied with various incantations of the
 tag. This doesn't appear to work for markdown.

Browsing the source code suggests there is a separate "markdown"
command, but that returns a list instead of actually rendering HTML,
like the wiki command does.

> Once you get this working, submit your changes for inclusion in the
> SQLite source tree.

After some spelunking in th_language.c, here’s what I got working to
render the markdown. Setting the proper mimetype and including it as an
option is left as an exercise for the reader.

(...)
 if {$mutype eq "Markdown"} {
   set md [string trimright $icomment]
   set md [markdown $md]
   set title [lindex $md 0]
   set body [lindex $md 1]
   html ""
   html $title
   html ""
   html $body
} elseif {$mutype eq "Wiki"} {
(...)

I’d never written TH1 (or Tcl) before, so it can probably be improved
upon — most notably skipping the  if the title is empty, which will
usually be the case in a ticket — but it seems to work OK.

-- 
Martijn Coppoolse
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Markdown in tickets

2018-06-26 Thread Richard Hipp
On 6/26/18, Chad Perrin  wrote:
>
> I am running Fossil v2.5 here:
>
> $ fossil version
> This is fossil version 2.5 [188a0e2904] 2018-02-07 18:48:14 UTC
>
> I see no Markdown formatting option for tickets when visiting the web UI
> via `fossil serve`:

Go to /Admin/Tickets and edit the scripts you find there to provide
support for markdown.  As the scripts already provide support for
text/plain, text/html, and text/x-fossil-wiki, it should be apparent
how to enhance them with an extra case for text/markdown.

Once you get this working, submit your changes for inclusion in the
SQLite source tree.
-- 
D. Richard Hipp
d...@sqlite.org
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Markdown in tickets

2018-06-26 Thread Chad Perrin
On Tue, Jun 26, 2018 at 12:05:51PM -0400, Richard Hipp wrote:
> On 6/26/18, Andy Goth  wrote:
> > Is there a reason why Fossil tickets don't allow markdown?  The format
> > options are wiki, HTML, plain text, and [links only].
> 
> Markdown as a formatting option can be added by configuration.
> 
> Perhaps you are asking for Markdown support to be added to the default
> configuration?

I am running Fossil v2.5 here:

$ fossil version  
This is fossil version 2.5 [188a0e2904] 2018-02-07 18:48:14 UTC

I see no Markdown formatting option for tickets when visiting the web UI
via `fossil serve`:

https://i.imgur.com/F3UL8kc.png

It only shows Wiki, HTML, Plain Text, and [links only].

-- 
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Markdown in tickets

2018-06-26 Thread Andy Goth

On 06/26/18 11:05, Richard Hipp wrote:

On 6/26/18, Andy Goth  wrote:

Is there a reason why Fossil tickets don't allow markdown?  The format
options are wiki, HTML, plain text, and [links only].


Markdown as a formatting option can be added by configuration.


I apologize, I was unclear.  When I was talking about Fossil tickets, I 
was referring specifically to Fossil's own tickets, rather than tickets 
in general.  Right now I can't use Markdown when writing a ticket (or 
comment thereto) against Fossil itself.



Perhaps you are asking for Markdown support to be added to the default
configuration?


I don't see a reason to disable it by default.

--
Andy Goth | 
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Markdown in tickets

2018-06-26 Thread Richard Hipp
On 6/26/18, Andy Goth  wrote:
> Is there a reason why Fossil tickets don't allow markdown?  The format
> options are wiki, HTML, plain text, and [links only].

Markdown as a formatting option can be added by configuration.

Perhaps you are asking for Markdown support to be added to the default
configuration?

-- 
D. Richard Hipp
d...@sqlite.org
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users