Skip to content

Commit

Permalink
Merge pull request #74 from michaeldboyd/docs-feature
Browse files Browse the repository at this point in the history
Enable readthedocs support for indy-hipe
  • Loading branch information
dhh1128 committed Jan 31, 2019
2 parents 74c307e + 9d085f3 commit 4118063
Show file tree
Hide file tree
Showing 24 changed files with 615 additions and 293 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
.DS_Store
_build/
17 changes: 9 additions & 8 deletions 0000-template.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# Title (Ex. 0000: Template)
- Name: (fill me in with a unique ident in kebab case, such as "my-awesome-feature")
- Author: (your name and/or email)
- Start Date: (fill me in with today's date, YYYY-MM-DD)
- PR: (leave this empty)
- Jira Issue: (leave this empty)

# Summary
## Summary
[summary]: #summary

One paragraph explanation of the feature.

# Motivation
## Motivation
[motivation]: #motivation

Why are we doing this? What use cases does it support? What is the expected
outcome?

# Tutorial
## Tutorial
[tutorial]: #tutorial

Explain the proposal as if it were already implemented and you
Expand All @@ -32,7 +33,7 @@ migration guidance.
Some enhancement proposals may be more aimed at contributors (e.g. for
consensus internals); others may be more aimed at consumers.

# Reference
## Reference
[reference]: #reference

Provide guidance for implementers, procedures to inform testing,
Expand All @@ -44,20 +45,20 @@ Strive to guarantee that:
- Implementation trajectory is well defined.
- Corner cases are dissected by example.

# Drawbacks
## Drawbacks
[drawbacks]: #drawbacks

Why should we *not* do this?

# Rationale and alternatives
## Rationale and alternatives
[alternatives]: #alternatives

- Why is this design the best in the space of possible designs?
- What other designs have been considered and what is the rationale for not
choosing them?
- What is the impact of not doing this?

# Prior art
## Prior art
[prior-art]: #prior-art

Discuss prior art, both the good and the bad, in relation to this proposal.
Expand All @@ -81,7 +82,7 @@ does not on its own motivate an enhancement proposal here. Please also take
into consideration that Indy sometimes intentionally diverges from common
identity features.

# Unresolved questions
## Unresolved questions
[unresolved]: #unresolved-questions

- What parts of the design do you expect to resolve through the
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
maintainers
# Maintainers

## About This File

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

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = indy-hipe
SOURCEDIR = .
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)
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# indy-hipe
# Indy HIPE

This repo holds HIPEs (Hyperledger Indy Project Enhancements, pronounced like "hype"
for short) for chunks of technology or process that are important to standardize
Expand All @@ -10,7 +10,7 @@ Some changes, though, are "substantial"; these are the ones where a HIPE
helps to produce consensus and a shared understanding in the community. The
HIPE process is documented below.

##### Note: this repo and the enhancement proposal process it embodies has a special relationship with [sovrin-sip](https://github.com/sovrin-foundation/sovrin-sip/blob/master/README-sovrin.md) and possibly similar layered standards. Please see [derivative networks](derivative-networks.md) for details.
**Note: this repo and the enhancement proposal process it embodies has a special relationship with [sovrin-sip](https://github.com/sovrin-foundation/sovrin-sip/blob/master/README-sovrin.md) and possibly similar layered standards. Please see [derivative networks](derivative-networks.md) for details.**

## Table of Contents
[Table of Contents]: #table-of-contents
Expand Down Expand Up @@ -78,15 +78,15 @@ In short, to get a major feature added to Indy, one must first get the HIPE
merged into the HIPE repository as a markdown file. At that point, the HIPE is
"active" and may be implemented with the goal of eventual inclusion into Indy.

- Fork [the HIPE repo](https://github.com/hyperledger/indy-indy-hipe).
- Fork [the HIPE repo](https://github.com/hyperledger/indy-hipe).
- Pick a descriptive name for your feature. Use kebab case ("my-cool-feature").
Do not assign a HIPE number.
- Create a folder under `text/` for your feature, using the chosen name.
Copy `0000-template.md` to `text/<your folder name>/README.md`.
- Fill in the HIPE. Put care into the details: HIPEs that do not present
convincing motivation, demonstrate an understanding of the impact of the
design, or are disingenuous about the drawbacks or alternatives tend to be
poorly received. You can add supporting artifacts such as diagrams and sample
poorly received. You can add supporting artifacts, such as diagrams and sample
data, in the HIPE's folder.
- Submit a pull request. As a pull request, the HIPE will receive design
feedback from the larger community, and the author should be prepared to
Expand Down Expand Up @@ -127,6 +127,8 @@ merged into the HIPE repository as a markdown file. At that point, the HIPE is
- In most cases, the FCP period is quiet, and the HIPE is either merged or
closed. However, sometimes substantial new arguments or ideas are raised,
the FCP is canceled, and the HIPE goes back into development mode.
- Once the HIPE is merged, add it to the online documentation by including a
link to it in the `index.rst` file.

## The HIPE lifecycle
[The HIPE lifecycle]: #the-hipe-lifecycle
Expand Down
231 changes: 231 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
# -*- 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

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
import sphinx_rtd_theme
from recommonmark.transform import AutoStructify

sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------

project = 'Hyperledger Indy HIPE'
copyright = '2018, Hyperledger Indy'
author = 'Hyperledger Indy'

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

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

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.intersphinx',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
# source_suffix = '.rst'
source_suffix = ['.rst', '.md']

# The master toctree document.
master_doc = 'text/index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None


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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'IndyProjectEnhancementsdoc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'IndyProjectEnhancements.tex', 'Indy Project Enhancements Documentation',
'Hyperledger Indy', 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'indyprojectenhancements', 'Indy Project Enhancements Documentation',
[author], 1)
]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'IndyProjectEnhancements', 'Indy Project Enhancements Documentation',
author, 'IndyProjectEnhancements', 'One line description of project.',
'Miscellaneous'),
]


# -- Options for Epub output -------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']


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

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

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


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

def setup(app):
app.add_config_value('recommonmark_config', {
'auto_toc_tree_section': 'Contents',
}, True)
app.add_transform(AutoStructify)


# -------------- Additional fix for Markdown parsing support ---------------
# Once Recommonmark is fixed, remove this hack.
# Monkey patch to fix recommonmark 0.4 doc reference issues.
from recommonmark.states import DummyStateMachine
orig_run_role = DummyStateMachine.run_role
def run_role(self, name, options=None, content=None):
if name == 'doc':
name = 'any'
return orig_run_role(self, name, options, content)
DummyStateMachine.run_role = run_role

# ------------ Remote Documentation Builder Config -----------
# Note: this is a hacky way of maintaining a consistent sidebar amongst all the repositories.
# Do you have a better way to do it?
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if(on_rtd):
rtd_version = os.environ.get('READTHEDOCS_VERSION', 'latest')
if rtd_version not in ['stable', 'latest']:
rtd_version = 'latest'
try:
os.system("git clone https://github.com/hyperledger/indy-docs.git remote_conf")
os.system("mv remote_conf/remote_conf.py .")
import remote_conf
remote_conf.generate_sidebar(globals(), nickname)
intersphinx_mapping = remote_conf.get_intersphinx_mapping(rtd_version)
master_doc = "toc"

except:
e = sys.exc_info()[0]
print e
finally:
os.system("rm -rf remote_conf/ __pycache__/ remote_conf.py")

0 comments on commit 4118063

Please sign in to comment.