Skip to content

Commit d022a99

Browse files
DOCSP-1996 - Initial repo setup and rST-ified provided install instructions.
1 parent 7e10a84 commit d022a99

File tree

12 files changed

+491
-1
lines changed

12 files changed

+491
-1
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
build/*
2+
*.swp
3+
.#*
4+
\#*#
5+
*__pycache__*
6+
*.pyc
7+
*.pyo
8+
*.bak
9+
.DS_Store
10+
giza.log

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
2+
USER=$(shell whoami)
3+
4+
STAGING_URL="https://docs-mongodborg-staging.corp.mongodb.com"
5+
STAGING_BUCKET=docs-mongodb-org-staging
6+
7+
PRODUCTION_URL="https://docs.mongodb.com"
8+
PRODUCTION_BUCKET=
9+
10+
PROJECT=charts
11+
12+
.PHONY: help html stage publish deploy-search-index publish
13+
14+
help: ## Show this help message
15+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
16+
@echo
17+
@echo 'Variables'
18+
@printf " \033[36m%-18s\033[0m %s\n" 'ARGS' 'Arguments to pass to mut-publish'
19+
20+
html: ## Builds the html files
21+
giza make html
22+
23+
stage: ## Host online for review
24+
mut-publish build/${GIT_BRANCH}/html ${STAGING_BUCKET} --prefix=${PROJECT} --stage ${ARGS}
25+
@echo "Hosted at ${STAGING_URL}/${PROJECT}/${USER}/${GIT_BRANCH}/index.html"
26+
27+
publish: ## Builds this branch's publishable HTML and other artifacts under build/public
28+
giza make publish
29+
if [ ${GIT_BRANCH} = master ]; then mut-redirects config/redirects -o build/public/.htaccess; fi
30+
31+
deploy-search-index: ## Update the search index for this branch
32+
@echo "Building search index"
33+
mut-index upload build/public -o ${PROJECT}-${GIT_BRANCH}.json -u ${PRODUCTION_URL}/${PROJECT} -g -s

README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

conf.py

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# MongoDB documentation build configuration file, created by
4+
# sphinx-quickstart on Mon Oct 3 09:58:40 2011.
5+
#
6+
# This file is execfile()d with the current directory set to its containing dir.
7+
8+
import sys
9+
import os
10+
import datetime
11+
import logging
12+
13+
from giza.config.runtime import RuntimeStateConfig
14+
from giza.content.replacements import get_replacements
15+
from giza.config.helper import fetch_config
16+
17+
logging.basicConfig(level=logging.INFO)
18+
conf = fetch_config(RuntimeStateConfig())
19+
sconf = conf.system.files.data.sphinx_local
20+
21+
project_root = os.path.join(os.path.abspath(os.path.dirname(__file__)))
22+
sys.path.append(project_root)
23+
24+
sys.path.append(os.path.join(conf.paths.projectroot, conf.paths.buildsystem, 'sphinxext'))
25+
26+
# -- General configuration ----------------------------------------------------
27+
28+
needs_sphinx = '1.0'
29+
30+
extensions = [
31+
'sphinx.ext.extlinks',
32+
'sphinx.ext.todo',
33+
'mongodb',
34+
'directives',
35+
'intermanual',
36+
]
37+
38+
locale_dirs = [os.path.join(conf.paths.projectroot, conf.paths.locale)]
39+
gettext_compact = False
40+
41+
templates_path = ['.templates']
42+
exclude_patterns = []
43+
44+
source_suffix = '.txt'
45+
46+
master_doc = sconf.master_doc
47+
language = 'en'
48+
project = sconf.project
49+
copyright = u'2011-{0}'.format(datetime.date.today().year)
50+
version = conf.version.branch
51+
release = conf.version.release
52+
53+
rst_epilog = [
54+
'.. include:: {0}/hash.rst'.format(conf.paths.includes[len(conf.paths.source):]),
55+
'.. |copy| unicode:: U+000A9',
56+
'.. |arrow| unicode:: U+27A4',
57+
'.. |charts| replace:: MongoDB Charts',
58+
'.. |charts-short| replace:: Charts',
59+
'.. |checkmark| unicode:: U+2713',
60+
]
61+
62+
rst_epilog.extend(get_replacements(conf))
63+
rst_epilog = '\n'.join(rst_epilog)
64+
65+
pygments_style = 'sphinx'
66+
67+
extlinks = {
68+
'issue': ('https://jira.mongodb.org/browse/%s', ''),
69+
'manual': ('http://docs.mongodb.org/manual%s', ''),
70+
}
71+
72+
# add `extlinks` for each published version.
73+
for i in conf.git.branches.published:
74+
extlinks[i] = (''.join([conf.project.url, '/', i, '%s']), '')
75+
76+
intersphinx_mapping = {}
77+
for i in conf.system.files.data.intersphinx:
78+
intersphinx_mapping[i.name] = (i.url, os.path.join(conf.paths.projectroot,
79+
conf.paths.output,
80+
i.path))
81+
# -- Options for HTML output ---------------------------------------------------
82+
83+
html_theme = sconf.theme.name
84+
html_theme_path = [os.path.join(conf.paths.buildsystem, 'themes')]
85+
html_title = conf.project.title
86+
htmlhelp_basename = 'MongoDB'
87+
88+
html_logo = sconf.logo
89+
html_static_path = sconf.paths.static
90+
91+
html_copy_source = False
92+
html_domain_indices = True
93+
html_use_index = True
94+
html_split_index = False
95+
html_show_sourcelink = False
96+
html_show_sphinx = True
97+
html_show_copyright = True
98+
99+
manual_edition_path = '/.'.join([conf.project.url,
100+
conf.git.branches.current,
101+
sconf.theme.book_path_base])
102+
103+
html_theme_options = {
104+
'branch': conf.git.branches.current,
105+
'translations': [],
106+
'language': language,
107+
'repo_name': sconf.theme.repo,
108+
'jira_project': sconf.theme.jira,
109+
'google_analytics': sconf.theme.google_analytics,
110+
'project': sconf.theme.project,
111+
'version': version,
112+
'sitename': sconf.theme.sitename,
113+
'nav_excluded': sconf.theme.nav_excluded,
114+
'is_upcoming' : False,
115+
'is_private': True,
116+
'privacy_warning': "MongoDB Charts is currently approved for internal use only, and is not to be distributed to any customer, prospect, or user outside of MongoDB.",
117+
}
118+
119+
html_sidebars = sconf.sidebars
120+
121+

config/build_conf.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
git:
2+
repo: '10gen/docs-charts'
3+
remote:
4+
upstream: '10gen/docs-charts'
5+
tools: 'mongodb/docs-tools'
6+
project:
7+
name: 'charts'
8+
tag: 'charts'
9+
url: 'https://docs.mongodb.com/charts'
10+
title: 'Charts Manual'
11+
branched: true
12+
version:
13+
release: 'alpha'
14+
branch: 'alpha'
15+
system:
16+
runstate:
17+
serial_sphinx: publish
18+
files:
19+
- 'intersphinx.yaml'
20+
- 'integration.yaml'
21+
- 'sphinx_local.yaml'
22+
- 'push.yaml'
23+
assets:
24+
- branch: master
25+
path: build/docs-tools
26+
repository: https://github.com/mongodb/docs-tools.git
27+
paths:
28+
output: 'build'
29+
source: 'source'
30+
includes: 'source/includes'
31+
images: 'source/images'
32+
tools: 'bin'
33+
buildsystem: 'build/docs-tools'
34+
builddata: 'config'
35+
locale: 'locale'
36+
...

config/integration.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
base:
2+
links:
3+
- { }
4+
targets:
5+
- 'html'
6+
- 'dirhtml'
7+
doc-root:
8+
- 'sitemap.xml'
9+
- '.htaccess'
10+
branch-root: []

config/intersphinx.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Weirdly, giza wants a non-empty list of two or more, so we have to include extraneous/unused one --hence the python
2+
name: python
3+
url: https://docs.python.org/2/
4+
path: python2.inv
5+
---
6+
name: mongodb
7+
url: https://docs.mongodb.com/manual/
8+
path: mongodb.inv
9+
...

config/push.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Apparently, giza requires this file, even if empty
2+
### Must include ref to this file in the build_conf.yaml

config/sphinx.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# The items in the ``builders`` list are the name of Sphinx builders
2+
# supported by ``sphinx-build``.
3+
#
4+
# The ``prerequsites`` list stores all targets that must build before
5+
# sphinx can begin.
6+
#
7+
# The ``generated-source`` list stores all the targets that generate rst.
8+
9+
10+
prerequisites:
11+
- setup
12+
- intersphinx
13+
- generate-source
14+
generated-source:
15+
- tables
16+
- api
17+
- toc
18+
- intersphinx
19+
- images
20+
### --- ####
21+
web-base:
22+
tags:
23+
- web
24+
### --- ####
25+
dirhtml:
26+
builder: dirhtml
27+
inherit: web-base
28+
html:
29+
builder: html
30+
inherit: web-base
31+
...

config/sphinx_local.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
project: 'charts-manual'
2+
master_doc: 'index'
3+
logo: ".static/logo.png"
4+
paths:
5+
static: ['source/.static']
6+
theme:
7+
name: 'meta-driver'
8+
project: 'charts'
9+
google_analytics: 'UA-7301842-8'
10+
book_path_base: 'charts'
11+
repo: 'docs-charts'
12+
jira: 'DOCS'
13+
sitename: 'Charts'
14+
nav_excluded:
15+
- /workload-analyzer
16+
- /recommend
17+
- /transformation
18+
19+
sidebars:
20+
'**':
21+
- 'pagenav.html'
22+
...

0 commit comments

Comments
 (0)