Skip to content

Commit

Permalink
Some documentation improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
PonteIneptique committed Dec 12, 2016
1 parent 388a8a3 commit a0773c7
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 66 deletions.
3 changes: 1 addition & 2 deletions MyCapytain/resources/texts/locals/tei.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,8 @@ def getValidReff(self, level=None, reference=None, _debug=False):
:returns: List of levels
:rtype: list(basestring, str)
.. note:: GetValidReff works for now as a loop using Passage, subinstances of Text, to retrieve the valid
.. note:: GetValidReff works for now as a loop using Passage, subinstances of Text, to retrieve the valid \
informations. Maybe something is more powerfull ?
"""
depth = 0
xml = self.textObject.xml
Expand Down
26 changes: 12 additions & 14 deletions doc/MyCapytain.api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Module common contains tools such as a namespace dictionary as well as cross-imp
URN, References and Citations
*****************************

.. autoclass:: MyCapytain.common.reference.Node
.. autoclass:: MyCapytain.common.reference.NodeId
:members:

.. autoclass:: MyCapytain.common.reference.URN
Expand All @@ -26,9 +26,6 @@ Metadata containers

.. automodule:: MyCapytain.common.metadata
:members:
:undoc-members:
:show-inheritance:
:inherited-members:

Utilities
*********
Expand Down Expand Up @@ -69,16 +66,19 @@ Resolvers
Remote CTS API
**************

.. autoclass:: MyCapytain.resolvers.api.cts.HttpCTSResolver
.. autoclass:: MyCapytain.resolvers.cts.api.HttpCTSResolver
:members:

Local CapiTainS Guidelines CTS Resolver
***************************************

.. autoclass:: MyCapytain.resolvers.cts.local.CTSCapitainsLocalResolver
:members:
:undoc-members:
:show-inheritance:
:inherited-members:

Prototypes
**********

.. automodule:: MyCapytain.resolvers.prototypes
.. autoclass:: MyCapytain.resolvers.prototypes.Resolver
:members:
:undoc-members:
:show-inheritance:
Expand All @@ -103,21 +103,20 @@ TEI based texts
Locally read text
+++++++++++++++++

.. autoclass:: MyCapytain.resources.texts.local.tei.Text
.. autoclass:: MyCapytain.resources.texts.locals.tei.Text
:members:
:undoc-members:
:show-inheritance:
:inherited-members:

.. autoclass:: MyCapytain.resources.texts.local.tei.Passage
.. autoclass:: MyCapytain.resources.texts.locals.tei.Passage
:members:
:undoc-members:
:show-inheritance:
:inherited-members:

.. autoclass:: MyCapytain.resources.texts.local.tei.__SimplePassage__
.. autoclass:: MyCapytain.resources.texts.locals.tei.__SimplePassage__
:members:
:undoc-members:
:show-inheritance:
:inherited-members:

Expand Down Expand Up @@ -176,4 +175,3 @@ Text Prototypes
:undoc-members:
:inherited-members:
:show-inheritance:

13 changes: 11 additions & 2 deletions doc/MyCapytain.classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Recommendations
For Textual API, it is recommended to implement the following requests

- getPassage(textId[str], subreference[str], prevnext[bool], metadata[bool])
- getMetadata(objectId[str], **kwargs)
- getMetadata(objectId[str], \*\*kwargs)
- getSiblings(textId[str], subreference[str])
- getReffs(textId[str], subreference[str], depth[int])

Expand All @@ -48,6 +48,15 @@ Text and Passages

Needs to be written


Collection
##########

CTS Collections
***************

Needs to be written

Resolvers
#########

Expand All @@ -60,7 +69,7 @@ The principle behind resolver is to provide native python object based on API-Li
four simple commands :

- getPassage(textId[str], subreference[str], prevnext[bool], metadata[bool]) -> Passage
- getMetadata(objectId[str], **kwargs) -> Collection
- getMetadata(objectId[str], \*\*kwargs) -> Collection
- getSiblings(textId[str], subreference[str]) -> tuple([str, str])
- getReffs(textId[str], subreference[str], depth[int]) -> list([str])

Expand Down
30 changes: 1 addition & 29 deletions doc/MyCapytain.endpoint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,4 @@ A first important point for MyCapytains endpoint is that the resources are not p
provide the request by default.

Getting Passage from an endpoint using a Retriever
##################################################

.. code-block:: python
from MyCapytain.retrievers import cts5
from MyCapytain.resources.texts.api import Text
# We set the variable up, as if we were in a function
# This URN won't work (urn:cts:greekLit:tlg0032.tlg005.perseus-grc1) because it has no TEI namespace
urn = 'urn:cts:latinLit:phi1294.phi002.perseus-lat2'
ref = "1.1-1.2"
# We set the api up. Endpoint takes one required argument
# (the URI) and one inventory as optional argument
cts = cts5.CTS('http://services2.perseids.org/exist/restxq/cts', inventory="nemo")
# We set up a text object to be able to retrieve passage of it
# Text in API modules takes endpoint as resource and URN as param
text = Text(urn=urn, resource=cts)
# We use the method getPassage which takes a reference argument
passage = text.getPassage(reference=ref)
# Passage then has different methods and properties
# Most of them (except next, prev and prevnext properties) are inherited from MyCapytain.resources.texts.tei.Text
# For example
print(passage.text(exclude=["note", "head"])) # Will get the text without "note" and "head" TEI nodes
print(passage.xml) # The xml property can be used as an argument for XSLT for example
##################################################
10 changes: 0 additions & 10 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,3 @@ Contents
MyCapytain.workarounds
MyCapytain.api
MyCapytain.benchmark


Indices and tables
##################

* :ref:`modules`
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

9 changes: 0 additions & 9 deletions doc/modules.rst

This file was deleted.

0 comments on commit a0773c7

Please sign in to comment.