Skip to content

Commit

Permalink
Mark some code blocks as "sh" or "none"
Browse files Browse the repository at this point in the history
We need to do this for code blocks which aren't in the current language
to avoid warnings from more recent versions of sphinx.
  • Loading branch information
ojwb committed Oct 31, 2016
1 parent 0457e6f commit 633db74
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 11 deletions.
8 changes: 6 additions & 2 deletions advanced/admin_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,19 @@ installed as just ``delve`` by default, though some packaged versions of Xapian
were already renaming it to ``xapian-delve``).

For example, to display the list of terms in document "1" of the database
"foo", use::
"foo", use:

.. code-block:: sh
xapian-delve foo -r 1
It is also possible to perform simple searches of a database. Xapian includes
another simple command-line program, ``quest``, to support this. ``quest`` is
only able to search for un-prefixed terms, the query string must be quoted to
protect it from the shell. To search the database "foo" for the phrase "hello
world", use::
world", use:

.. code-block:: sh
quest -d foo '"hello world"'
Expand Down
4 changes: 3 additions & 1 deletion concepts/search/queryparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ of range processors available, but the two discussed here are `Date`_ and
To use a range, additional programming is required to tell the QueryParser
what format a range is specified in and which value is to be searched for
matches within that range. This then gives rise to the ability to specify
ranges as::
ranges as:

.. code-block:: none
$10..50
5..10kg
Expand Down
4 changes: 3 additions & 1 deletion deprecation/deprecation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ of this file, will describe possible alternatives to the deprecated feature.
If you want to disable deprecation warnings temporarily, you can do so
by passing ``"-DXAPIAN_DEPRECATED(X)=X"`` to the compiler (the quotes are
needed to protect the brackets from the shell). If your build system uses
make, you might do this like so::
make, you might do this like so:

.. code-block:: sh
make 'CPPFLAGS="-DXAPIAN_DEPRECATED(X)=X"'
Expand Down
4 changes: 3 additions & 1 deletion howtos/range_queries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ We run this like so:
:cleanfirst: db
:args: data/100-objects-v1.csv db

We can check this has created document values using `xapian-delve`::
We can check this has created document values using `xapian-delve`:

.. code-block:: none
$ xapian-delve -V0 db | cat -v
Value 0 for each document: 5:M-@M-@ 8:M-HV 9:M-EM-p 10:M-MF 11:M-AM-0 12:M-AP 15:M-8^P 19:M-Dt 20:M-GM-P 21:M-E 24:M-O: 25:M-BM-@ 26:M-AM- 27:M-BX 29:M-DD 30:M-BM-^P 31:M-6@ 33:M-;` 34:M-A0 35:M-LM-l 36:M-C^P 37:M-9M-p 38:M-A( 39:M-FT 42:M-H2 45:M-N@ 46:M-AP 50:M-:M-^P 51:M-9P 52:M-LM-! 54:M-CM-( 55:M-9M-P 56:M-@P 59:M-D` 61:M-A( 62:M-;@ 64:M-:M-^P 66:M-AM-H 67:M-8` 68:M-@D33333@ 69:M-D^P 70:M-@M-H 71:M-KM-( 72:M-8^P 73:M-5M-^NfffffM-^@ 74:M-5M-^NfffffM-^@ 75:M-C$M-LM-LM-LM-LM-LM-@ 76:M-BM-?33333@ 77:M-C>33333@ 78:M-;M-^@ 79:M-E^T 80:M-9P 81:M-A@ 84:M-9M-t 86:M-L~ 87:M-BM-@ 88:M-9(M-LM-LM-LM-LM-LM-@ 89:M-:M-?33333@ 90:M-8M-C33333@ 91:M-E| 93:M-A( 94:M-@` 97:M-EM-\ 98:M-Bh 100:M-9^P
Expand Down
4 changes: 3 additions & 1 deletion overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ Installation on Debian or Ubuntu
Debian and Ubuntu have Xapian 1.2 packaged: if you're using a release which
is still in support, except Ubuntu 10.04 LTS (Lucid Lynx), then you can just do
one of the following depending on whether you want to work through the examples
in Python or C++::
in Python or C++:

.. code-block:: none
$ sudo apt-get install python-xapian
$ sudo apt-get install libxapian-dev
Expand Down
4 changes: 3 additions & 1 deletion practical_example/indexing/updating_the_database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ the `id_NUMBER` field in the data set:
.. xapianrunexample:: delete1
:args: db 1953-448 1985-438

After that, we expect to see two fewer documents in our database using xapian-delve::
After that, we expect to see two fewer documents in our database using xapian-delve:

.. code-block:: none
$ xapian-delve db
UUID = 1820ef0a-055b-4946-ae73-67aa4ef5c226
Expand Down
16 changes: 12 additions & 4 deletions practical_example/indexing/verifying_the_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Verifying the index using xapian-delve
Xapian comes with a handy utility called `xapian-delve` which can be used to
inspect a database, so let's look at the one you just built. If you just
pass a database path as a parameter you'll get an overview: how many documents,
average term length, and some other statistics::
average term length, and some other statistics:

.. code-block:: none
$ xapian-delve db
UUID = 1820ef0a-055b-4946-ae73-67aa4ef5c226
Expand All @@ -16,7 +18,9 @@ average term length, and some other statistics::
has positional information = true
You can also look at an individual document, using Xapian's docid (``-d``
means output document data as well)::
means output document data as well):

.. code-block:: none
$ xapian-delve -r 1 -d db # output has been reformatted
Data for record #1:
Expand All @@ -40,13 +44,17 @@ means output document data as well)::
ansonia compass dial pocket sunwatch
You can also go the other way, starting with a term and finding both
statistics and which documents it indexes::
statistics and which documents it indexes:

.. code-block:: none
$ xapian-delve -t Stime db
Posting List for term `Stime' (termfreq 4, collfreq 4, wdf_max 4):
41 56 58 65
This means you can look documents up by identifier::
This means you can look documents up by identifier:

.. code-block:: none
$ xapian-delve -t Q1974-100 db
Posting List for term `Q1974-100' (termfreq 1, collfreq 1, wdf_max 1):
Expand Down

0 comments on commit 633db74

Please sign in to comment.