Re: [fossil-users] source viewing code

2013-03-22 Thread Martijn Coppoolse

On 21-3-2013 19:48, Stephan Beal wrote:

On Thu, Mar 21, 2013 at 7:18 PM, C. Thomas Stover wrote:

i know that some users are using JavaScript to do diff highlighting,
and don't see why the same couldn't be done for source code highlighting.


There’s a description of how to implement client-side source code 
highlighting via the skin on the Cookbook page:

http://www.fossil-scm.org/fossil/wiki?name=Cookbook#source-hilight

It works really well; I’m using it in (almost) all my repositories 
(after tweaking the JS code a bit for optimization).


One disadvantage is that you have to either include Alex’s syntax 
highlighter in your repository, or refer to the online version (which 
means you don’t get syntax highlighting when offline).


Another is that you have to re-incorporate it every time you change skins.


(Lastly as a side note, my apologies if this reply comes in crazy. (...)

Seems perfectly normal to me - no craziness is evident.


Same here.
--
Martijn Coppoolse

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


[fossil-users] source viewing code

2013-03-21 Thread C. Thomas Stover
I wanted to take a look at the code that renders files for the web
interface. Can anyone point me in the right direction? Is it using the
vfile stuff to put a temp file on disk and then going with the browse
code, or is there something that prints out a blob somewhere?

Ultimately, I wanted to see how feasible it would be to use some server
side code for syntax highlighting.

-- 
C. Thomas Stover
www.thomasstover.com


___
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] source viewing code

2013-03-21 Thread Stephan Beal
On Thu, Mar 21, 2013 at 5:40 PM, C. Thomas Stover c...@thomasstover.comwrote:

 I wanted to take a look at the code that renders files for the web
 interface. Can anyone point me in the right direction?


The easiest way to found that sort of thing in fossil is to look at the URL
you are wanting to explore, e.g. /timeline and then run, from the command
line, something like:

stephan@tiny:~/cvs/fossil/fossil/src$ grep 'WEBPAGE: timeline' *.c
rss.c:** WEBPAGE: timeline.rss
timeline.c:** WEBPAGE: timeline

the list of pages is built at compile-time from those WEBPAGE (and COMMAND)
markers, so if you know the page/command you are looking for, it's
relatively easy to find the corresponding code. The markers are always in
comments immediately proceeding the implementations



 Is it using the
 vfile stuff to put a temp file on disk and then going with the browse
 code, or is there something that prints out a blob somewhere?


Fossil never writes temporary files to disk except for sqlite3 temporary
journal files for the db. It also (almost) never serves content from
outside the repository database (with one exception that i know of, using
/doc/ckout/...). In the case of a raw file it will output it from its blob
entry in the db (possibly post-processed, e.g. in the annotate page).


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
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] source viewing code

2013-03-21 Thread C. Thomas Stover
On Thu, 21 Mar 2013 17:49:38 +0100, Stephan Beal wrote:

 The easiest way to found that sort of thing in fossil is to look at the
 URL you are wanting to explore, e.g. /timeline and then run, from the
 command line, something like:
 
 stephan@tiny:~/cvs/fossil/fossil/src$ grep 'WEBPAGE: timeline' *.c

great. that works well. I also never thought of that use case for grep.

Next any tips for adding new themeable fields in the style sheet logic? 
For instance, the thing I'm working on references css stuff like:
.c_keyword { color: red; }

I'll report back soon with hopefully something worth showing. I'm working 
on a home grown document generation tool, which lead me to a syntax 
highlighting facility. I wanted to make sure I didn't forget to have some 
possibility of using that one piece from inside fossil. The larger 
project is a ways off, but that portion of it is nearly presentable.

(Lastly as a side note, my apologies if this reply comes in crazy. I have 
set all my mailman mailing list that I'm a subscriber of to vacation 
mode, and have been using Pan (a gtk newsreader) with gmane exclusively 
for days. This is my first test replying to a thread from the newsreader 
side.)

-- 
C. Thomas Stover
www.thomasstover.com



___
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] source viewing code

2013-03-21 Thread Stephan Beal
On Thu, Mar 21, 2013 at 7:18 PM, C. Thomas Stover c...@thomasstover.comwrote:

 Next any tips for adding new themeable fields in the style sheet logic?
 For instance, the thing I'm working on references css stuff like:
 .c_keyword { color: red; }


i can unfortunately offer little useful advice as far as
visual-design-related issues go - all of my websites are dog ugly ;).


 I'll report back soon with hopefully something worth showing. I'm working
 on a home grown document generation tool, which lead me to a syntax
 highlighting facility. I wanted to make sure I didn't forget to have some
 possibility of using that one piece from inside fossil. The larger
 project is a ways off, but that portion of it is nearly presentable.


IIRC a couple people on this list have tried similar things with it, but i
cannot say whether they ended up liking or disliking it - maybe one or two
of them will offer notes on their experiences. i know that some users are
using JavaScript to do diff highlighting, and don't see why the same
couldn't be done for source code highlighting.


 (Lastly as a side note, my apologies if this reply comes in crazy. I have
 set all my mailman mailing list that I'm a subscriber of to vacation
 mode, and have been using Pan (a gtk newsreader) with gmane exclusively
 for days. This is my first test replying to a thread from the newsreader
 side.)


Seems perfectly normal to me - no craziness is evident.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users