Giter VIP home page Giter VIP logo

scipiondocs's Introduction

scipion logo

Welcome to Scipion's documentation!

You can find the last built docs on https://scipion-em.github.io/docs/

Scipion documentation

Scipion's documentation is built using Sphinx and hosted on GitHub pages. Sphinx uses certain files like *.rst files and Sphinx's config conf.py to build the docs on HTML, which we can later copy to some server. In our case, we the different versions of our docs on the docs GitHub repository . At the time of this writing we have only one version, the branch release-3.0.0, but we'll have more versions in the future. The branch gh-pages contains the built documentation for all versions (i.e. HTML files). When new commits are pushed to this branch,

will update and reflect them automatically.

On a high level, the docs have two main parts:

Installing and building the docs

From the root folder of this repo type

scipion3 run pip install -r requirements.txt
scipion3 run sphinx-multiversion . build

Documentation is generated by branch, currently we are dealing just with release-3.0.0 so you'll find it here:

build/release-3.0.0/index.html

Alternative you could locally run to verify build is ok:

scipion3 run sphinx-build . build/<your-branch>

Generate API docs

The api docs are contained in the folder api of the scipion docs repository. To update them, we need to run sphinx-apidoc. Please note that this step is not necessary if you're just adding your own written .rst file.

We can set this up as a run configuration in PyCharm (Recommended):

Sphinx apidoc in pycharm

Or alternatively, run this in the command line inside scipion-docs repo dir:

(sphinx-env) $ sphinx-apidoc -f -e -o api/ ~/git/scipion/pyworkflow ~/git/scipion/pyworkflow/tests/*
  • -f forces to overwrite existing files
  • -e generates one rst file per module
  • api/ put output files here
  • ~/git/scipion/pyworkflow is the source python code we want to generate docs for
  • ~/git/scipion/pyworkflow/tests/* avoid generating docs for files matching this pattern.

Resources and tips

  1. You can reference python objects!! E.g. :class:`The plugin class<pyworkflow.plugin.Plugin>`. For more info check the sphinx guide on how to reference python objects
  2. You can install and use `pandoc<https://pandoc.org/>`_ to convert from Markdown (.md) to .rst
  3. The custom css is at _static/custom.css. To connect the css to a build documentation do:
rm build/release-3.0.0/_static/custom.css
ln -s _static/custom.css build/release-3.0.0/_static/
  1. Finding targets:
scipion3 run python -m sphinx.ext.intersphinx build/release-3.0.0/objects.inv

5.- Linking to other sections in other pages, use ref tag:

:ref:`project.newProtocol() <pyworkflow.project.project.Project.newProtocol>`

6.- Linking to pages: Although the rst link will work for the final build, they will not work for a local build

` link text <page_identifier>`_

It is better to use:

:doc:`link text <page_identifier>`
7.- Linking contained PDFs.
PDFs are not built and has to be treated separately. First, place the PDF at _static/pdfs/my-new.pdf Then, link it relative to your page, e.g.:
`my-new.pdf <../../_static/pdfs/my-new.pdf>`__

8.- Process a single file

scipion3 run sphinx-build .  build docs/developer/symmetries.rst

will only update the "symmetry" page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.