Skip to content

Commit dddd60f

Browse files
committed
Reorganise documentation & usage example
- Move Quick Sample into its own usage.rst page of the doc, as it is only correctly rendered in a Sphinx documentation. - Move Changelog inclusion into its own page of the doc, as its growing size took a lot of space in the hom page. These two changes leave a lot more room for the table of contents, as it was quite burried in the home page before. Fixes #41
1 parent 0c9f746 commit dddd60f

File tree

4 files changed

+96
-89
lines changed

4 files changed

+96
-89
lines changed

README.rst

+4-82
Original file line numberDiff line numberDiff line change
@@ -36,94 +36,16 @@ PHP Domain supports following objects:
3636

3737
Package\Subpackage\Class
3838

39+
See `Usage Example`_ in the documentation for information about how to use it.
40+
41+
.. _`Usage Example`: https://markstory.github.io/sphinxcontrib-phpdomain/usage.html
42+
3943
URLs
4044
====
4145

4246
:PyPI: https://pypi.python.org/pypi/sphinxcontrib-phpdomain
4347
:Documentation: https://markstory.github.io/sphinxcontrib-phpdomain/
4448

45-
Quick Sample
46-
============
47-
48-
This is source:
49-
50-
.. code:: rst
51-
52-
.. php:class:: DateTime
53-
54-
Datetime class
55-
56-
.. php:method:: setDate($year, $month, $day)
57-
58-
Set the date.
59-
60-
:param int $year: The year.
61-
:param int $month: The month.
62-
:param int $day: The day.
63-
:returns: Either false on failure, or the datetime object for method chaining.
64-
65-
66-
.. php:method:: setTime($hour, $minute[, $second])
67-
68-
Set the time.
69-
70-
:param int $hour: The hour
71-
:param int $minute: The minute
72-
:param int $second: The second
73-
:returns: Either false on failure, or the datetime object for method chaining.
74-
75-
.. php:const:: ATOM
76-
77-
Y-m-d\TH:i:sP
78-
79-
Result
80-
-----------------
81-
82-
.. php:class:: DateTime
83-
:nocontentsentry:
84-
85-
Datetime class
86-
87-
.. php:method:: setDate($year, $month, $day)
88-
:nocontentsentry:
89-
90-
Set the date.
91-
92-
:param int $year: The year.
93-
:param int $month: The month.
94-
:param int $day: The day.
95-
:returns: Either false on failure, or the DateTime object for method chaining.
96-
97-
98-
.. php:method:: setTime($hour, $minute[, $second])
99-
:nocontentsentry:
100-
101-
Set the time.
102-
103-
:param int $hour: The hour
104-
:param int $minute: The minute
105-
:param int $second: The second
106-
:returns: Either false on failure, or the DateTime object for method chaining.
107-
108-
.. php:const:: ATOM
109-
:nocontentsentry:
110-
111-
Y-m-d\TH:i:sP
112-
113-
Cross referencing
114-
-----------------
115-
116-
From other place, you can create cross reference like that:
117-
118-
.. code:: rst
119-
120-
You can modify a DateTime's date using :php:meth:`DateTime::setDate`.
121-
122-
Result
123-
-----------
124-
125-
You can modify a DateTime's date using :php:meth:`DateTime::setDate`.
126-
12749
Install
12850
=======
12951

doc/changes.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ChangeLog
2+
#########
3+
4+
.. include:: ../CHANGES
5+
6+

doc/index.rst

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
.. include:: ../README.rst
22

3-
Contents:
4-
---------
3+
Contents
4+
========
55

66
.. toctree::
77
:maxdepth: 2
88

9+
usage
910
reference
11+
changes
1012

1113
* :ref:`genindex`
1214
* :ref:`search`
1315

14-
ChangeLog
15-
=========
16-
17-
.. include:: ../CHANGES
18-

doc/usage.rst

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
Usage Example
2+
=============
3+
4+
This is source:
5+
6+
.. code:: rst
7+
8+
.. php:class:: DateTime
9+
10+
Datetime class
11+
12+
.. php:method:: setDate($year, $month, $day)
13+
14+
Set the date.
15+
16+
:param int $year: The year.
17+
:param int $month: The month.
18+
:param int $day: The day.
19+
:returns: Either false on failure, or the datetime object for method chaining.
20+
21+
22+
.. php:method:: setTime($hour, $minute[, $second])
23+
24+
Set the time.
25+
26+
:param int $hour: The hour
27+
:param int $minute: The minute
28+
:param int $second: The second
29+
:returns: Either false on failure, or the datetime object for method chaining.
30+
31+
.. php:const:: ATOM
32+
33+
Y-m-d\TH:i:sP
34+
35+
Result
36+
-----------------
37+
38+
.. php:class:: DateTime
39+
:nocontentsentry:
40+
41+
Datetime class
42+
43+
.. php:method:: setDate($year, $month, $day)
44+
:nocontentsentry:
45+
46+
Set the date.
47+
48+
:param int $year: The year.
49+
:param int $month: The month.
50+
:param int $day: The day.
51+
:returns: Either false on failure, or the DateTime object for method chaining.
52+
53+
54+
.. php:method:: setTime($hour, $minute[, $second])
55+
:nocontentsentry:
56+
57+
Set the time.
58+
59+
:param int $hour: The hour
60+
:param int $minute: The minute
61+
:param int $second: The second
62+
:returns: Either false on failure, or the DateTime object for method chaining.
63+
64+
.. php:const:: ATOM
65+
:nocontentsentry:
66+
67+
Y-m-d\TH:i:sP
68+
69+
Cross referencing
70+
-----------------
71+
72+
From other place, you can create cross reference like that:
73+
74+
.. code:: rst
75+
76+
You can modify a DateTime's date using :php:meth:`DateTime::setDate`.
77+
78+
Result
79+
-----------
80+
81+
You can modify a DateTime's date using :php:meth:`DateTime::setDate`.
82+

0 commit comments

Comments
 (0)