Generalized plugin scheme for pygments

This commit is contained in:
Denis Merigoux 2021-02-28 18:10:41 +01:00
parent 3bcf85bd94
commit 88d8dd3c31
9 changed files with 28 additions and 37 deletions

11
.gitmodules vendored
View File

@ -1,11 +0,0 @@
[submodule "syntax_highlighting/fr/pygments/pygments"]
path = syntax_highlighting/fr/pygments/pygments
url = https://github.com/pygments/pygments.git
branch = master
ignore = dirty
[submodule "syntax_highlighting/nv/pygments/pygments"]
path = syntax_highlighting/nv/pygments/pygments
url = https://github.com/pygments/pygments.git
branch = master
ignore = dirty

View File

@ -0,0 +1,3 @@
catala_fr_lexer.egg-info
__pycache__

@ -1 +0,0 @@
Subproject commit 057fbfba1ab575b3e19a8d93c68451b18bd8bc59

View File

@ -0,0 +1,10 @@
from setuptools import setup, find_packages
setup(
name='catala_fr_lexer',
packages=find_packages(),
entry_points="""
[pygments.lexers]
catala_fr_lexer = catala_fr_lexer.lexer:CatalaFrLexer
""",
)

View File

@ -1,14 +1,3 @@
#! /usr/bin/env bash
cd "$(dirname "$0")"
ln -s -f $(pwd)/pygments/catala_fr.py pygments/pygments/pygments/lexers/catala_fr.py
if grep -q "CatalaFrLexer" pygments/pygments/pygments/lexers/_mapping.py
then
:
else
sed -i "78i\\ 'CatalaFrLexer': ('pygments.lexers.catala_fr', 'CatalaFr', ('catala_fr'), ('*.catala_fr'), ('text/x-catala-fr',))," pygments/pygments/pygments/lexers/_mapping.py
fi
cd pygments/pygments
virtualenv -p python3 env
source env/bin/activate
python3 setup.py install
cd pygments && python3 setup.py develop

View File

@ -0,0 +1,3 @@
catala_nv_lexer.egg-info
__pycache__

@ -1 +0,0 @@
Subproject commit 057fbfba1ab575b3e19a8d93c68451b18bd8bc59

View File

@ -0,0 +1,10 @@
from setuptools import setup, find_packages
setup(
name='catala_nv_lexer',
packages=find_packages(),
entry_points="""
[pygments.lexers]
catala_nv_lexer = catala_nv_lexer.lexer:CatalaNvLexer
""",
)

View File

@ -1,14 +1,3 @@
#! /usr/bin/env bash
cd "$(dirname "$0")"
ln -s -f $(pwd)/pygments/catala_en.py pygments/pygments/pygments/lexers/catala_nv.py
if grep -q "CatalaNvLexer" pygments/pygments/pygments/lexers/_mapping.py
then
:
else
sed -i "78i\\ 'CatalaEnLexer': ('pygments.lexers.catala_nv', 'CatalaNv', ('catala_nv'), ('*.catala'), ('text/x-catala-nv',))," pygments/pygments/pygments/lexers/_mapping.py
fi
cd pygments/pygments
virtualenv -p python3 env
source env/bin/activate
python3 setup.py install
cd pygments && python3 setup.py develop