Skip to content

Commit

Permalink
Merge pull request #37 from Capitains/0.0.2dev
Browse files Browse the repository at this point in the history
0.0.2 Release
  • Loading branch information
PonteIneptique committed Mar 10, 2016
2 parents 6e46982 + 43e4ea7 commit 37894f3
Show file tree
Hide file tree
Showing 23 changed files with 682 additions and 52 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Compiled python modules.
*.pyc
.idea
venv

# Setuptools distribution folder.
/dist/
Expand Down
19 changes: 16 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,21 @@ If you want to install the latest version, please do the following
source venv/bin/activate
python setup.py install
If you have trouble with dependency conflicts with MyCapitains, try running this before install
If you have trouble with dependency conflicts with MyCapitains, try running :code:`pip install MyCapytain` this before install


Running Nemo from the command line
######################################

This small tutorial takes that you have a CTS API endpoint available, here :code:`http://localhost:8000`

.. code-block:: shell

pip install MyCapytain
1. (Advised) Create a virtual environment and source it : :code:`virtualenv -p /usr/bin/python3 env`, :code:`source env/bin/activate`
2. **With development version:**
- Clone the repository : :code:`git clone https://github.com/Capitains/flask-capitains-nemo.git`
- Go to the directory : :code:`cd Nemo`
- Install the source with develop option : :code:`python setup.py develop`
2. **With production version:**
- Install from pip : :code:`pip install flask_nemo`
3. You will be able now to call capitains nemo help information through :code:`capitains-nemo --help`
4. Basic setting for testing an api is :code:`capitains-nemo http://localhost:8000`.
4 changes: 4 additions & 0 deletions docs/Nemo.api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Shared methods
**************

.. automethod:: flask.ext.nemo.Nemo.render
.. automethod:: flask.ext.nemo.Nemo.make_breadcrumbs
.. automethod:: flask.ext.nemo.Nemo.view_maker
.. automethod:: flask.ext.nemo.Nemo.route

Expand Down Expand Up @@ -76,6 +77,9 @@ Filters follow a naming convention : they should always start with "f_"
.. automethod:: flask.ext.nemo.Nemo.f_active_link
.. automethod:: flask.ext.nemo.Nemo.f_collection_i18n
.. automethod:: flask.ext.nemo.Nemo.f_formatting_passage_reference
.. automethod:: flask.ext.nemo.Nemo.f_order_text_edition_translation
.. automethod:: flask.ext.nemo.Nemo.f_i18n_citation_type
.. automethod:: flask.ext.nemo.Nemo.f_is_string

Helpers
*******
Expand Down
1 change: 1 addition & 0 deletions docs/Nemo.chunker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Available chunkers
.. automethod:: flask.ext.nemo.Nemo.default_chunker
.. automethod:: flask.ext.nemo.Nemo.line_chunker
.. automethod:: flask.ext.nemo.Nemo.scheme_chunker
.. automethod:: flask.ext.nemo.Nemo.level_chunker

PrevNext
########
Expand Down
20 changes: 20 additions & 0 deletions docs/Nemo.developer_guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Nemo Developper Guide
=====================

How to contribute ? Our github Etiquette
########################################

Writing and running tests
#########################

Running tests
*************

Nemo is built for Python 3.4 and further.

Writing and building documentations
###################################

Coding guidelines
#################

2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Welcome to the flask extension Nemo documentation!
:maxdepth: 2

Nemo.examples
Nemo.contributing
Nemo.developer_guide
Nemo.templates
Nemo.chunker
LXML
Expand Down
6 changes: 5 additions & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
if __name__ == "__main__":
# We select a configuration, see more in examples/configs
key = "default"
port = 5000
if len(argv) > 1 and argv[1] in configs:
key = argv[1]
Nemo = classes[key]
if len(argv) > 2:
port = int(argv[2])

# We create a Flask app
app = Flask(
Expand All @@ -33,4 +36,5 @@

# We run the app
app.debug = True
app.run()

app.run(port=port)
4 changes: 2 additions & 2 deletions examples/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
}
},
"chunker": {
"api_url": "http://services2.perseids.org/exist/restxq/cts",
"api_url": "http://localhost:5000",
"base_url": "",
"inventory": "nemo",
"chunker": {
# The default chunker takes care of book, poem, lines
# but it would be cool to have 30 lines group for Nemo
"urn:cts:latinLit:phi1294.phi002.perseus-lat2": lambda text, cb: [(reff.split(":")[-1], reff.split(":")[-1]) for reff in cb(2)],
"default": Nemo.scheme_chunker # lambda text, cb: Nemo.line_grouper(text, cb, 50)
"default": Nemo.level_grouper # lambda text, cb: Nemo.line_grouper(text, cb, 50)
},
"css" : [
# Use teibp from default nemo configuration
Expand Down
Loading

0 comments on commit 37894f3

Please sign in to comment.