• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

sphinx-ext/H17-Aug-2013-4431

README.rstH A D17-Aug-20131.9 KiB8348

README.rst

1==================================
2Sphinx extention : wikipedia
3==================================
4
5This Sphinx_ extension adds a docutils role to create links to wikipedia
6articles.
7
8.. _Sphinx: http://sphinx-doc.org/
9
10Licensing
11---------
12
13This code is released under the BSD License.
14
15Installing
16----------
17
18Clone the sphinx-ext-wikipedia repository ::
19
20  $ git clone https://github.com/quiver/sphinx-ext-wikipedia.git
21
22Copy extension module ::
23
24  $ cp -r  sphinx-ext-wikipedia/sphinx-ext path/to/directory
25
26Enabling the extension in Sphinx
27--------------------------------
28
29To enable the use of this extension in your Sphinx project, you will need
30to edit ``conf.py`` file in your Sphinx project.
31
32First, add the extension module path to ``sys.path``. ::
33
34    sys.path.append(os.path.abspath('path/to/ext/directory'))
35
36Then, enable this extention by adding ``wikipedia`` to the list of
37``extensions``. ::
38
39    extensions += [ 'wikipedia']
40
41Configuration
42-------------
43
44You can set the following config value in your Sphinx project's
45``conf.py`` file.
46
47wikipedia_lang
48
49    Defalut languge of the wikipedia.
50    If not specified, this defaults to ``"en"``. ::
51
52        wikipedia_lang = "fi"   #Finnish
53
54*wikipedia_lang*
55
56    Defalut languge of the wikipedia.
57    If not specified, this defaults to ``"en"``. ::
58
59        wikipedia_lang = "fi"
60
61Usage
62-----
63
64In your restructuredText markup, you can create links to various Trac
65entities using markup of the following format::
66
67To link to a *Sphinx* artitle ::
68
69    :wikipedia:`Sphinx`
70
71To link to a *Sphinx* artitle with explicit title *mythical creature* ::
72
73    :wikipedia:`mythical creature <Sphinx>`
74
75To link to a non-default language artitle, use ``:lang:artitle`` markup ::
76
77    :wikipedia:`:zh:斯芬克斯`
78
79Of course, you can mix explicit title and non-default language ::
80
81    :wikipedia:`Answer to the Ultimate Question of Life, the Universe, and Everything <:de:42 (Antwort)>`
82
83