Commit 8037959e authored by Sacha's avatar Sacha Committed by SXibolet@2PITAU
Browse files

docs locally

parent b8f61b19
......@@ -29,7 +29,7 @@ If you'd like to reproduce our results, we encourage you to use the demo online
.. image::
.. image::
.. _IEEE Big Data 2015:
libbson @ 89edcc7a
Subproject commit 89edcc7ad7a65552139905ad4818716a2b1a8ae7
# Makefile for Sphinx documentation
# You can set these variables from the command line.
SPHINXBUILD = sphinx-build
BUILDDIR = _build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
# the i18n builder cannot share the environment and doctrees with the others
.PHONY: help
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " epub3 to make an epub3"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " dummy to check syntax errors of document sources"
.PHONY: clean
rm -rf $(BUILDDIR)/*
.PHONY: html
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: dirhtml
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
.PHONY: singlehtml
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
.PHONY: pickle
@echo "Build finished; now you can process the pickle files."
.PHONY: json
@echo "Build finished; now you can process the JSON files."
.PHONY: htmlhelp
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
.PHONY: qthelp
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Controversy.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Controversy.qhc"
.PHONY: applehelp
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
.PHONY: devhelp
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/Controversy"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Controversy"
@echo "# devhelp"
.PHONY: epub
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
.PHONY: epub3
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
.PHONY: latex
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
.PHONY: latexpdf
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: latexpdfja
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: text
@echo "Build finished. The text files are in $(BUILDDIR)/text."
.PHONY: man
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
.PHONY: texinfo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
.PHONY: info
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
.PHONY: gettext
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
.PHONY: changes
@echo "The overview file is in $(BUILDDIR)/changes."
.PHONY: linkcheck
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
.PHONY: doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
.PHONY: coverage
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
.PHONY: xml
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
.PHONY: pseudoxml
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
.PHONY: dummy
@echo "Build finished. Dummy builder generates no files."
use Sphinx to build the documentation:
``pip install sphinx``
``make html``, and make a merge request if you don't have write access
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: d37405411870239d5e93e25497e1d550
tags: 645f666f9bcd5a90fca523b33c5a78b7
.. |---| unicode:: U+2014 .. em dash
Controversy project API
If you're viewing this page on GitHub, please consider switching to our HTML version here:
.. note::
This specification is for mostly for internal reference only. We currently do not have a method for scoring external articles.
Prefix all URLs with ``//``.
**GET** ``/api/trend``
.. include:: documents/trend.json
:code: javascript
Where ``['result']['trending']`` is a key-value pair list where the key is the query and the value is the amount of search traffic towards that query. ``['result']['top-5']`` is a ranked list of the most popular queries. ``top-5`` will always be a (non-proper) subset of trending.
``/api/trend/<k>``. Where ``<k>`` is an element of ``/api/trend``'s ``trending`` list (a keyword that's been searched for before).
.. include:: documents/trendk.json
:code: javascript
**GET** ``/api/trend/<k>.png`` will generate a trendline (if there's enough data) of the controversy of a keyword versus time. Here's an example (not based on the ``json`` above):
.. image:: documents/romney.png
If you don't want a normalized plot, do ``<k>.png?nonorm``.
You must be logged in to query any of the *below* endpoints (i.e. trends don't require logins).
``error`` will be ``1``, ``message`` will have an error message, ``400`` status code
other error
same, except with a ``200``. e.g.: no articles exist for the queryterm
Article rank
**GET** ``/api?q=syria``
.. include:: documents/syria-spec.json
:code: javascript
Where ``score`` is the score (defined in the IEEE paper) for an article or keyword. It's the sum of the sentiment and lingustic scores.
User search-history
**GET** ``/api/user-history``. It's only possible to query the currently-signed-in user's history, so no arguments.
.. include:: documents/user-history.json
:code: javascript
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif;
font-size: 17px;
background-color: white;
color: #000;
margin: 0;
padding: 0;
div.document {
width: 940px;
margin: 30px auto 0 auto;
div.documentwrapper {
float: left;
width: 100%;
div.bodywrapper {
margin: 0 0 0 220px;
div.sphinxsidebar {
width: 220px;
font-size: 14px;
line-height: 1.5;
hr {
border: 1px solid #B1B4B6;
div.body {
background-color: #ffffff;
color: #3E4349;
padding: 0 30px 0 30px;
div.body > .section {
text-align: left;
div.footer {
width: 940px;
margin: 20px auto 30px auto;
font-size: 14px;
color: #888;
text-align: right;
div.footer a {
color: #888;
p.caption {
font-family: ;
font-size: inherit;
div.relations {
display: none;
div.sphinxsidebar a {
color: #444;
text-decoration: none;
border-bottom: 1px dotted #999;
div.sphinxsidebar a:hover {
border-bottom: 1px solid #999;
div.sphinxsidebarwrapper {
padding: 18px 10px;
div.sphinxsidebarwrapper p.logo {
padding: 0;
margin: -10px 0 0 0px;
text-align: center;
div.sphinxsidebarwrapper h1.logo {
margin-top: -10px;
text-align: center;
margin-bottom: 5px;
text-align: left;
div.sphinxsidebarwrapper h1.logo-name {
margin-top: 0px;
div.sphinxsidebarwrapper p.blurb {
margin-top: 0;
font-style: normal;
div.sphinxsidebar h3,
div.sphinxsidebar h4 {
font-family: 'Garamond', 'Georgia', serif;
color: #444;
font-size: 24px;
font-weight: normal;
margin: 0 0 5px 0;
padding: 0;
div.sphinxsidebar h4 {
font-size: 20px;
div.sphinxsidebar h3 a {
color: #444;
div.sphinxsidebar p.logo a,
div.sphinxsidebar h3 a,
div.sphinxsidebar p.logo a:hover,
div.sphinxsidebar h3 a:hover {
border: none;
div.sphinxsidebar p {
color: #555;
margin: 10px 0;
div.sphinxsidebar ul {
margin: 10px 0;
padding: 0;
color: #000;
div.sphinxsidebar ul li.toctree-l1 > a {
font-size: 120%;
div.sphinxsidebar ul li.toctree-l2 > a {
font-size: 110%;
div.sphinxsidebar input {
border: 1px solid #CCC;
font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif;
font-size: 1em;
div.sphinxsidebar hr {
border: none;
height: 1px;
color: #AAA;
background: #AAA;
text-align: left;
margin-left: 0;
width: 50%;
/* -- body styles ----------------------------------------------------------- */
a {
color: #004B6B;
text-decoration: underline;
a:hover {
color: #6D4100;
text-decoration: underline;
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: 'Garamond', 'Georgia', serif;
font-weight: normal;
margin: 30px 0px 10px 0px;
padding: 0;
div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; }
div.body h2 { font-size: 180%; }
div.body h3 { font-size: 150%; }
div.body h4 { font-size: 130%; }
div.body h5 { font-size: 100%; }
div.body h6 { font-size: 100%; }
a.headerlink {
color: #DDD;
padding: 0 4px;
text-decoration: none;
a.headerlink:hover {
color: #444;
background: #EAEAEA;
div.body p, div.body dd, div.body li {
line-height: 1.4em;
div.admonition {
margin: 20px 0px;
padding: 10px 30px;
background-color: #FCC;
border: 1px solid #FAA;
div.admonition tt.xref, div.admonition a tt {
border-bottom: 1px solid #fafafa;
dd div.admonition {
margin-left: -60px;
padding-left: 60px;
div.admonition p.admonition-title {
font-family: 'Garamond', 'Georgia', serif;
font-weight: normal;
font-size: 24px;
margin: 0 0 10px 0;
padding: 0;
line-height: 1;
div.admonition p.last {
margin-bottom: 0;
div.highlight {
background-color: white;
dt:target, .highlight {
background: #FAF3E8;
div.note {
background-color: #EEE;
border: 1px solid #CCC;
div.seealso {
background-color: #EEE;
border: 1px solid #CCC;
div.topic {
background-color: #eee;
p.admonition-title {
display: inline;
p.admonition-title:after {
content: ":";
pre, tt, code {