Skip to content

Commit

Permalink
setup wiki directory structure using Sphinx
Browse files Browse the repository at this point in the history
- add amFOSS favicon and logo
- add layout of documentation of CMS and Temple App projects
- import documentation on `Installation` and `Introduction to GraphQL` for CMS from GitBook
- import `Introduction` for Temple App from GitBook
- update README.md with installation instructions
  • Loading branch information
C-Anirudh committed Jun 25, 2020
1 parent f5af075 commit 680048a
Show file tree
Hide file tree
Showing 36 changed files with 391 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
venv/
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, 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)
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# amFOSS Wiki

amFOSS Wiki built with Sphinx using a theme provided by Read the Docs.

## :minidisc: Installation Instructions

### Install requirements on Linux

Before installing the `Sphinx` and `readthedocs.org` packages, you will need:
* the `python3` language and its `pip3` package manager
* a version of [GNU Make](https://www.gnu.org/software/make/),
* the [git tool](https://git-scm.com).

### Install requirements on Windows

Like on Linux environments, on Microsoft Windows, you need to install:
* the `python` language and its `pip` package manager
* All the `python` modules requirements with the `pip` command
* `GNU Make` tool.
* `git` tool.

### Installing Sphinx (every platform)

To build the HTML website (or any other format supported by Sphinx, like PDF, EPUB or LaTeX), you need to install [Sphinx](https://sphinx-doc.org/) >= 1.3 as well as (for the HTML) the [readthedocs.org theme](https://github.com/snide/sphinx_rtd_theme).

Those tools are best installed using [pip](https://pip.pypa.io), Python's module installer. The Python 3 version might be provided (on Linux distros) as `pip3` or `python3-pip`.

Clone the repository

```sh
$ git clone https://gitlab.com/amfoss/wiki.git
$ cd wiki
```

Create a python3 virtualenv, and activate the environment

```sh
$ virtualenv -p python3 venv
$ source venv/bin/activate
```

You can then run:

```sh
$ pip3 install -r requirements.txt
```

### Building the HTML website

You can then build the HTML documentation from the root folder of this repository with:

```sh
$ make html
```

On Windows, building is still done at the root folder of this repository using the following command (`make` linux command is replaced with `make.exe`):
```sh
$ make.exe html
```

You can then test the changes live by opening `build/html/index.html` in your favorite browser.

**Debugging Tip:**
- Delete the build cache before building documents if you make changes in the code by running the command `make clean` or using the `sphinx-build -E` option.
35 changes: 35 additions & 0 deletions 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.https://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
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sphinx==2.2.0
sphinx-rtd-theme==0.4.3
Binary file added source/_static/images/amfoss_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/images/favicon.ico
Binary file not shown.
76 changes: 76 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- 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('.'))
import sphinx_rtd_theme

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

project = 'amFOSS Wiki'
copyright = '2020, amFOSS'
author = 'amFOSS'

gitlab_url = 'https://gitlab.com/amfoss/wiki'

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

# 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_rtd_theme",
]

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

# 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 = []


# -- 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_options = {
'canonical_url': '',
'logo_only': False,
'display_version': True,
'prev_next_buttons_location': 'bottom',
'style_external_links': True,
#'style_nav_header_background': 'white',
# Toc options
'collapse_navigation': False,
'sticky_navigation': True,
'navigation_depth': -1,
'includehidden': True,
'titles_only': False
}

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

html_logo = '_static/images/amfoss_logo.png'

html_favicon = '_static/images/favicon.ico'

html_use_index = True

14 changes: 14 additions & 0 deletions source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. amFOSS Wiki documentation master file, created by
sphinx-quickstart on Thu Jun 25 01:38:36 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to amFOSS documentation!
================================

.. toctree::
:maxdepth: -1

projects/index


2 changes: 2 additions & 0 deletions source/projects/CMS/API/attendance-api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
attendance APIs
===============
2 changes: 2 additions & 0 deletions source/projects/CMS/API/authentication-api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Authentication APIs
===================
2 changes: 2 additions & 0 deletions source/projects/CMS/API/gallery-api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Gallery APIs
============
13 changes: 13 additions & 0 deletions source/projects/CMS/API/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
APIs
====

.. toctree::
:maxdepth: -1

authentication-api
attendance-api
status-update-api
registration-api
members-api
gallery-api

2 changes: 2 additions & 0 deletions source/projects/CMS/API/members-api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Members APIs
============
2 changes: 2 additions & 0 deletions source/projects/CMS/API/registration-api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Registration APIs
=================
2 changes: 2 additions & 0 deletions source/projects/CMS/API/status-update-api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Status Update APIs
==================
2 changes: 2 additions & 0 deletions source/projects/CMS/deployment-guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Deployment Guide
================
10 changes: 10 additions & 0 deletions source/projects/CMS/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CMS
===

.. toctree::
:maxdepth: -1

installation
deployment-guide
intro-to-graphql
API/index
41 changes: 41 additions & 0 deletions source/projects/CMS/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Installation
============

The portal is primarily a django based application, and to set it up we
require to have python environment with django and other project
dependencies installed. Though one can work with the project without an
virtual environment, it is recommended to use one so as to avoid
conflicts with other projects.

1. Make sure that you have ``Python 3``, ``python-3-devel``, ``gcc``,
``virtualenv``, and ``pip`` installed.
2. Clone the repository

.. code:: bash
$ git clone https://github.com/amfoss/cms.git
$ cd cms
3. Create a python 3 virtualenv, and activate the environment.

.. code:: bash
$ virtualenv -p python3 .
$ source bin/activate
4. Install the project dependencies from ``requirements.txt``

.. code:: bash
$ pip install -r requirements.txt
After Setting up
----------------

From now when you start your work, run ``source bin/activate`` inside
the project repository and you can work with the django application as
usual - - ``python manage.py migrate`` - set up database -
``python manage.py createsuperuser`` - create admin user -
``python manage.py runserver`` - run the project locally

*Make sure you pull new changes from remote regularly.*
29 changes: 29 additions & 0 deletions source/projects/CMS/intro-to-graphql.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Introduction to GraphQL
=======================

amFOSS CMS is based on GraphQL API. GraphQL is a query language which
offers much more flexibility for integrations. It allows you to request
the exact data you need, cutting down the number of calls you must
perform to get it. The availability of all data at one endpoint is also
the biggest advantage of GraphQL over the REST API (which has an
endpoint for each resource object).

There are two types of GraphQL APIs 1. Query 2. Mutation

Our API provides types of operations:

- Public APIs
- User APIs
- Admin APIs

Click `here`_ to preview the API.

To learn more about GraphQL language and its concepts, see the official
GraphQL `website`_.

The endpoint remains constant regardless of the operation you perform.
Requests must be sent using the ``POST`` method and ``application/json``
content type.

.. _here: https://api.amfoss.in/
.. _website: https://graphql.org/
8 changes: 8 additions & 0 deletions source/projects/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Projects
========

.. toctree::
:maxdepth: -1

CMS/index
temple-app/index
2 changes: 2 additions & 0 deletions source/projects/temple-app/API/authentication.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Authentication
==============
2 changes: 2 additions & 0 deletions source/projects/temple-app/API/dependencies.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dependencies
============
9 changes: 9 additions & 0 deletions source/projects/temple-app/API/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
API
===

.. toctree::
:maxdepth: -1

technical-overview
authentication
dependencies
2 changes: 2 additions & 0 deletions source/projects/temple-app/API/technical-overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Technical Overview
==================
2 changes: 2 additions & 0 deletions source/projects/temple-app/app-working/features.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Features
========
9 changes: 9 additions & 0 deletions source/projects/temple-app/app-working/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
How Temple App Works
====================

.. toctree::
:maxdepth: -1

workflow
selecting-activity
features
2 changes: 2 additions & 0 deletions source/projects/temple-app/app-working/selecting-activity.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Selecting Activity
==================
2 changes: 2 additions & 0 deletions source/projects/temple-app/app-working/workflow.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Workflow
========
Loading

0 comments on commit 680048a

Please sign in to comment.