Discussion:
[tug-summer-of-code] Project idea: Hyperlinked syntax highlighting for TeX code
Jonathan Fine
2009-02-16 07:20:32 UTC
Permalink
Hi

Here's a suggestion:

It now common, when listing code on a web page, to provide syntax
highlighting. Indeed, this is done on Google code.

This project is to provide syntax highlighting for TeX code - both
documents and macros - with an extra feature. Each highlighted command
is also hyperlink which offers tooltip help, and which when clicked
brings up further documentation.

Two of the leading syntax highlighters are

http://pygments.org/ (Python)
http://noteslog.com/category/chili/ (JavaScript, based on jQuery)

This project has three parts. The first is providing enhanced syntax
highlighting for TeX code. The second is creating a commands database.
The third is linking together the first and second parts.

Depending on difficulties encountered this project might be too large.
If so, we'd expect the student to do just a part of it.
--
Jonathan
Arthur Reutenauer
2009-02-16 07:42:29 UTC
Permalink
Thank you, Jonathan, for this proposal. I take it you would be the
mentor?

Arthur
Jonathan Fine
2009-02-16 15:12:25 UTC
Permalink
Post by Arthur Reutenauer
Thank you, Jonathan, for this proposal. I take it you would be the
mentor?
Thank you, Arthur, for asking.

I think it's worth doing, and I feel qualified to act as mentor. I
don't yet know how much time I'll have.

So my answer is a provisional yes.
--
Jonathan
Will Robertson
2009-02-16 08:02:46 UTC
Permalink
Post by Jonathan Fine
This project has three parts. The first is providing enhanced
syntax highlighting for TeX code. The second is creating a commands
database. The third is linking together the first and second parts.
The highlighting part is easy enough, right? All editors can do that
capably enough (although understanding keyval lists would be novel).
And the commands database should be straightforward albeit tedious.

The value in this sort of system for me would be to provide the
information in such a way that interactive editors could use it as
well as pretty-printing engines. Having auto-complete and spell check
while writing documents/package would be quite the value proposition.

With a system in place to support these ideas, formats such as LaTeX3
could provide features to aid integrating the syntax of new packages
into whatever this system is. (Such as producing a listing for CTAN of
all macros defined in a package.)

Ideas such being able to understand package and class options in LaTeX
would fit into this concept, as well. Even a short description (taken
from the CTAN catalogue) of what each package/class is.

* * *

So clearly there's scope for this sort of project; the utility of it
hinges fairly drastically around being able to be actually used
somewhere -- and where better than the TeXworks editor?

If there is more than one student interested, it would be possible to
get one working on the hyperlinked pretty-printing engine, and another
working on incorporating it into TeXworks.

Hmmm. Interesting stuff.

Will
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2415 bytes
Desc: not available
Url : http://tug.org/pipermail/summer-of-code/attachments/20090216/d6b3f2cc/attachment.bin
Jonathan Fine
2009-02-16 09:31:50 UTC
Permalink
Post by Will Robertson
Post by Jonathan Fine
This project has three parts. The first is providing enhanced syntax
highlighting for TeX code. The second is creating a commands
database. The third is linking together the first and second parts.
The highlighting part is easy enough, right? All editors can do that
capably enough (although understanding keyval lists would be novel). And
the commands database should be straightforward albeit tedious.
The problem with editors is that there are so many of them. This is why
I suggest enhancing Pygments and Chili. Once all is in place, the
system can then be ported from web pages to Emacs, WinEdt, TeXShop,
TeXWorks, Eclipse. Oh, and editing in a web-page form.

The commands database could be interesting. For example, it could
provide example of use of a command. Maybe with user contributed code,
such as http://www.djangosnippets.org/ (whose source - less styles - is
open source and documented in the "Practical Django" book).
Post by Will Robertson
The value in this sort of system for me would be to provide the
information in such a way that interactive editors could use it as well
as pretty-printing engines. Having auto-complete and spell check while
writing documents/package would be quite the value proposition.
I agree, but this will be a student summer project, starting from close
to scratch.
Post by Will Robertson
With a system in place to support these ideas, formats such as LaTeX3
could provide features to aid integrating the syntax of new packages
into whatever this system is. (Such as producing a listing for CTAN of
all macros defined in a package.)
Yes. If each package listed the command it provided etc. As I
understand it, ConTeXt has something similar.
Post by Will Robertson
Ideas such being able to understand package and class options in LaTeX
would fit into this concept, as well. Even a short description (taken
from the CTAN catalogue) of what each package/class is.
* * *
So clearly there's scope for this sort of project; the utility of it
hinges fairly drastically around being able to be actually used
somewhere -- and where better than the TeXworks editor?
I suggest that if the student is well-placed to integrate what's done
with an editor, that should be an optional end-of-project activity. But
I'd like to focus first on web-page delivery that is accessible to all.

But I'd like the project to focus on the core items I listed. There are
already enough large projects in progress. I'd favour small simple
useful projects that succeed.
Post by Will Robertson
If there is more than one student interested, it would be possible to
get one working on the hyperlinked pretty-printing engine, and another
working on incorporating it into TeXworks.
I think the proposal I've written is nicely self-contained. Maybe you'd
like to write another proposal, Will, covering some of your ideas.
--
Jonathan
Arthur Reutenauer
2009-02-16 18:19:01 UTC
Permalink
Post by Will Robertson
With a system in place to support these ideas, formats such as LaTeX3
could provide features to aid integrating the syntax of new packages into
whatever this system is. (Such as producing a listing for CTAN of all
macros defined in a package.)
Yes. If each package listed the command it provided etc. As I understand
it, ConTeXt has something similar.
Yes, the cont-en.xml database (and equivalent files for other
natural languages) that is used in the texshow application available on
contextgarden.net. It is also used in the text editor TextMate
(available, alas, only on the Mac) for automatic completion and command
option suggestion. Maybe Mojca can comment on it.
Post by Will Robertson
If there is more than one student interested, it would be possible to get
one working on the hyperlinked pretty-printing engine, and another working
on incorporating it into TeXworks.
I think the proposal I've written is nicely self-contained. Maybe you'd
like to write another proposal, Will, covering some of your ideas.
As Will, I'd also be happy to see some connection with actual text
editors (especially TeXworks, obviously), but it's your project, of
course. Can you write up a slightly more formal proposal, or do you
want me to copy the text of your original e-mail? I'll mark you as the
mentor for the moment. If you feel you won't have time to supervise it
after all, we'll just retire the project.

Arthur
Jonathan Fine
2009-02-16 22:13:05 UTC
Permalink
Post by Arthur Reutenauer
As Will, I'd also be happy to see some connection with actual text
editors (especially TeXworks, obviously), but it's your project, of
course. Can you write up a slightly more formal proposal, or do you
want me to copy the text of your original e-mail? I'll mark you as the
mentor for the moment. If you feel you won't have time to supervise it
after all, we'll just retire the project.
Hello Arthur

I'd like to see a linkup to an editor, but fear that it will make the
project too long, and would require a wider range of skills. So I won't
put it in the proposal, but would be please to see it as an outcome
(sooner or later).

Please use the text from the email, which for your convenience I repeat
here.
===
It now common, when listing code on a web page, to provide syntax
highlighting. Indeed, this is done on Google code.

This project is to provide syntax highlighting for TeX code - both
documents and macros - with an extra feature. Each highlighted command
is also hyperlink which offers tooltip help, and which when clicked
brings up further documentation.

Two of the leading syntax highlighters are

http://pygments.org/ (Python)
http://noteslog.com/category/chili/ (JavaScript, based on jQuery)

This project has three parts. The first is providing enhanced syntax
highlighting for TeX code. The second is creating a commands database.
The third is linking together the first and second parts.

Depending on difficulties encountered this project might be too large.
If so, we'd expect the student to do just a part of it.
===
Jonathan
Arthur Reutenauer
2009-02-17 17:38:42 UTC
Permalink
Post by Jonathan Fine
Please use the text from the email, which for your convenience I repeat
here.
I installed it on the page. http://tug.org/gsoc/

Arthur

Loading...