Skip to content

Commit

Permalink
Initial sphinx conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
infinity0 committed Nov 15, 2019
1 parent 162e132 commit 580ded6
Show file tree
Hide file tree
Showing 56 changed files with 230 additions and 102 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/build

site/
_build/
lib/
Expand Down
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = docs
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
77 changes: 77 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Project information -----------------------------------------------------

project = 'Web3 Foundation Research'
copyright = '2019, Web3 Foundation'
author = 'Web3 Foundation'

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = ''


# -- General configuration ---------------------------------------------------

# For markdown support see https://gist.github.com/johncrossland/9f6f54d559e9136773172aa0a429b46f

extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.githubpages',
'sphinxcontrib.fulltoc',
'sphinx_markdown_tables',
'sphinx_math_dollar',
]

templates_path = ['_templates']

source_suffix = ['.rst', '.md']

source_parsers = {
'.md': 'recommonmark.parser.CommonMarkParser',
}

master_doc = 'index'


# -- Options for HTML output -------------------------------------------------

html_theme = 'alabaster'
html_static_path = ['_static']

html_css_files = [
'stylesheets/extra.css',
]

mathjax_config = {
'extensions': ["tex2jax.js"],
'jax': ["input/TeX", "output/HTML-CSS"],
'tex2jax': {
'inlineMath': [ ['$','$'], ["\\(","\\)"] ],
'displayMath': [ ['$$','$$'], ["\\[","\\]"] ],
'processEscapes': True
},
"HTML-CSS": { 'fonts': ["TeX"] }
}

# -- Extension configuration -------------------------------------------------

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

# -- Options for todo extension ----------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
16 changes: 0 additions & 16 deletions docs/index.md

This file was deleted.

30 changes: 30 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
===========================
Research at Web3 Foundation
===========================

Web3 Foundation Research is being done in an in-house research team as well as in collaboration with various projects and research groups. The in-house team is mostly located in Zug, Switzerland.

Our research generally focuses on areas of:

- Decentralised algorithms: consensus, optimization, game theory
- Cryptography
- Networking

We analyze existing protocols, come up with new ones and specify them. We work closely with development teams to make sure our work is practical and useful in context of Web3 technologies.

Some of our current initiatives:

- :doc:`Polkadot network protocol research <polkadot>`
- `Messaging for Web3 initiative <https://github.com/w3f/messaging>`_

Talk to us on Riot at #w3f:matrix.org or on our `forum <https://forum.web3.foundation/>`_.

.. toctree::
:hidden:

polkadot
research_team_members

.. The below hack $\,$ is needed to force sphinx to include MathJax on md pages.
$\,$
11 changes: 0 additions & 11 deletions docs/mathjax-config.js

This file was deleted.

58 changes: 0 additions & 58 deletions docs/pdf/availability_validity/main.aux

This file was deleted.

9 changes: 0 additions & 9 deletions docs/pdf/availability_validity/main.out

This file was deleted.

8 changes: 0 additions & 8 deletions docs/pdf/availability_validity/poster/landscape-A0.bbl

This file was deleted.

9 changes: 9 additions & 0 deletions docs/polkadot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
========
Polkadot
========

.. toctree::
:glob:

polkadot/index
polkadot/*
8 changes: 8 additions & 0 deletions docs/polkadot/BABE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
====
BABE
====

.. toctree::
:glob:

BABE/*
9 changes: 9 additions & 0 deletions docs/polkadot/BABE/sortition.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
=========
Sortition
=========

.. toctree::
:glob:

sortition/index
sortition/*
9 changes: 9 additions & 0 deletions docs/polkadot/NPoS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
====
NPoS
====

.. toctree::
:glob:

NPoS/index
NPoS/*
9 changes: 9 additions & 0 deletions docs/polkadot/keys.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
====
Keys
====

.. toctree::
:glob:

keys/index
keys/*
8 changes: 8 additions & 0 deletions docs/polkadot/networking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
==========
Networking
==========

.. toctree::
:glob:

networking/*
8 changes: 8 additions & 0 deletions docs/polkadot/slashing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
========
Slashing
========

.. toctree::
:glob:

slashing/*
8 changes: 8 additions & 0 deletions docs/research_team_members.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=====================
Research Team Members
=====================

.. toctree::
:glob:

research_team_members/*
34 changes: 34 additions & 0 deletions maintain-indexes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
# Autogenerate dummy missing index pages

for dir in $(find docs -mindepth 1 -type d); do
case $dir in
*/_templates|*/images|*/images/*|*/pdf|*/pdf/*|*/stylesheets) continue;;
*)
if [ -f "$dir/main.tex" ]; then
continue
elif [ ! -f "$dir.rst" ]; then
name="$(basename "$dir")"
read -p "create empty index \"$name\" for $dir [y/n]? " x
if [ "$x" = "y" -o "$x" = "Y" ]; then
if [ -f "$dir/index.md" ]; then
nameindex="$(printf "%s/index\n " "$name")"
else
nameindex=""
fi
titlebar="$(echo "$name" | sed s/./=/g)"
cat > "$dir.rst" <<-eof
$titlebar
$name
$titlebar
.. toctree::
:glob:
${nameindex}$name/*
eof
fi
fi
;;
esac
done

0 comments on commit 580ded6

Please sign in to comment.