qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.52k stars 2.99k forks source link

replace pygments highlighting with QScintilla #19966

Open qgib opened 9 years ago

qgib commented 9 years ago

Author Name: Tom Kralidis (@tomkralidis) Original Redmine Issue: 11731

Redmine category:metasearch_catalogue_client


As suggested by @alexbruy, since the latter is part of QGIS core, replace pygments syntax highlighting funcitonality (contained to MetaSearch.util.highlight_xml) with something just as simple, and remove the pygments dependency and bundling for plugin.

sample:

import sys
from PyQt4.QtGui import QApplication
from PyQt4 import QtCore, QtGui
from PyQt4.Qsci import QsciScintilla, QsciScintillaBase, QsciLexerXML

if __name__ == "__main__":
    app = QApplication(sys.argv)
    editor = QsciScintilla()
    ## Choose a lexer
    editor.setLexer(QsciLexerXML())
    ## Render on screen
    editor.show()

    xml = '''
    <body>
        <title id="5">foo</title>
    </body>'''
    ## Show this file in the editor
    editor.setText(xml)
    sys.exit(app.exec_())
qgib commented 9 years ago

Author Name: Tom Kralidis (@tomkralidis)


qgib commented 9 years ago

Author Name: Tom Kralidis (@tomkralidis)


qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


pathmapper commented 1 month ago

Looks like pygments isn't used anymore since https://github.com/qgis/QGIS/pull/56160.

nyalldawson commented 1 month ago

@pathmapper it's still used elsewhere

pathmapper commented 1 month ago

@nyalldawson but not in MetaSearch, right? I was referring to the MetaSearch label, but of course we can also use this ticket to track the replacement of pygments in general...

nyalldawson commented 1 month ago

Right, but it's still in use in db manager. I don't think we should close this ticket till it's completely removed.