示例#1
0
 def analyse_text(text):
     return PhpLexer.analyse_text(text)
示例#2
0
def lex(path, analyze):
    with open(path, 'r') as f:
        l = PhpLexer()
        for t in analyze(l.get_tokens(f.read())):
            yield t
示例#3
0
 def analyse_text(text):
     rv = PhpLexer.analyse_text(text) - 0.01
     if html_doctype_matches(text):
         rv += 0.5
     return rv
示例#4
0
 def analyse_text(text):
     rv = PhpLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.4
     return rv
示例#5
0
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os

from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
from pygments.lexers.compiled import CLexer

lexers['php'] = PhpLexer(startinline=True, linenos=1)
lexers['varnish4'] = CLexer()

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
示例#6
0
#epub_identifier = ''

# A unique identification for the text.
#epub_uid = ''

# A tuple containing the cover image and cover page html template filenames.
#epub_cover = ()

# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []

# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []

# A list of files that should not be packed into the epub file.
#epub_exclude_files = []

# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3

# Allow duplicate toc entries.
#epub_tocdup = True

# Highlight PHP without starting <?php tag
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer

lexers['php'] = PhpLexer(startinline=True)
示例#7
0
 def analyse_text(text):
     rv = PhpLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.4
     return rv
示例#8
0
 def analyse_text(text):
     return PhpLexer.analyse_text(text)
示例#9
0
import sys
import os
import shlex

# Add extension to module lookup path
sys.path.append(os.path.abspath('../extension'))

from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer

lexers['php'] = PhpLexer(startinline=True, linenos=1)
lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)

extensions = [
    'sphinx.ext.autodoc', 'enhavo.sphinx'
]
source_suffix = '.rst'
source_encoding = 'utf-8'
master_doc = 'index'
project = u'enhavo'
copyright = u'2021, xq web'
author = u'xq web'
version = '0.10'
release = '0.10'
language = None
exclude_patterns = []
todo_include_todos = False
pygments_style = 'sphinx'
html_theme = 'enhavo'
html_theme_path = ['../theme']
latex_elements = {}
示例#10
0
 def analyse_text(text):
     rv = PhpLexer.analyse_text(text) - 0.01
     if html_doctype_matches(text):
         rv += 0.5
     return rv
示例#11
0
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build']

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# -- Custom -------------------------------------------------
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Set up PHP syntax highlights
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer

lexers["php"] = PhpLexer(startinline=True, linenos=1)
lexers["php-annotations"] = PhpLexer(startinline=True, linenos=1)
primary_domain = "php"
示例#12
0
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'symfonycom.sphinx.SensioStyle'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []

# -- Settings for symfony doc extension ---------------------------------------------------

# enable highlighting for PHP code not between ``<?php ... ?>`` by default
lexers['markdown'] = TextLexer()
lexers['php'] = PhpLexer(startinline=True)
lexers['php-annotations'] = PhpLexer(startinline=True)
lexers['php-standalone'] = PhpLexer(startinline=True)
lexers['php-symfony'] = PhpLexer(startinline=True)
lexers['rst'] = RstLexer()
lexers['varnish2'] = CLexer()
lexers['varnish3'] = CLexer()
lexers['varnish4'] = CLexer()
lexers['terminal'] = TerminalLexer()
lexers['env'] = BashLexer()

config_block = {
    'apache': 'Apache',
    'markdown': 'Markdown',
    'nginx': 'Nginx',
    'rst': 'reStructuredText',
示例#13
0
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import shlex

# Syntax highlighting...
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
lexers['hsl'] = PhpLexer(startinline=True)

# Fix anchor
from sphinx.domains.python import PyObject
add_target_and_index_old = PyObject.add_target_and_index


def add_target_and_index(self, name_cls, sig, signode):
    signode['ids'].append(name_cls[0])
    return add_target_and_index_old(self, name_cls, sig, signode)


PyObject.add_target_and_index = add_target_and_index

# Hide class. in function output
from sphinx.writers.html import HTMLTranslator
示例#14
0
def setupHighlighting():
    from sphinx.highlighting import lexers
    if lexers:
        from pygments.lexers.web import PhpLexer
        lexers['php'] = PhpLexer(startinline=True)
示例#15
0
    ('index', 'crud', u'crud Documentation', u'Friends of Cake', 'crud',
     'CakePHP scaffolding on steroids!', 'Miscellaneous'),
]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

#from sphinx.highlighting import lexers
#from pygments.lexers.web import PhpLexer

#lexers['phpinline'] = PhpLexer(startinline=True)

branch = 'master'

# -- Import Pygment lexers for PHP -----------------------
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer

lexers['php'] = PhpLexer(startinline=True)
lexers['phpinline'] = PhpLexer(startinline=True)
lexers['php-annotations'] = PhpLexer(startinline=True)
primary_domain = "php"