diff --git a/.gitignore b/.gitignore index c1867770e60c..6014d524d1d2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,11 @@ npm-debug.log .gclient .sccache **.sw[po] +.vscode + +# Rendered Sphinx files should be excluded from source control +build +_build # Clion files CMakeLists.txt diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 000000000000..13077e9c6050 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = BraveBrowser +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 000000000000..2feb32d306cb --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,36 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build +set SPHINXPROJ=BraveBrowser + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd diff --git a/docs/source/_static/custom.css b/docs/source/_static/custom.css new file mode 100644 index 000000000000..03588c7811cb --- /dev/null +++ b/docs/source/_static/custom.css @@ -0,0 +1,9 @@ +/* This prevents the code block from having a scroll bar */ +pre { + white-space: pre-wrap; +} + +/* add padding after logo */ +.logo { + padding-bottom: 20px +} diff --git a/docs/source/_static/product_logo_32.png b/docs/source/_static/product_logo_32.png new file mode 100644 index 000000000000..5805419484b3 Binary files /dev/null and b/docs/source/_static/product_logo_32.png differ diff --git a/docs/source/_static/product_logo_name_48.png b/docs/source/_static/product_logo_name_48.png new file mode 100644 index 000000000000..6f8d4d44249f Binary files /dev/null and b/docs/source/_static/product_logo_name_48.png differ diff --git a/docs/source/build-instructions.rst b/docs/source/build-instructions.rst new file mode 100644 index 000000000000..a2f8202040c8 --- /dev/null +++ b/docs/source/build-instructions.rst @@ -0,0 +1,4 @@ +Brave Build Instructions +************************ + +Build instructions are hosted in our `GitHub wiki `_ at this time. diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 000000000000..682441fa47b0 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +# +# Configuration file for the Sphinx documentation builder. +# +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'Brave Browser' +copyright = '2018, Brave Software' +author = 'Brave Software' + +# The short X.Y version +version = '' +# The full version, including alpha/beta/rc tags +release = '' + + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path . +exclude_patterns = ['_build','build',] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +html_theme_options = { + 'description': 'Next generation Brave browser for macOS, Windows, Linux. brave.com', + 'logo': 'product_logo_name_48.png', +} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + +# html_favicon = "_static/product_logo_32.png" + + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = 'BraveBrowserdoc' + + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'BraveBrowser.tex', 'Brave Browser Documentation', + 'Brave Software', 'manual'), +] + + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'bravebrowser', 'Brave Browser Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'BraveBrowser', 'Brave Browser Documentation', + author, 'BraveBrowser', 'One line description of project.', + 'Miscellaneous'), +] + +def setup(app): + app.add_stylesheet('custom.css') \ No newline at end of file diff --git a/docs/source/docs.rst b/docs/source/docs.rst new file mode 100644 index 000000000000..c821f2c431c4 --- /dev/null +++ b/docs/source/docs.rst @@ -0,0 +1,76 @@ +.. _rs_sphinx_readthedocs: + +Documentation +************* + +We use Sphinx to render, and readthedocs.org to publish, Brave Browser +documentation. You can view the latest documentation at `https://brave-browser.readthedocs.io/en/latest/ `_. + +Contributing to Brave Browser documentation can be done by editing the +``docs/source/*.rst`` files in the `brave-browser repository `_ +and then opening a PR. + + + +Prerequisites +============= + +* Install ``sphinx`` using `these instructions `_. + * You might want to create a Python `virtualenv `_ or use `Pipenv `_ + first to sequester these Python modules from your installed system + modules. + + +Using Sphinx +============ + +To create or edit reStructuredText files in the source directory, +`follow this guide `_. +The `reStructuredText primer `_ +documents the markup that is supported by Sphinx. + +After editing your content, you will render and view the documentation locally. +This is done by running the ``make html`` command from the ``docs`` directory. +Example:: + + [mbacchi@host docs]$ make html + Running Sphinx v1.7.6 + loading pickled environment... done + building [mo]: targets for 0 po files that are out of date + building [html]: targets for 1 source files that are out of date + updating environment: 0 added, 1 changed, 0 removed + reading sources... [100%] docs + looking for now-outdated files... none found + pickling environment... done + checking consistency... done + preparing documents... done + writing output... [100%] index + generating indices... genindex + writing additional pages... search + copying static files... done + copying extra files... done + dumping search index in English (code: en) ... done + dumping object inventory... done + build succeeded. + + The HTML pages are in build/html. + +Now you can view the pages by pointing a web browser at the file +``brave-browser/docs/build/html/index.html``. + +After you have verified the documentation looks like you want, you can commit +it and open a PR in GitHub. + +ReadTheDocs +=========== + +We have a project for the `brave-browser repository `_ +already setup on readthedocs.org. You can view the latest documentation at +`https://brave-browser.readthedocs.io/en/latest/ `_. + +By default, `readthedocs `_ +will render any new changes to the documentation +nightly. But readthedocs.org also allows setting up a webhook that will +render new changes to the live site when any commit lands in the repository. +We will setup this webhook when Sphinx and readthedocs.org has +been accepted as the documentation tool of choice by the entire team. diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 000000000000..fb405d9ef4f9 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,33 @@ +.. Copyright (c) 2018 Brave Software + + +.. _rs_welcome: + +Welcome to Brave Docs! +====================== + +The next generation Brave desktop browser for macOS, Windows, and Linux. + +.. _rs_community: + +Brave Community Resources +------------------------- +* `community.brave.com `_ +* :doc:`/docs` process + + +Contents +-------- + +.. toctree:: + :maxdepth: 2 + + installing-brave + build-instructions + docs + +Indices and tables +------------------ + +* :ref:`genindex` +* :ref:`search` diff --git a/docs/source/installing-brave.rst b/docs/source/installing-brave.rst new file mode 100644 index 000000000000..27ae03e0b63c --- /dev/null +++ b/docs/source/installing-brave.rst @@ -0,0 +1,94 @@ +Installing Brave +################ + +Linux +***** + +Beta Channel Installation +================================ + +.. highlight:: console + +Ubuntu 16.04+ +------------- +:: + + curl https://brave-browser-apt-beta.s3.brave.com/brave-core-nightly.asc | sudo apt-key add - + + echo "deb [arch=amd64] https://brave-browser-apt-beta.s3.brave.com/ `lsb_release -sc` main" | sudo tee -a /etc/apt/sources.list.d/brave-browser-beta-`lsb_release -sc`.list + + sudo apt update + + sudo apt install brave-browser-beta + + +Mint 17+ +-------- +:: + + curl https://brave-browser-apt-beta.s3.brave.com/brave-core-nightly.asc | sudo apt-key add - + + UBUNTU_CODENAME=$( (grep DISTRIB_CODENAME /etc/upstream-release/lsb-release || grep DISTRIB_CODENAME /etc/lsb-release) 2>/dev/null | cut -d'=' -f2 ) + + echo "deb [arch=amd64] https://brave-browser-apt-beta.s3.brave.com/ $UBUNTU_CODENAME main" | sudo tee -a /etc/apt/sources.list.d/brave-browser-beta-$UBUNTU_CODENAME.list + + sudo apt update + + sudo apt install brave-browser-beta + + +Fedora 28+ +---------- +:: + + sudo dnf config-manager --add-repo https://brave-browser-rpm-beta.s3.brave.com/x86_64/ + + sudo rpm --import https://brave-browser-rpm-beta.s3.brave.com/brave-core-nightly.asc + + sudo dnf install brave-browser-beta + + +Development Channel Installation +================================ + +.. highlight:: console + +Ubuntu 16.04+ +------------- +:: + + curl https://brave-browser-apt-dev.s3.brave.com/brave-core-nightly.asc | sudo apt-key add - + + echo "deb [arch=amd64] https://brave-browser-apt-dev.s3.brave.com/ `lsb_release -sc` main" | sudo tee -a /etc/apt/sources.list.d/brave-browser-dev-`lsb_release -sc`.list + + cat /etc/apt/sources.list.d/brave-xenial.list + + sudo apt update + + sudo apt install brave-browser-dev + + +Mint 17+ +-------- +:: + + curl https://brave-browser-apt-dev.s3.brave.com/brave-core-nightly.asc | sudo apt-key add - + + UBUNTU_CODENAME=$( (grep DISTRIB_CODENAME /etc/upstream-release/lsb-release || grep DISTRIB_CODENAME /etc/lsb-release) 2>/dev/null | cut -d'=' -f2 ) + + echo "deb [arch=amd64] https://brave-browser-apt-dev.s3.brave.com/ $UBUNTU_CODENAME main" | sudo tee -a /etc/apt/sources.list.d/brave-browser-dev-$UBUNTU_CODENAME.list + + sudo apt update + + sudo apt install brave-browser-dev + + +Fedora 28+ +---------- +:: + + sudo dnf config-manager --add-repo https://brave-browser-rpm-dev.s3.brave.com/x86_64/ + + sudo rpm --import https://brave-browser-rpm-dev.s3.brave.com/brave-core-nightly.asc + + sudo dnf install brave-browser-dev