Skip to content

Commit b1a8e50

Browse files
p-mongop
andauthored
Local documentation builder modeled after the driver one (#260)
* Local documentation builder modeled after the driver one * add Makefile Co-authored-by: Oleg Pudeyev <[email protected]>
1 parent 1874911 commit b1a8e50

File tree

5 files changed

+96
-1
lines changed

5 files changed

+96
-1
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ tmp/*
1414
*.bundle
1515
*.so
1616
core
17-
Makefile
1817
.idea/
1918
*.gem
2019
perf/profile.rb
@@ -32,3 +31,4 @@ lib/*.jar
3231
.byebug_history
3332
.env
3433
.env.private*
34+
docs/_build

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 = .
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

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Ruby BSON Documentation
2+
=======================
3+
4+
This subdirectory contains the high-level driver documentation, including
5+
tutorials and the reference.
6+
7+
Building the documentation for publishing is done via the
8+
[docs-ruby repo](https://github.com/mongodb/docs-ruby).
9+
10+
To build the documentation locally for review, install `sphinx` and
11+
`sphinx-book-theme`, then execute `make html` in this directory:
12+
13+
pip install sphinx sphinx-book-theme
14+
make html
15+
16+
Note that the documentation generated in this manner wouldn't have the
17+
BSON documentation included, nor are intersphinx links currently handled.

docs/conf.py

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'Ruby BSON'
21+
copyright = '2021, MongoDB'
22+
23+
24+
# -- General configuration ---------------------------------------------------
25+
26+
# Add any Sphinx extension module names here, as strings. They can be
27+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
28+
# ones.
29+
extensions = [
30+
]
31+
32+
# Add any paths that contain templates here, relative to this directory.
33+
templates_path = ['_templates']
34+
35+
# List of patterns, relative to source directory, that match files and
36+
# directories to ignore when looking for source files.
37+
# This pattern also affects html_static_path and html_extra_path.
38+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
39+
40+
41+
# -- Options for HTML output -------------------------------------------------
42+
43+
# The theme to use for HTML and HTML Help pages. See the documentation for
44+
# a list of builtin themes.
45+
#
46+
html_theme = 'alabaster'
47+
48+
# Add any paths that contain custom static files (such as style sheets) here,
49+
# relative to this directory. They are copied after the builtin static files,
50+
# so a file named "default.css" will overwrite the builtin "default.css".
51+
html_static_path = ['_static']
52+
53+
source_suffix = {
54+
'.txt': 'restructuredtext',
55+
}
56+
57+
html_theme = 'sphinx_book_theme'

docs/index.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tutorials/bson-v4.txt

0 commit comments

Comments
 (0)