Rene,

Thanks, I think I might take a look at your last suggestion. Not because I
like doing things the hard way (far from it) but then I don't have to manage
my own Fossil code --- I don't like doing that!

I guess I was also just curious why the line number facility is half
included (i.e., it will highlight if placed in the url, but no facility
exists to put append the correct url parameters).

off course this would require fossil to have a javascript function
> highlightline which is unacceptable
>

I'm new here, so forgive my ignorance: is this a decision to not include any
javascript period? I understand the decision (HTML + CSS is simple, works on
all browsers), but just wanted a clarification.

If HTML + CSS is ok, would there be much opposition if I were to
(eventually) go through and add some classes to every html output I could
find? What I'm shooting towards is something like WordPress, which puts a
class for every imaginable parameter in the source code. For example, these
are the classes for one of my blog posts:

"hentry post publish post-1 odd author-tkott category-tutorials
post_tag-bugs post_tag-dvcs post_tag-fossil-2 post_tag-fossil-scm
post_tag-git post_tag-svn post_tag-tickets post_tag-wiki"

Not that there would be that many classes for a fossil archive, but
especially for the html we can't change (i.e., not the main menu) it would
be nice to have more descriptors (say timeline, tickets, etc.).

Anyways, sounds like nobody's done this, so I'll poke around. If I come up
with a solution which changes fossil code to say, display a table, with a
row having a column for the line number, and a column for the line of code,
what is the best way of submitting the changes?

Thanks,

Tomek

On Tue, May 3, 2011 at 4:31 AM, Rene <[email protected]> wrote:

>  On Mon, 2 May 2011 13:42:46 -0400, Tomek Kott wrote:
> > Hi folks,
> >
> > It seems that there is a capability to put in line numbers in file
> > view (using "&ln" as part of the query string), and have them be
> > highlighted if specified in the url params ("&ln=10") or even a range
> > (&ln=10-11). (see src/info.c [1])
> >
> > Additionally, there [2] are [3] various [4] libraries [5] that can
> > highlight code, and there is even a helpful tutorial  [6]on the
> > fossil
> > wiki to get those working. Great!
> >
> > I want to put those two together so that if you click on the line
> > number, you automatically highlight that line, either using the
> > imported library or fossil. Has anyone attempted or succeeded at
> > this?
> >
> > Tomek
> >
> >
> > Links:
> > ------
> > [1]
> >
> >
> http://fossil-scm.org/index.html/artifact?name=acda9c4b5b73eecddd8b14607f9d0a58d3793c68
> > [2] http://code.google.com/p/google-code-prettify/
> > [3] http://softwaremaniacs.org/soft/highlight/en/
> > [4] http://balupton.com/sandbox/jquery-syntaxhighlighter/demo/
> > [5] http://alexgorbatchev.com/SyntaxHighlighter/
> > [6]
> >
> >
> http://www.fossil-scm.org/fossil/info/bde8ce985d52d3d76efafa37d8670a32fe16f79c#source-hilight
>  most simple is to adjust src/info.c to generate
>  <pre tittle='win/version.c' alt='c' class='fossilcat'>
>      <span class='line' onclick='highlightline(this)'>1  /*</span>
>      <span class='line' onclick='highlightline(this)'>2 ** This C
>  program exists to do the job that AWK would do for the unix</span>
>
>  </pre>
>
>
>  Ttitle would help you to identify the file (but could be inferred by
>  get the contents of <a
>  href="/index.html/finfo?name=win/version.c">win/version.c</a>)
>  Alt would hint a the type of file (but could be inferred by get the
>  contents of <a
>  href="/index.html/finfo?name=win/version.c">win/version.c</a>)
>  class fossilcat to do CSS styling
>
>  off course this would require fossil to have a javascript function
>  highlightline which is unacceptable
>
>  but if this was changed to
>                     <span class='line'>1  /*</span>
>  you could do some dom magic and add the function to every span.line
>  element when the page loads.
>
>
>  if on page artiface then
>  for every span in blockquote.pre.span do
>    span.onclick=highlight(this)
>
>
>  However you could go the hard way :-)
>  if page is artifact
>   var el = document.getElementsByTagName('pre')
>   s = el.innerHTML
>   n = ''
>   for every line in s do
>     n += '<span onclick="highlight(this)" >'+line+'</span>'
>
>   el.innerHTML = n
> --
>  Rene
> _______________________________________________
> fossil-users mailing list
> [email protected]
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to