Giter Club home page Giter Club logo

Comments (21)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
How do you want it formatted? In Html with classes or styles?
I'll have a go at this if there isn't a solution already there.

Original comment by [email protected] on 15 Oct 2008 at 12:54

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
A possible route to a solution:
http://jscc.jmksf.com (LALR(1)) javascript parser generator
http://savage.net.au/SQL/ BNF grammers for sql

The grammar instructions could either return html code or build a dom document
fragment...

Original comment by [email protected] on 15 Oct 2008 at 1:04

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
this approach would be slow and large, but correct (if it al works)

Original comment by [email protected] on 15 Oct 2008 at 1:10

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
I like the idea of implementing this properly rather than as a quick fix but as 
you
mentioned it could become quite the undertaking.

The result should ideally integrate with domplate but that may be very 
complicated to
accomplish right off the bat. The best approach may be to generate a tree 
containing
the different elements and hints to indicate the type of each element.

We can then write a renderer that uses the tree to generate a HTML 
representation
directly or one that integrates with domplate.

Before you start on this it may be worth while to do a bit more research to 
ensure
there is not something already out there or more suitable as a base. Maybe we 
could
use a code editor/colorer as the base instead
(http://marijn.haverbeke.nl/codemirror/)? I am looking for a PHP code 
viewer/editor
as well and I have been looking at codemirror to accomplish this.

Original comment by [email protected] on 15 Oct 2008 at 8:06

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
I agree, we'll need to investigate whether codemirror can be "stripped" down 
easiliy.
Disadvantage of Codemirror is that it's parsers are hand written. It is however 
a
very active project and I think Marijn will be able to help out (I'm also 
Dutch).
I'll ask him to respond to this issue.

Original comment by [email protected] on 15 Oct 2008 at 10:58

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Yes. I like that the project seems active. Maybe you could ask him about his 
future
plans and commitment to codemirror.

My plans are to make FirePHP and more importantly the overall concept of 
debugging
AJAX and server apps this way a household name so I am looking to incorporate 
code
that will stay maintained.

Original comment by [email protected] on 15 Oct 2008 at 11:08

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Addinitional features requested by co-workers (they are to lazy to reply 
themselves):
SQL: folding of clauses
But you probably already had that in mind
Folding might also be useful for PHP code.

I'd say creating a SQL parser shouldn't be to difficult given the existing 
SPARQL parser.

Original comment by [email protected] on 15 Oct 2008 at 11:12

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Hi. I'm the author of CodeMirror. If you just want something to *display* 
highlighted
code, it's bound to be easier to just write something from scratch. A lot of
CodeMirror's complexity is related to the fact that it's an editor, and has to 
do the
parsing incrementally while the text is being edited. As for commitment, I'm not
planning to stop fixing bugs anytime soon, but since this is all unpaid, I 
can't make
any guarantees -- I don't always have a lot of time.

Original comment by [email protected] on 16 Oct 2008 at 8:08

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Displaying the highlighted SQL would be the first step but I see a few other 
features
over time:

1) Have the renderer automatically format and indent an SQL query for easier 
reading.
Would be great if the user could setup a "profile" on how to indent the query 
and
have the renderer follow that profile for all subsequent queries.

2) Ability to render partial and invalid queries to allow easier debugging and 
fixing
of queries

3) Ability to edit queries in FirePHP and save modifications back to server code

I am planning on making FirePHP two-way allowing you to edit your server code in
FirePHP and saving it back to the server. So the above requirements also apply 
to
PHP, CSS, HTML, XML, JSON, etc... code. I would be looking for an editor that 
can
accomplish highlighting and editing of all these languages.

Do you think CodeMirror could accomplish this?

Original comment by [email protected] on 16 Oct 2008 at 7:04

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
@christoph:
Did you check out
http://codepress.sourceforge.net/
yet?

Codepress allready has PHP and SQL implemented according to
http://en.wikipedia.org/wiki/Comparison_of_Javascript-based_source_code_editors

No offence Marijn!

Original comment by [email protected] on 16 Oct 2008 at 8:18

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Yes I had some time ago, but there has been very little development activity 
for a
while so I am not too sure about the state of the project.

Thanks for the link to the matrix!

What do you think of EditArea?

Original comment by [email protected] on 16 Oct 2008 at 8:51

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Anyone interested in starting a project to port GeSHi 
(http://qbnz.com/highlighter/)
to JavaScript and adding an editor component?

Original comment by [email protected] on 17 Oct 2008 at 12:48

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
[deleted comment]

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
[deleted comment]

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
[deleted comment]

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Google code itself (you know, this site) uses a JavaScript called prettify.

http://code.google.com/p/google-code-prettify/

Includes SQL per the FAQ.

Original comment by sroussey on 28 Apr 2009 at 12:20

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
I don't think this lib meets the necessary requirements. We need something that
breaks the SQL into its parts and colors each part appropriately with the 
ability to
format it as well.

Original comment by [email protected] on 28 Apr 2009 at 3:44

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
What about http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes:SQL instead 
of GeSHi

Original comment by [email protected] on 12 May 2009 at 9:42

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Looks like a better fit. No formatting but that could be added later if really
necessary. I wonder how this lib works with complex SQL queries.

Original comment by [email protected] on 13 May 2009 at 1:01

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Here you can see a sample of the highlighter:
http://www.sawey.be/sql-highlight/

Original comment by [email protected] on 14 May 2009 at 8:17

from firephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Looks like it can handle most of the syntax. Function highlighting does not 
seem to
work in all cases.

Looking at the formatting and highlighting it should be possible to add
auto-formatting support if all the nested brackets are properly parsed as well.

Original comment by [email protected] on 14 May 2009 at 8:49

from firephp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.