Skip to content

Commit

Permalink
Merge pull request ufs-community#3 from JulieSchramm/master
Browse files Browse the repository at this point in the history
Add framework for User's Guide using Sphinx documentation
  • Loading branch information
ligiabernardet authored Nov 8, 2019
2 parents 0b36e83 + e2a472d commit 965a76a
Show file tree
Hide file tree
Showing 11 changed files with 318 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/UsersGuide/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, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
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)
11 changes: 11 additions & 0 deletions docs/UsersGuide/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This directory contains the User's Guide for the UFS MR Weather Application.

To build in html format (from this directory, above source and build) type:

`make html`

This will create an `index.html` file in `./build/html`.

To view in a browser window:

`open build/html/index.html`
4 changes: 4 additions & 0 deletions docs/UsersGuide/build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
35 changes: 35 additions & 0 deletions docs/UsersGuide/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
1 change: 1 addition & 0 deletions docs/UsersGuide/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinxcontrib-bibtex
12 changes: 12 additions & 0 deletions docs/UsersGuide/source/Introduction.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _Introduction:

*************************
Introduction
*************************

This page will include an index that points to other resources for the
UFS MR Weather application.

My favorite presentation is :cite:`Bernardet2018`.

.. bibliography:: references.bib
1 change: 1 addition & 0 deletions docs/UsersGuide/source/_static/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory contains custom stylesheets and other static files.
1 change: 1 addition & 0 deletions docs/UsersGuide/source/_templates/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory contains custom HTML templates.
205 changes: 205 additions & 0 deletions docs/UsersGuide/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
# -*- 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
sys.path.insert(0, os.path.abspath('.'))


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

project = 'UFS Medium-Range Weather App Users Guide'
copyright = '2019'
author = ' '

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

numfig = True


# -- 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.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
'sphinxcontrib.bibtex'
]

# 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'

# The master toctree document.
master_doc = '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 = []

# 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 = 'classic'

# 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 = {}
html_theme_options = {"body_max_width": "none"}

# 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']

def setup(app):
app.add_stylesheet('custom.css') # may also be an URL

# 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 = 'UFS-Weather-App'


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

latex_engine = 'pdflatex'
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',
# 'maketitle': r'\newcommand\sphinxbackoftitlepage{For referencing this document please use: \newline \break Schramm, J., L. Bernardet, L. Carson, G. Firl, D. Heinzeller, L. Pan, and M. Zhang, 2019. CCPP Technical Documentation Release v3.0.0. 91pp. Available at https://dtcenter.org/GMTB/v3.0/ccpp\_tech\_guide.pdf.}\sphinxmaketitle'
}

# 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, 'CCPPtechnical.tex', 'CCPP Technical Documentation',
author,'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, 'CCPPtechnical', 'CCPP Technical 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, 'CCPPtechnical', 'CCPP Technical Documentation',
author, 'CCPPtechnical', '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}

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

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
14 changes: 14 additions & 0 deletions docs/UsersGuide/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. UFS MR Weather App Users Guide, created by
sphinx-quickstart on Tue Oct 29 09:07:29 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to the UFS Medium-Range Weather App Users Guide!
========================================================

.. toctree::
:numbered:
:maxdepth: 3

Introduction

14 changes: 14 additions & 0 deletions docs/UsersGuide/source/references.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@article{Bernardet2018,
title={Community infrastructure for facilitating and accelerating improvement and testing of physical parameterizations},
author={L. Bernardet},
journal={WRF-GRAPES Modeling Workshop, Oct 17, Boulder, CO},
url = {http://www2.mmm.ucar.edu/wrf/grapes/bernardet_2018.pdf},
year={2018},
}
@article{BernardetEtAl2018a,
title={Community infrastructure for facilitating improvement and testing of physical parameterizations},
author={L. Bernardet and G. Firl and L. Carson and J. Dudhia and D. Gill and G. Grell and M. Harrold and C. Harrop and I. Jankov and P. Jimenez and G. Ketefian and L. Nance and D. Stark and J. Wolff and L. Xue and M. Zhang},
journal={Understanding and Modelling Atmospheric Processes / 2nd Pan-GASS (Global Atmospheric System Studies) meeting, Lorne, Victoria, Australia, Feb 26},
url={https://drive.google.com/drive/folders/1XYFI08wBUxTyiLkNqn5H3PcXSUgpxWqF},
year={2018},
}

0 comments on commit 965a76a

Please sign in to comment.