Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(web): sphinx minor fixes #3719

Merged
merged 2 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions docs/_ext/lexers.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
from ctags_optlib_highlighter import CtagsOptlibLexer
from pygments.lexers.special import TextLexer
import sphinx

def setup(app):
def install(app, h, name):
v = sphinx.__version__.split('.')
if int(v[0]) > 3:
c = CtagsOptlibLexer
c = h
elif (int(v[0]) == 3) and (int(v[1]) > 3):
c = CtagsOptlibLexer
c = h
else:
c = CtagsOptlibLexer()
app.add_lexer('ctags', c)
c = h()
app.add_lexer(name, c)

def setup(app):
install(app, CtagsOptlibLexer, 'ctags')
# Setup stubs
for h in ['git', 'yacc', 'EmacsLisp', 'tags', 'Autoconf', 'SystemTap', 'RMarkdown']:
install(app, TextLexer, h)
8 changes: 4 additions & 4 deletions docs/man/ctags-lang-sql.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ is enabled.
The SQL parser looks for a token coming after ``LANGUAGE`` keyword in
the source code to choose a proper guest parser.

.. code-block:: SQL
.. code-block:: psql

... LANGUAGE plpythonu AS '... user-defined function ' ...
... AS $$ user-defined function $$ LANGUAGE plv8 ...
Expand All @@ -51,7 +51,7 @@ tagging code including a user-defined function in a string literal [GH3006]_:

"input.sql"

.. code-block:: SQL
.. code-block:: psql

CREATE OR REPLACE FUNCTION fun1() RETURNS VARCHAR AS '
DECLARE
Expand All @@ -77,7 +77,7 @@ tagging code including a user-defined function in a dollar quote [GH3006]_:

"input.sql"

.. code-block:: SQL
.. code-block:: psql

CREATE OR REPLACE FUNCTION fun2() RETURNS VARCHAR LANGUAGE plpgsql AS $$
DECLARE
Expand All @@ -101,7 +101,7 @@ with "--options=NONE -o - --sort=no --extras=+{guest} input.sql"

tagging code including a user-defined written in JavaScript:

.. code-block:: SQL
.. code-block:: psql

-- Derived from https://github.com/plv8/plv8/blob/r3.0alpha/sql/plv8.sql
CREATE FUNCTION test(keys text[], vals text[]) RETURNS text AS
Expand Down
8 changes: 4 additions & 4 deletions man/ctags-lang-sql.7.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ is enabled.
The SQL parser looks for a token coming after ``LANGUAGE`` keyword in
the source code to choose a proper guest parser.

.. code-block:: SQL
.. code-block:: psql

... LANGUAGE plpythonu AS '... user-defined function ' ...
... AS $$ user-defined function $$ LANGUAGE plv8 ...
Expand All @@ -51,7 +51,7 @@ tagging code including a user-defined function in a string literal [GH3006]_:

"input.sql"

.. code-block:: SQL
.. code-block:: psql

CREATE OR REPLACE FUNCTION fun1() RETURNS VARCHAR AS '
DECLARE
Expand All @@ -77,7 +77,7 @@ tagging code including a user-defined function in a dollar quote [GH3006]_:

"input.sql"

.. code-block:: SQL
.. code-block:: psql

CREATE OR REPLACE FUNCTION fun2() RETURNS VARCHAR LANGUAGE plpgsql AS $$
DECLARE
Expand All @@ -101,7 +101,7 @@ with "--options=NONE -o - --sort=no --extras=+{guest} input.sql"

tagging code including a user-defined written in JavaScript:

.. code-block:: SQL
.. code-block:: psql

-- Derived from https://github.com/plv8/plv8/blob/r3.0alpha/sql/plv8.sql
CREATE FUNCTION test(keys text[], vals text[]) RETURNS text AS
Expand Down