Coder Social home page Coder Social logo

mahos / datajoint-docs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from datajoint/datajoint-docs-original

0.0 3.0 0.0 6.84 MB

Documentation https://docs.datajoint.io

License: Other

Makefile 0.39% CSS 63.71% Shell 0.06% Python 16.82% HTML 15.67% JavaScript 3.35%

datajoint-docs's Introduction

DataJoint Technical Reference

This repository contains the source for comprehensive technical reference documentation for the DataJoint framework.

All DataJoint documentations are presented at DataJoint documentation website. Documentation is generated using Sphinx with custom rendering theme largely based on the Read The Doc theme.

License

The documentation can be distributed for free use under the Creative Commons Attribution-ShareAlike 4.0 International Public License. Any copy or derivation of the documentation must include attribution to "DataJoint contributors" and include the URL reference https://docs.datajoint.io

Building All Versions (Full Site)

  1. Clone the repository to your local machine.
  2. The default setting will build using datajoint/datajoint-docs.git, datajoint/datajoint-matlab.git and datajoint/datajoint-python.git repo. If you'd like to change the repo that the build points to, modify the content of the build_config_template.py and rename the file to build_config.py (follow the instruction inside the template file for further instructions)
  3. Build the website by running python build-all.py. This will build and generate the static website in the full_site directory.
  • Note for Windows users: Please manually remove the build-all folder before running python build-all.py for building second time and on...
  1. Move inside the full_site folder and run the following command to launch a local web server:
    $ python3 -m http.server
    This should launch a HTTP server locally serving files from the full_site directory.
  2. Finally open up a web browser and navigate to http://localhost:8000 - you should see the built documentation page. The port (i.e. the number after the colon :) may differ - refer to the output of the command from the step above for the actual port to use.
  3. If you made changes to the documentation source but you're not seeing the changes reflected, that is because this command builds from contents that are already pushed and tagged in the git repository. Please build locally to test, and then push with updated version numbers to see the changes in the full_site building.
  4. To stop the server, hit Ctrl+C in the terminal window that's running the server.

Building Locally/Partially

  1. Fork and clone the repository to your local machine. Note: datajoint-docs now only contains the common documentions. If you are writing for a specific language, you also need to clone the datajoint-matlab or datajoint-python repository and make sure they are placed on the same level as the datajoint-docs folder.
  2. If you have the Python/MATLAB repository for local development/building and the folders aren't named datajoint-python/datajoint-matlab or have them somewhere other than on the same level as the datajoint-docs folder, open the build_config_template.py and set the new path inside, then rename the config file to build_config.py (follow the instruction inside the template file for further instructions)
  3. Build the website by running python build-local.py. This will build and generate the static website in the loc_built_site directory.
  • Note for Windows users: Please manually remove the build-local folder before running python build-local.py for building second time and on...
  • Note 1: python build-local.py defaults to building the most updated local common documentation. If you have both datajoint-matlab or datajoint-python folder locally on the same level, then this will build using those local folders (check and edit the build-config.py to make sure the local language folders are correctly placed). If you don't have a local language-specific folder, then it will still build using the most current lang-specific documentation on its respective git repository.
  • Note 2: If you want to test-build a specific language version locally, then add python/matlab_tag=(version) after the python build-local.py. For example, python build-local.py matlab_tag=v3.2.5 or python build-local.py python_tag=v0.9.4 and this should automatically grab the matching common version for building. Make sure you are specifying the full version tag (and not the abbreviated v3.2 in this case). Note 3: If for some reason, you don't want to build using the local common version, you can also build using the most updated common version on the git repository by running python build-local.py False or python build-local.py loc_comm=False. This is mostly likely not going to work well if you already have a pre-existing local language-specific folder.
  1. Move inside the loc_built_site folder and run the following command to launch a local web server:
    $ python3 -m http.server
    This should launch a HTTP server locally serving files from the loc_built_site directory.
  2. Finally open up a web browser and navigate to http://localhost:8000 - you should see the built documentation page. The port (i.e. the number after the colon :) may differ - refer to the output of the command from the step above for the actual port to use.
  3. To stop the server, hit Ctrl+C in the terminal window that's running the server.

Notes on Tagging

  1. Before you tag anything, please git tag to make sure you see the current tag status.
  2. In the datajoint-docs folder, build-version.json specifies which language versions to build in the build-all/full-build-mode. If you specify v3.2 in matlab, then the site will be built using the most recent tag (ex. v3.2.5 will be used to build, not v3.2.4).
  3. In the language-specific folder, all documentation contents are inside the /docs-parts directory. Inside, you will see a _version_common.json file, which should only contain one corresponding common version tag for this language folder to be build alongside. This file specifies the version (ex. v0.0) for the common version. Similar to the build process described above, if v0.0 is specified in the _version_common.json, then the most recent tag, for example v0.0.5 instead of v0.0.4 will be grabbed for the build.
    • to add a doc specific tag to datajoint-python or datajoint-matlab repo, make sure to add the -doc# ending: git tag -a v3.2.5-doc1 -m "some message". The # should be an integer.
    • to add a common doc tag to datajoint-docs repo, no special ending is necessary: git tag -a v0.0.1 -m "some message
    • to delete local tag: git tag -d v3.2.5-doc1
    • to delete already-pushed tag: git push origin :refs/tags/v3.2.5-doc1
    • to push with tag git push origin v0.0.3

Guidelines for Writing

  • For inserting a SQL code-block, be sure to use .. code-block:: mysql (and NOT SQL)

  • For inserting an image, make sure to put the image inside the contents/_static/img folder and refer to it using the image directive:

    .. image:: ../_static/img/pipeline.png
        :width: 250px
        :align: center
        :alt: A data pipeline

    Alternatively you can also use figure directive. For more information, refer to the documentation of image and/or figure directives.

  • For referring to a language-specific content, use .. include:: [FILENAME OF COMMON]_lang[#].rst

    • For example, if you are editing the RST file 01-autopopulate.rst inside of contents/computation then you would refer to language specific parts with .. include:: 01-autopopulate_lang1.rst and .. include:: 01-autopopulate_lang2.rst if you have 2 sections.

    • Then inside the language specific contents inside docs-parts folder in datajoint-matlab/datajoint-python, make sure to add a RST file with the same format as [FILENAME OF COMMON]_lang[#].rst. Following the previous example - inside of datajoint-matlab/docs-parts folder, you should put 01-autopopulate_lang1.rst and 01-autopopulate_lang2.rst inside the computation folder and do the same in inside the datajoint-python. For organization purposes, if one language has more includes than the other, it is recommended that you still keep an empty rst file as a placeholder inside the language that has less includes.

References

Sphinx restructured text reference

datajoint-docs's People

Contributors

austin-hilberg avatar dimitri-yatsenko avatar eywalker avatar ixcat avatar jakereimer avatar mahos avatar

Watchers

 avatar  avatar  avatar

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.