From 13efa19efebc2c0022addc75d4a786677b5051f4 Mon Sep 17 00:00:00 2001 From: Anthony Borghi <anthony.borghi@veremes.com> Date: Fri, 10 Mar 2023 08:17:02 +0100 Subject: [PATCH] activation du highlight pour le code php --- .gitlab-ci.yml | 1 + README.md | 1 + source/conf.py | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f023ee9..51b9c86 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,7 @@ deploy-gtf-fr-documentation-dev : # - pip install sphinx-markdown-parser # - pip install myst-parser # - pip install pymdown-extensions + - pip install sphinxcontrib-phpdomain - sphinx-build -b html source build - aws s3 cp build/ s3://$S3_BUCKET_NAME_DEV_fr/ --recursive tags: diff --git a/README.md b/README.md index 29fa1f5..b7a6676 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ pip install sphinx_rtd_theme==0.5.2 pip install sphinx-markdown-parser pip install myst-parser pip install pymdown-extensions +pip install sphinxcontrib-phpdomain sphinx-build -b html source build ``` diff --git a/source/conf.py b/source/conf.py index b92a923..7aca07e 100644 --- a/source/conf.py +++ b/source/conf.py @@ -3,6 +3,8 @@ import os from sphinx_markdown_parser.parser import MarkdownParser from datetime import datetime #from recommonmark.transform import AutoStructify +from sphinx.highlighting import lexers +from pygments.lexers.web import PhpLexer source_parsers = { '.md': 'CommonMarkParser', @@ -139,3 +141,8 @@ html_theme_options = { 'includehidden': True, 'titles_only': False } + + +lexers['php'] = PhpLexer(startinline=True, linenos=1) +lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) +primary_domain = 'php' \ No newline at end of file -- GitLab