On Wed, Jun 27, 2018 at 11:31:57PM -0500, Lester L. Martin II wrote:
> This patch changes the way `void artifact_page(void)` renders a files 
> content.  Formerly a `<blockquote><pre>` was issued for content,
> whereas now a `<blockquote><pre><code class=$ext>` is issued where
> $ext is the file's extension (example, "blah.lua" extension would be
> "lua").
> 
> This allows for proper integration with syntax highlighting systems
> such as "highlight.js" and "prism.js" where only the former was
> tested. This allows syntax highlighting without having to have
> language detection.

It's pretty cool you did this.  I'm going to look over this and the
syntax highlighting tools that might work with it to see if I want to
start using it, though I guess I'd have to compile my own Fossil if I
wanted to do it sooner rather than later.  Thanks for the work.


> 
> Remaining work likely includes changing the CSS of all themes to take
> this into account. Other things that might be considered is to
> conditionally remove the `<blockquote>` part from all but the content
> rendering. Another part would be rendering syntax highlights with line
> numbers (currently unimplemented).

Have you checked it against any themese to see if it affects them at
all?  If so, which themes did you find weren't problematic?  I'm
guessing that if you found some that were you'd mention it.


> 
> Below is the output of 'fossil diff' ran against checkout
> '6a7d2ad8f1dd5c542eba0b885418328803d8d802' with my changes:
> 
> Index: src/info.c
> ==================================================================
> --- /home/masky/misc/fossil/src/info.c~0      2018-06-27 23:21:48.520779000 
> -0500
> +++ /home/masky/misc/fossil/src/info.c        2018-06-27 16:48:28.683256000 
> -0500
> @@ -670 +670 @@
> -
> +
> @@ -2157 +2157,2 @@
> -        const char *z;
> +        const char *z, *ext, *name;
> +        char *tmp;
> @@ -2158,0 +2160,3 @@
> +        name = blob_str(&downloadName);
> +
> +        ext = (tmp = strrchr(name, '.')) == NULL ? "" : tmp+1;
> @@ -2162 +2166 @@
> -          @ <pre>
> +          @ <pre><code class="%h(ext)">
> @@ -2164 +2168 @@
> -          @ </pre>
> +          @ </code></pre>
> @@ -2232 +2236 @@
> -      ? db_text("(No title)",
> +      ? db_text("(No title)",
> 
> !!END!!
> 
> I'm unsure why "@@ -2232 +2236 @@" section got included as no changes 
> were
> made to that.

I haven't looked at the code in context; I've only seen the patch you
inlined in the email so far.  It looks sane to me, though.  I might come
back and look at it again in the morning, and check it against the
Fossil source code for context.


> 
> I would like to submit a contributor agreement to make it official. This
> change is so small that my previous post to the list serv considered,
> one could have implemented it in less time than it would take for a
> contributor agreement to finally be filed but as there was no reply
> I didn't wait upon such.

Even if they want the contributor agreement on file before incorporating
it, I'm glad you sent it to the list for people who might want to start
using it sooner than the next Fossil release.

-- 
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

Reply via email to