Skip to content

Commit

Permalink
DOCSP-4925: repo setup
Browse files Browse the repository at this point in the history
  • Loading branch information
schmalliso committed Apr 26, 2022
1 parent 4a5d194 commit caf97cb
Show file tree
Hide file tree
Showing 11 changed files with 398 additions and 0 deletions.
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
USER=$(shell whoami)
STAGING_URL="https://docs-mongodborg-staging.corp.mongodb.com"
PRODUCTION_URL="https://docs.mongodb.com"
STAGING_BUCKET=docs-mongodb-org-staging
PRODUCTION_BUCKET=
PROJECT=kafka-connector

# Parse our published-branches configuration file to get the name of
# the current "stable" branch. This is weird and dumb, yes.
STABLE_BRANCH=`grep 'manual' build/docs-tools/data/${PROJECT}-published-branches.yaml | cut -d ':' -f 2 | grep -Eo '[0-9a-z.]+'`

.PHONY: help html publish stage deploy deploy-search-index redirects

help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
@echo
@echo 'Variables'
@printf " \033[36m%-18s\033[0m %s\n" 'ARGS' 'Arguments to pass to mut-publish'

html: ## Builds this branch's HTML under build/<branch>/html
giza make html

publish: ## Builds this branch's publishable HTML and other artifacts under build/public
giza make publish
if [ ${GIT_BRANCH} = master ]; then mut-redirects config/redirects -o build/public/.htaccess; fi

stage: ## Host online for review
mut-publish build/${GIT_BRANCH}/html ${STAGING_BUCKET} --prefix=${PROJECT} --stage ${ARGS}
@echo "Hosted at ${STAGING_URL}/${PROJECT}/${USER}/${GIT_BRANCH}/index.html"

deploy: build/public ## Deploy to the production bucket
mut-publish build/public ${PRODUCTION_BUCKET} --prefix=${PROJECT} --deploy --redirect-prefix='kafka-connector' ${ARGS}

@echo "Hosted at ${PRODUCTION_URL}/${PROJECT}/index.html"

$(MAKE) deploy-search-index

deploy-search-index: ## Update the search index for this branch
@echo "Building search index"
if [ ${STABLE_BRANCH} = ${GIT_BRANCH} ]; then \
mut-index upload build/public/${GIT_BRANCH} -o kafka-connector-current.json --aliases kafka-connector-${GIT_BRANCH} -u ${PRODUCTION_URL}/${PROJECT}/current -g -s; \
else \
mut-index upload build/public/${GIT_BRANCH} -o kafka-connector-${GIT_BRANCH}.json -u ${PRODUCTION_URL}/${PROJECT}/${GIT_BRANCH} -s; \
fi

redirects:
if [ ${GIT_BRANCH} = master ]; then mut-redirects config/redirects -o build/public/.htaccess; fi
35 changes: 35 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
MongoDB Kafka Connector Documentation
=====================================

<<<<<<< HEAD
This repository contains documentation for the MongoDB Kafka Connector.


Expand All @@ -23,6 +24,40 @@ File issue reports or requests to the `Documentation Jira Project

Licenses
--------
=======
This repository contains documentation regarding components of the
MongoDB Kafka Connector. This documentation builds on the work of the
`MongoDB Manual <http://docs.mongodb.org/manual/>`_.

Building
--------

First install `mut <https://github.com/mongodb/mut>`_.

Then you can download and build this documentation locally with
the following command:

git clone https://github.com/10gen/docs-kafka-connector.git
cd docs-kafka-connector/
make html

View ``build/master/html/index.html`` to view your current build of the
documentation.

Contributing
------------

See the following documents within this repository that provide a more
thorough overview of the documentation style, and process. These links
point back to the meta documentation site materials:

- `Style Guide <http://docs.mongodb.org/meta/style-guide>`_
- `Documentation Practices <http://docs.mongodb.org/meta/practices>`_
- `Documentation Organization <http://docs.mongodb.org/meta/organization>`_

File issue reports or requests at the `Private Documentation Jira Project
<https://jira.mongodb.org/browse/DOCSP>`_.
>>>>>>> DOCSP-4925: repo setup

All documentation is available under the terms of a `Creative Commons
License <http://creativecommons.org/licenses/by-nc-sa/3.0/>`_.
Expand Down
26 changes: 26 additions & 0 deletions conf-sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<site
base_url="https://docs.mongodb.org/kafka-connector/"
store_into="build/master/sitemap.xml.gz"
verbose="1"
>

<directory
path="build/public/"
url="https://docs.mongodb.org/kafka-connector/"
default_file="index.html"
/>
<filter action="drop" type="wildcard" pattern="*~" />
<filter action="drop" type="wildcard" pattern="*.txt" />
<filter action="drop" type="wildcard" pattern="*_t" />
<filter action="drop" type="wildcard" pattern="*.inv" />
<filter action="drop" type="wildcard" pattern="*.asc" />
<filter action="drop" type="wildcard" pattern="*.js" />
<filter action="drop" type="wildcard" pattern="*.gif" />
<filter action="drop" type="wildcard" pattern="*.png" />
<filter action="drop" type="regexp" pattern="/\.[^/]*" />
<filter action="drop" type="wildcard" pattern="*/single*"/>
<filter action="drop" type="wildcard" pattern="*/_static/*" />
<filter action="drop" type="wildcard" pattern="*/_images/*" />
<filter action="drop" type="wildcard" pattern="*/search/" />
</site>
148 changes: 148 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# -*- coding: utf-8 -*-
#
# MongoDB documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 3 09:58:40 2011.
#
# This file is execfile()d with the current directory set to its containing dir.

import base64
import sys
import os.path
import datetime

project_root = os.path.join(os.path.abspath(os.path.dirname(__file__)))
sys.path.append(project_root)

from giza.config.runtime import RuntimeStateConfig
from giza.config.helper import fetch_config, get_versions, get_manual_path

conf = fetch_config(RuntimeStateConfig())
intersphinx_libs = conf.system.files.data.intersphinx
pdfs = conf.system.files.data.pdfs
sconf = conf.system.files.data.sphinx_local

sys.path.append(os.path.join(conf.paths.projectroot, conf.paths.buildsystem, 'sphinxext'))

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

needs_sphinx = '1.0'

extensions = [
'sphinx.ext.extlinks',
'sphinx.ext.todo',
'mongodb',
'directives',
'intermanual',
'fasthtml',
'tabs'
]

templates_path = ['.templates']
exclude_patterns = []

source_suffix = '.txt'

master_doc = sconf.master_doc
language = 'en'
project = sconf.project
copyright = u'2008-{0}'.format(datetime.date.today().year)

version = conf.version.branch
release = conf.version.release

rst_epilog = '\n'.join([
'.. |branch| replace:: ``{0}``'.format(conf.git.branches.current),
'.. |copy| unicode:: U+000A9',
'.. |year| replace:: {0}'.format(datetime.date.today().year),
'.. |ent-build| replace:: MongoDB Enterprise',
'.. |hardlink| replace:: https://docs.mongodb.com/kafka-connector/',
])

extlinks = {
'issue': ('https://jira.mongodb.org/browse/%s', '' ),
'manual': ('http://docs.mongodb.com/manual%s', ''),
}

intersphinx_mapping = {}
for i in intersphinx_libs:
intersphinx_mapping[i.name] = (i.url, os.path.join(conf.paths.projectroot,
conf.paths.output, i.path))

languages = [
("ar", "Arabic"),
("cn", "Chinese"),
("cs", "Czech"),
("de", "German"),
("es", "Spanish"),
("fr", "French"),
("hu", "Hungarian"),
("id", "Indonesian"),
("it", "Italian"),
("jp", "Japanese"),
("ko", "Korean"),
("lt", "Lithuanian"),
("pl", "Polish"),
("pt", "Portuguese"),
("ro", "Romanian"),
("ru", "Russian"),
("tr", "Turkish"),
("uk", "Ukrainian")
]

# -- Options for HTML output ---------------------------------------------------

html_theme = sconf.theme.name
html_theme_path = [ os.path.join(conf.paths.buildsystem, 'themes') ]
html_title = conf.project.title
htmlhelp_basename = 'MongoDBdoc'

html_logo = ".static/logo-mongodb.png"
html_static_path = ['source/.static']
html_last_updated_fmt = '%b %d, %Y'

html_copy_source = False
html_domain_indices = True
html_use_index = True
html_split_index = False
html_show_sourcelink = False
html_show_sphinx = True
html_show_copyright = True

manual_edition_path = '{0}/{1}/{2}.{3}'

html_theme_options = {
'branch': conf.git.branches.current,
'translations': languages,
'language': language,
'manual_path': "kafka-connector",
'repo_name': 'docs-kafka-connector',
'jira_project': 'DOCSP',
'google_analytics': sconf.theme.google_analytics,
'project': sconf.project,
'epubpath': manual_edition_path.format(conf.project.url,
conf.project.basepath,
'mongodb-kafka-connector', 'epub'),
'nav_excluded': sconf.theme.nav_excluded,
'version_selector': get_versions(conf),
'is_upcoming': False,
}

html_sidebars = sconf.sidebars


# -- Options for Epub output ---------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = conf.project.title
epub_author = u'MongoDB Documentation Project'
epub_publisher = u'MongoDB, Inc.'
epub_copyright = copyright
epub_theme = 'epub_mongodb'
epub_tocdup = True
epub_tocdepth = 3
epub_language = 'en'
epub_scheme = 'url'
epub_identifier = 'http://docs.mongodb.org/kafka-connector/'
epub_exclude_files = []
epub_pre_files = []
epub_post_files = []
46 changes: 46 additions & 0 deletions config/build_conf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
git:
remote:
upstream: '10gen/docs-kafka-connector'
tools: 'mongodb/docs-tools'
project:
name: 'kafka-connector'
tag: 'kafka-connector'
url: 'https://docs.mongodb.com/kafka-connector'
title: "MongoDB Kafka Connector"
branched: true
system:
tools:
ref: HEAD
pinned: false
make:
generated:
- 'sphinx'
- 'meta'
- 'push'
- 'integration'
static:
- 'makefile.compatibility'
- 'makefile.clean'
files:
- 'pdfs.yaml'
- 'intersphinx.yaml'
- 'push.yaml'
- 'integration.yaml'
- 'sphinx_local.yaml'
- htaccess: ['htaccess.yaml']
version:
release: '0.1'
branch: 'master'
assets:
- branch: master
path: build/docs-tools
repository: https://github.com/mongodb/docs-tools.git
paths:
output: 'build'
source: 'source'
includes: 'source/includes'
images: 'source/images'
tools: 'bin'
buildsystem: 'build/docs-tools'
builddata: 'config'
...
12 changes: 12 additions & 0 deletions config/integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
base:
links:
- { '0.1': 'master' }
- { 'current': 'master' }
targets:
- html
- dirhtml
doc-root:
- ''
- '.htaccess'
branch-root: null
...
12 changes: 12 additions & 0 deletions config/intersphinx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: mongodb
url: https://docs.mongodb.com/manual/
path: mongodb.inv
---
name: python
url: https://docs.python.org/2/
path: python2.inv
---
name: clouddocs
url: https://docs.atlas.mongodb.com/
path: cloud-docs.inv
...
7 changes: 7 additions & 0 deletions config/redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define: base https://docs.mongodb.com/kafka-connector
define: versions v0.1 master
symlink: v0.1 -> master
symlink: upcoming -> master
symlink: current -> v0.1

raw: kafka-connector/ -> ${base}/current
4 changes: 4 additions & 0 deletions config/robots.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file: '/meta/google-compute-engine'
branches:
- 'kafka-connector'
...
Loading

0 comments on commit caf97cb

Please sign in to comment.