Skip to content

Commit ed2bce7

Browse files
committed
add sphinx documentation for reactonite
1 parent 93efe43 commit ed2bce7

16 files changed

+362
-55
lines changed

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Refer `https://medium.com/better-programming/auto-documenting-a-python-project-using-sphinx-8878f9ddc6e9`

docs/make.bat

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/requirements.txt

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
alabaster==0.7.12
2+
Babel==2.8.0
3+
certifi==2020.6.20
4+
chardet==3.0.4
5+
colorama==0.4.4
6+
docutils==0.16
7+
idna==2.10
8+
imagesize==1.2.0
9+
Jinja2==2.11.2
10+
MarkupSafe==1.1.1
11+
packaging==20.4
12+
Pygments==2.7.2
13+
pyparsing==2.4.7
14+
pytz==2020.4
15+
requests==2.24.0
16+
six==1.15.0
17+
snowballstemmer==2.0.0
18+
Sphinx==3.3.0
19+
sphinx-rtd-theme==0.5.0
20+
sphinxcontrib-applehelp==1.0.2
21+
sphinxcontrib-devhelp==1.0.2
22+
sphinxcontrib-htmlhelp==1.0.3
23+
sphinxcontrib-jsmath==1.0.1
24+
sphinxcontrib-qthelp==1.0.3
25+
sphinxcontrib-serializinghtml==1.1.4
26+
urllib3==1.25.11

docs/source/conf.py

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
16+
sys.path.insert(0, os.path.abspath('../../reactonite'))
17+
18+
19+
# -- Project information -----------------------------------------------------
20+
21+
project = 'Reactonite'
22+
copyright = '2020, Reactonite'
23+
author = 'Reactonite'
24+
25+
# The full version, including alpha/beta/rc tags
26+
release = '0.0.1'
27+
28+
29+
# -- General configuration ---------------------------------------------------
30+
31+
# Add any Sphinx extension module names here, as strings. They can be
32+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33+
# ones.
34+
extensions = [
35+
'sphinx.ext.autodoc',
36+
'sphinx.ext.napoleon'
37+
]
38+
39+
# Add any paths that contain templates here, relative to this directory.
40+
templates_path = ['_templates']
41+
42+
# List of patterns, relative to source directory, that match files and
43+
# directories to ignore when looking for source files.
44+
# This pattern also affects html_static_path and html_extra_path.
45+
exclude_patterns = ['./../../reactonite/main.py']
46+
47+
48+
# -- Options for HTML output -------------------------------------------------
49+
50+
# The theme to use for HTML and HTML Help pages. See the documentation for
51+
# a list of builtin themes.
52+
#
53+
html_theme = 'sphinx_rtd_theme'
54+
55+
# Add any paths that contain custom static files (such as style sheets) here,
56+
# relative to this directory. They are copied after the builtin static files,
57+
# so a file named "default.css" will overwrite the builtin "default.css".
58+
html_static_path = ['_static']

docs/source/index.rst

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
.. Reactonite documentation master file, created by
2+
sphinx-quickstart on Fri Nov 6 17:32:22 2020.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to Reactonite's documentation!
7+
======================================
8+
9+
About The Project
10+
-----------------
11+
12+
Reactonite is a free and open source wrapper for react which lets a
13+
person write vanilla html code and convert it to a react code easily,
14+
hence building a PWA, SPA ✨
15+
16+
Here's the key features added to Reactonite:
17+
18+
- Transpile HTML code to React website
19+
- Create PWAs and React applications as quickly as possible
20+
- Act as a wrapper to NPM
21+
- Allow importing of already created HTML file components
22+
- Hot Reloading
23+
- Support custom scss, styled-components, material icons etc.
24+
25+
26+
Getting Started
27+
---------------
28+
29+
To get this repo up and running on your local machine follow these
30+
simple steps.
31+
32+
Prerequisites
33+
-------------
34+
35+
Here's a list of things you'll need to have prior to installing the
36+
software.
37+
38+
- Python
39+
- NPM
40+
- NodeJs
41+
- Any modern web browser
42+
43+
Installation
44+
------------
45+
46+
1. Setup virtual environment?
47+
48+
.. code:: sh
49+
50+
$ virtualenv venv
51+
52+
> Not necessary but recommended to keep your environment clean.
53+
> Dont forget to activate it.
54+
55+
2. Clone the repository to local machine.
56+
57+
.. code:: sh
58+
59+
$ git clone https://github.com/SDOS2020/Team_3_Reactonite.git
60+
61+
3. Install the package either using pip or python setup tools
62+
63+
.. code:: sh
64+
65+
$ python setup.py install
66+
# Use `develop` instead of `install` to get an editable build
67+
68+
# Alternatively run
69+
$ pip install .
70+
71+
4. You are good to go... 🎉
72+
73+
74+
Usage
75+
-----
76+
77+
Once installed here are the commands that will allow you to create
78+
Reactonite projects.
79+
80+
``reactonite --help``
81+
~~~~~~~~~~~~~~~~~~~~~
82+
83+
Opens the help page for ``reactonite`` commandline.
84+
85+
.. code:: sh
86+
87+
$ reactonite --help
88+
Usage: reactonite [OPTIONS] COMMAND [ARGS]...
89+
90+
Options:
91+
--help Show this message and exit.
92+
93+
Commands:
94+
create-project
95+
watch
96+
97+
``reactonite create-project PROJECT_NAME``
98+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99+
100+
Creates a reactonite app project with required directory structure.
101+
Change ``PROJECT_NAME`` to your app name.
102+
103+
.. code:: sh
104+
105+
$ reactonite create-project my-new-project
106+
107+
108+
.. toctree::
109+
:maxdepth: 4
110+
:caption: Contents:
111+
112+
modules
113+
114+
115+
Indices and tables
116+
==================
117+
118+
* :ref:`genindex`
119+
* :ref:`modindex`
120+
* :ref:`search`

docs/source/modules.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
reactonite
2+
==========
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
reactonite

docs/source/reactonite.rst

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
reactonite package
2+
==================
3+
4+
Submodules
5+
----------
6+
7+
reactonite.config module
8+
------------------------
9+
10+
.. automodule:: reactonite.config
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
reactonite.helpers module
16+
-------------------------
17+
18+
.. automodule:: reactonite.helpers
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
reactonite.main module
24+
----------------------
25+
26+
.. automodule:: reactonite.main
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
reactonite.node\_wrapper module
32+
-------------------------------
33+
34+
.. automodule:: reactonite.node_wrapper
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
39+
reactonite.transpiler module
40+
----------------------------
41+
42+
.. automodule:: reactonite.transpiler
43+
:members:
44+
:undoc-members:
45+
:show-inheritance:
46+
47+
reactonite.watcher module
48+
-------------------------
49+
50+
.. automodule:: reactonite.watcher
51+
:members:
52+
:undoc-members:
53+
:show-inheritance:
54+
55+
Module contents
56+
---------------
57+
58+
.. automodule:: reactonite
59+
:members:
60+
:undoc-members:
61+
:show-inheritance:
File renamed without changes.

reactonite/config.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ class DEFAULTS:
1919
Parser to be used for transpilation.
2020
"""
2121

22-
INIT_FILES_DIR = 'init_src_dir'
23-
SRC_DIR = 'src'
24-
DEST_DIR = 'dist'
25-
STATIC_DIR = 'static'
26-
HTML_FILE_PATH = 'index.html'
27-
CONFIG_FILE_PATH = 'config.json'
28-
BS_PARSER = 'html.parser'
22+
def __init__(self):
23+
self.INIT_FILES_DIR = 'init_src_dir'
24+
self.SRC_DIR = 'src'
25+
self.DEST_DIR = 'dist'
26+
self.STATIC_DIR = 'static'
27+
self.HTML_FILE_PATH = 'index.html'
28+
self.CONFIG_FILE_PATH = 'config.json'
29+
self.BS_PARSER = 'html.parser'

0 commit comments

Comments
 (0)