README Version 2.0, May 2020
You should import this repo to build CyVerse Tutorials
See what this template looks like rendered on ReadTheDocs
Each piece of CyVerse Learning Center has its own ReadtheDocs page which in turn is built from its own GitHub repo (see the template repos at https://github.com/CyVerse-learning-materials). Starting from a ResStructured text file (index.rst) The documentation is built using Sphinx, and hosted on a repo configured with GitHub Webhooks/Services. Finally, the site is added to the CyVerse ReadtheDocs account. Directions for completing this workflow are below (see Building a Tutorial from Scratch).
- Manuals - A Manual is a more comprehensive documentation piece on a CyVerse
platform or software product.
- Written by: CyVerse Staff, with community contributions welcome
- Platform Guide - A Platform Guide is a slightly modified form of tutorial
that covers an entire platform or service.
- Written by: CyVerse Staff, with community contributions welcome
- Quick Starts - These materials are short tutorials that cover the minimal
amount of information needed to complete an operational task (e.g.
uploading data, reformatting a file, etc. ); there is no significant
explanation of the science or interpretation of results. Quick Starts highlight
available resources, answer common questions,
and refer users to the most appropriate materials.
- Written by: CyVerse Staff or community members
- Tutorials - Tutorials teach. Users should be able to follow an example
dataset through the steps of a tutorial and gain understanding about what is
happening along those steps. These are in-depth guides that usually address a
scientific question by covering the major steps of a scientific workflow.
A tutorial is ‘successful’ when a user is able to follow the tutorial a
second time with their own data and obtain reasonable results.
- Written by: CyVerse Staff or community members
Examples of when to use what type of template:
- Uploading a file: Quick Start
- Cleaning FastQ reads: Quick Start
- Basic introduction to an app: Quick Start
- Assembling a transcriptome using multiple apps and explaining the science: Tutorial
- An intro to the Discovery Environment: Platform Guide
- Comprehensive listing of all the basic functionalities of Discovery Environment: Manual
Item | Description | Notes |
---|---|---|
index.rst |
This is the homepage of your documentation. It list the title and goal of the documentation, lists a maintainer, and usually indicates what prerequisite platforms, files, and services are needed to complete the tutorial | |
step1.rst |
If documentation has more than one page, use this for the second and subsequent pages | Copy as needed for additional pages |
/img |
Place images for your tutorials here | CyVerse logos and other useful images are already here |
example_directives_delete.rst |
Example page with code for common restructured text objects | Delete this page before publishing your materials |
cyverse_rst_defined_substitutions.txt |
Restructured text substitutions for common URLs and images | |
custom_urls.txt |
Place URLs particular to your repository here in a single page, suing restructured text substitutions to create hyperlinks | Be sure any documentation page referring to this one has the directive .. include:: custom_urls.txt |
conf.py and /misc/cyverse_sphinx_conf.py |
Edit the tutorial and author name; versioning | |
README.md | These instructions | Delete before publishing your documentation |
/slides |
Place slides associated with your tutorial here | Version controlled files preferred, PPT acceptable |
/misc |
Miscellaneous needed for building documentation | |
License.md |
License | This license file applies to all materials created by CyVerse for this documentation |
- Click the 'issues' tab at the top of this GitHub page to let us know about a simple mistake such as a typo or missing file.
OR
- Send an email to the maintainer listed in the documentation or [email protected]
- Fork this repo to your GitHub account
- Make desired edits. For very significant changes (we suggest making a new branch).
- Commit change; if working from a local copy, push those changes to your fork in Github.
- Submit a pull request back to the master repository; you may need to act on feedback before your request is merged.
You will need the following accounts
- GitHub account - makes it possible to collaborate on the documentation:
-
Choose one of the template repositories at https://github.com/CyVerse-learning-materials/ (these are pinned at the top of this page). Click the Use this template button. Name your repo for the name of your documentation e.g. 'name_tutorial'. You may choose public or private. There is no need to include all branches (leave unchecked).
-
Once you have a new repo made from the template, clone this new repo to your local machine for editing.
$git clone MY-TUTORIAL
In order to build our documentation you can install the authoring tools or skip this section and use the Docker container we have built.
You will need the following software
-
Python (3.7 or later) - This is required for the Sphinx package that will build our documentation:
-
If needed, install pip:
-
Sphinx - This will build our tutorials into HTML and other formats (this uses the Python package installer 'pip' so Python must be installed first); we will also install the theme we need for our documentation
Note You can use the
minimal_requirements.txt
in /readthedocstools to install these requirements. If you run into problems try this with the wholerequirements.txt
- both of which are in the learning-center-2.0-release repo (see/readthedocstools
in that repo).$ pip3 install -r /readthedocstools/minimal_requirements.txt
-
git - We use git to version control our documentation and manage with GitHub
-
Edit the index.rst and other files as needed. Save images or other files in the appropriate directories. See the recommended style guide in the template.
-
Since tutorials will likely span multiple pages, you can copy internal pages page as many times as needed. Update the table of contents at the top of the 'index.rst' accordingly. We will have only documentation piece per repo.
-
Save your work such as:
- individual pages (e.g.
index.rst
,step2.rst
) - images (as
.png
files in the the/img
folder) - changes or additions to
cyverse_rst_defined_substitutions.txt
andcustom_urls.txt
- individual pages (e.g.
-
Edit the
conf.py
and/misc/cyverse_sphinx_conf.py
files to set the project and author information -
Build the tutorial:
$ make html
Alternatively you can make an automatically building previewing using this command
$ sphinx-autobuild -b html --host 0.0.0.0 --port 8000 --poll . _build_html
-
Your HTML site will be in the
_build_html
or_build
directory that has been created (you can preview this in your web browser at this time). -
Commit your changes and push the tutorial back to GitHub.
For your convenience, all of the documentation software has been packed in a Docker container.
-
If needed, install Docker (See Get Docker) then pull the Docker image:
$ docker pull jasonjwilliamsny/cyverse-learning-materials-tools:1.0
-
Run the container interactively (
-it
). Map port 8000 inside the container to port 8000 outside (-p 8000:8000
) and use the volume command (-v
) to mount the container to a directory of your choice. This directory should be the place where you cloned your repo in step 1 of this section. You will need to be able to open files using a web browser and use a text editor to edit files.$ docker run -it -p 8000:8000 -v LOCALDIRECTORY:/DOCKERDOCUMENTATION jasonjwilliamsny/cyverse-learning-materials-tools:1.0
-
From inside the Docker container bash terminal, navigate to the mounted directory (e.g.
DOCKERDOCUMENTATION
). You should see your cloned repository there. You can now follow the steps in theObtaining the template
section with the following modifications:-
To preview your documentation, from inside the docker container use the following command to view build and preview your documentation. NOTE this command will only work if you are in the same directory as your documentation repository and you are inside the docker container shell.
$ sphinx-autobuild -b html --host 0.0.0.0 --port 8000 --poll . _build_html
You documentation should be served at http://0.0.0.0:8000. Open a web browser on your computer to see the preview. As you make changes to the documentation, the browser should automatically update within a few seconds of making the change.
-
-
Follow the directions in the "Editing the template" section above.
Once you have built your documentation, notify [email protected] that your tutorial is ready for inclusion in the main CyVerse documentation repo. We will review and verify the contribution, and add you as a maintainer repo in the CyVerse collection. Alternatively, you can host your tutorial independently on ReadTheDocs following their instructions for importing documentation. We will also follow up about ensuring test data associated with the documentation are available and open.
General Principles
- Write instructions in short numbered steps
- Where possible limit step to one action; small final actions such as 'press submit' should be separated by a semicolon
- Limit the use of screenshots; where they are needed, use ReStructured text directives for substitution of images
- Use the 'raw ::html' directive to enter hyperlinks so that they will open in a new tab. See each repo for an example of the code
- Example data associated with documentation should be anonymously available on CyVerse Data Commons ([email protected] can help you with this)
- Discovery Environment applications should be directly linked to documentation (clicking the 'info' button on any application will give you the 'App URL')
- Atmosphere images should be directly linked to documentation (e.g. "atmo.cyverse.org/application/images/####"
Specific examples
Instruction | Example |
---|---|
Steps generally begin with a verb or preposition |
|
Locations of files are given in absolute paths |
|
Top-level menus in Discovery Environment Apps in double quotes |
|
Subheadings/steps in Discovery Environment Apps in single quotes |
|
Buttons and keywords in bold |
|
ALL materials with sample or test data on the Learning Center should be
available with anonymous/public read access at /iplant/home/shared/cyverse_training
/iplant/home/shared/cyverse_training:
C- /iplant/home/shared/cyverse_training/classrooms
C- /iplant/home/shared/cyverse_training/cyverse_austria_training
C- /iplant/home/shared/cyverse_training/datasets
C- /iplant/home/shared/cyverse_training/example
C- /iplant/home/shared/cyverse_training/manuals
C- /iplant/home/shared/cyverse_training/platform_guides
C- /iplant/home/shared/cyverse_training/quickstarts
C- /iplant/home/shared/cyverse_training/tutorials
C- /iplant/home/shared/cyverse_training/workshop_materials
In general, data should be in the appropriate manuals
,platform_guides
,
quickstarts
, tutorials
, or workshop_materials
folders.