Skip to content

Commit 2588c0e

Browse files
Adds documentation in ReadTheDocs platform (citusdata#196)
* Adds initial documentation files * Adds remaining documentation files * Updates requirements dependencies * Adds the readthedocs.yml * Updates the documentation * Adds document for APIs * Adds ignores * Adds copy instructions for static files * Adds static files * Adds documentation checks * Adds compilation steps in contributing file
1 parent 99b5af2 commit 2588c0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+13926
-2
lines changed

.github/workflows/active-record-multi-tenant-tests.yml

+14
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ jobs:
2323
run: |
2424
gem install rubocop
2525
rubocop
26+
doc_checks:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/setup-python@v4
30+
with:
31+
python-version: 3.9
32+
- uses: actions/checkout@v3
33+
- name: Install python dependencies
34+
run: |
35+
pip install -r docs/requirements.txt
36+
- name: Documentation Checks
37+
run: |
38+
cd docs
39+
sphinx-build -W -b html source builds
2640
2741
build:
2842
runs-on: ubuntu-latest

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ Gemfile.lock
88
.vagrant/
99
Vagrantfile
1010
coverage/
11+
docs/build/
12+
.yardoc/

.readthedocs.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-22.04"
5+
tools:
6+
python: "3.11"
7+
8+
# Build from the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: docs/source/conf.py
11+
12+
# Explicitly set the version of Python and its requirements
13+
python:
14+
install:
15+
- requirements: docs/requirements.txt

docs/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore everything in this directory
2+
.yardoc/*
3+

docs/Makefile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
# New target that executes the bash script before calling the original target
18+
build-docs: pre-build # Change 'html' to the target you want to execute
19+
20+
pre-build:
21+
# Execute your bash script here
22+
bash api-reference.sh
23+
24+
# Catch-all target: route all unknown targets to Sphinx using the new
25+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
26+
html:
27+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
28+

docs/api-reference.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# This script is used to generate the API reference documentation for the
4+
# project. It is intended to be run from the root of the project directory.
5+
# It requires the following tools to be installed:
6+
# - yard (gem install yard)
7+
echo "Generating API reference documentation..."
8+
echo "Pwd: $(pwd)"
9+
cd ..
10+
yard doc --output-dir docs/source/_static/api-reference

docs/requirements.in

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sphinxnotes-strike
2+
sphinx
3+
sphinx_rtd_theme
4+
readthedocs-sphinx-search

docs/requirements.txt

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.10
3+
# by the following command:
4+
#
5+
# pip-compile requirements.in
6+
#
7+
alabaster==0.7.13
8+
# via sphinx
9+
babel==2.12.1
10+
# via sphinx
11+
certifi==2023.5.7
12+
# via requests
13+
charset-normalizer==3.1.0
14+
# via requests
15+
docutils==0.18.1
16+
# via
17+
# sphinx
18+
# sphinx-rtd-theme
19+
idna==3.4
20+
# via requests
21+
imagesize==1.4.1
22+
# via sphinx
23+
jinja2==3.1.2
24+
# via sphinx
25+
markupsafe==2.1.2
26+
# via jinja2
27+
packaging==23.1
28+
# via sphinx
29+
pygments==2.15.1
30+
# via sphinx
31+
readthedocs-sphinx-search==0.3.1
32+
# via -r requirements.in
33+
requests==2.31.0
34+
# via sphinx
35+
snowballstemmer==2.2.0
36+
# via sphinx
37+
sphinx==6.2.1
38+
# via
39+
# -r requirements.in
40+
# sphinx-rtd-theme
41+
# sphinxcontrib-jquery
42+
# sphinxnotes-strike
43+
sphinx-rtd-theme==1.2.1
44+
# via -r requirements.in
45+
sphinxcontrib-applehelp==1.0.4
46+
# via sphinx
47+
sphinxcontrib-devhelp==1.0.2
48+
# via sphinx
49+
sphinxcontrib-htmlhelp==2.0.1
50+
# via sphinx
51+
sphinxcontrib-jquery==4.1
52+
# via sphinx-rtd-theme
53+
sphinxcontrib-jsmath==1.0.1
54+
# via sphinx
55+
sphinxcontrib-qthelp==1.0.3
56+
# via sphinx
57+
sphinxcontrib-serializinghtml==1.1.5
58+
# via sphinx
59+
sphinxnotes-strike==1.2
60+
# via -r requirements.in
61+
urllib3==2.0.2
62+
# via requests
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>
7+
Module: ActiveRecord
8+
9+
&mdash; Documentation by YARD 0.9.34
10+
11+
</title>
12+
13+
<link rel="stylesheet" href="css/style.css" type="text/css" />
14+
15+
<link rel="stylesheet" href="css/common.css" type="text/css" />
16+
17+
<script type="text/javascript">
18+
pathId = "ActiveRecord";
19+
relpath = '';
20+
</script>
21+
22+
23+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24+
25+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26+
27+
28+
</head>
29+
<body>
30+
<div class="nav_wrap">
31+
<iframe id="nav" src="class_list.html?1"></iframe>
32+
<div id="resizer"></div>
33+
</div>
34+
35+
<div id="main" tabindex="-1">
36+
<div id="header">
37+
<div id="menu">
38+
39+
<a href="_index.html">Index (A)</a> &raquo;
40+
41+
42+
<span class="title">ActiveRecord</span>
43+
44+
</div>
45+
46+
<div id="search">
47+
48+
<a class="full_list_link" id="class_list_link"
49+
href="class_list.html">
50+
51+
<svg width="24" height="24">
52+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55+
</svg>
56+
</a>
57+
58+
</div>
59+
<div class="clear"></div>
60+
</div>
61+
62+
<div id="content"><h1>Module: ActiveRecord
63+
64+
65+
66+
</h1>
67+
<div class="box_info">
68+
69+
70+
71+
72+
73+
74+
75+
76+
77+
78+
79+
<dl>
80+
<dt>Defined in:</dt>
81+
<dd>lib/activerecord-multi-tenant/habtm.rb<span class="defines">,<br />
82+
lib/activerecord-multi-tenant/query_rewriter.rb,<br /> lib/activerecord-multi-tenant/migrations.rb,<br /> lib/activerecord-multi-tenant/migrations.rb</span>
83+
</dd>
84+
</dl>
85+
86+
</div>
87+
88+
<h2>Overview</h2><div class="docstring">
89+
<div class="discussion">
90+
91+
<p>This module extension is a monkey patch to the ActiveRecord::Associations::ClassMethods module. It overrides the has_and_belongs_to_many method to add the tenant_id to the join table if the tenant_enabled option is set to true.</p>
92+
93+
94+
</div>
95+
</div>
96+
<div class="tags">
97+
98+
99+
</div><h2>Defined Under Namespace</h2>
100+
<p class="children">
101+
102+
103+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="ActiveRecord/Associations.html" title="ActiveRecord::Associations (module)">Associations</a></span>, <span class='object_link'><a href="ActiveRecord/ConnectionAdapters.html" title="ActiveRecord::ConnectionAdapters (module)">ConnectionAdapters</a></span>, <span class='object_link'><a href="ActiveRecord/QueryMethods.html" title="ActiveRecord::QueryMethods (module)">QueryMethods</a></span>
104+
105+
106+
107+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="ActiveRecord/SchemaDumper.html" title="ActiveRecord::SchemaDumper (class)">SchemaDumper</a></span>
108+
109+
110+
</p>
111+
112+
113+
114+
115+
116+
117+
118+
119+
120+
</div>
121+
122+
<div id="footer">
123+
Generated on Sat May 27 10:16:23 2023 by
124+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
125+
0.9.34 (ruby-3.2.2).
126+
</div>
127+
128+
</div>
129+
</body>
130+
</html>

0 commit comments

Comments
 (0)