diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 000000000..7f08c411c --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,28 @@ +# Development Container + +The development container config ([.devcontainer.json](./devcontainer.json)) enables starting a +pre-configured [GitHub Codespaces](https://github.com/features/codespaces) environment ready to +build and preview the docs in this repository. + +## Building a preview + +The current version of the docs will be automatically built the when a new codespace is created. To +re-build the docs after making changes, simply run this command from the terminal: + +```shell +make html +``` + +Note: you may need go to the main menu, click `View`, then `Terminal` if the terminal isn't visible. + +## Viewing the preview + +To preview the docs, run the following command in the terminal: + +```shell +python -m http.server 8080 -d _build/html +``` + +This will start a simple Python web server on port 8080 in the codespace and open a preview of the +site in VSCode's built-in simple browser. To preview in your actual browser, click the `PORTS` tab, +right-click on `Doc Preview (8080)`, and select `Open in Browser`. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..b6d1da49d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,51 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu +{ + "name": "Ubuntu", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:jammy", + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/python:1": {} + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "./.devcontainer/postCreateCommands.sh", + + // Configure tool-specific properties. + "customizations": { + "codespaces": { + "openFiles": [ + ".devcontainer/README.md", + "README.md" + ] + }, + "vscode": { + "extensions": [ + "lextudio.restructuredtext", + "trond-snekvik.simple-rst", + "DavidAnson.vscode-markdownlint", + "ZainChen.json", + "stkb.rewrap" + ] + } + }, + "portsAttributes": { + "8080": { + "label": "Doc Preview", + "onAutoForward": "openPreview" + } + } + + // // Configure command(s) to run after starting + // "postStartCommand": { + // "serve-doc-preview": "python -m http.server 8080 -d _build/html/" + // } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/postCreateCommands.sh b/.devcontainer/postCreateCommands.sh new file mode 100755 index 000000000..bc62f4925 --- /dev/null +++ b/.devcontainer/postCreateCommands.sh @@ -0,0 +1,10 @@ +#/!bin/sh + +# Command to run during postCreateCommand +# Done in script because when done via object the commands are run in parallel +# (which isn't always desirable) +# https://containers.dev/implementors/spec/#parallel-exec +# https://containers.dev/implementors/json_reference/#formatting-string-vs-array-properties + +pip install -r requirements.txt +make html diff --git a/.github/workflows/preview-url.yml b/.github/workflows/preview-url.yml new file mode 100644 index 000000000..676166f4f --- /dev/null +++ b/.github/workflows/preview-url.yml @@ -0,0 +1,23 @@ +name: Add preview URL to PR description +on: + pull_request_target: + types: [opened] + paths: + - '**.md' + - '**.png' + - '**.rst' + - '**.svg' + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: edit-pull-request-description + uses: Jerome1337/comment-pull-request@v1.0.4 + + env: + GITHUB_TOKEN: ${{ github.token }} + with: + description-message: | + + Preview build: https://dash-docs--${{github.event.pull_request.number}}.org.readthedocs.build/projects/core/en/${{github.event.pull_request.number}}/ diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..2f2a1c2b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.db +*.exe +_build +**/.DS_Store +.vscode diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 000000000..f04743b5a --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,10 @@ +{ + "default": true, + "MD004": { "style": "asterisk"}, + "MD013": false, + "MD033": false, + "MD036": false, + "MD040": true, + "MD041": false, + "MD049": true +} diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 000000000..584916082 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,17 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +build: + os: "ubuntu-22.04" + tools: + python: "3.10" + +python: + install: + - requirements: requirements.txt + +formats: [ pdf ] diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..d4bb2cbb9 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +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) diff --git a/_static/css/footer.css b/_static/css/footer.css new file mode 100644 index 000000000..70a4a920d --- /dev/null +++ b/_static/css/footer.css @@ -0,0 +1,11 @@ +/* Make each footer item in-line so they stack horizontally instead of vertically */ +.footer-item { + display: inline-block; +} + +/* Add a separating border line for all but the last item */ +.footer-item:not(:last-child) { + border-right: 1px solid var(--pst-color-text-base); + margin-right: .5em; + padding-right: .5em; +} diff --git a/_static/css/pydata-overrides.css b/_static/css/pydata-overrides.css new file mode 100644 index 000000000..89e3e26b5 --- /dev/null +++ b/_static/css/pydata-overrides.css @@ -0,0 +1,82 @@ +/* Update theme variables based on https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/styling.html#css-theme-variables */ +@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,600;0,900;1,900&family=Open+Sans:ital,wght@0,400;0,500;1,400&display=swap'); + +:root { + --dash-blue: #008de4; + --dash-deep-blue: #012060; + --dash-midnight-blue: #0b0f3b; +} + +html[data-theme="light"] { + --pst-color-primary:var(--dash-blue); + --pst-color-link:var(--pst-color-primary); + --pst-color-link-hover:var(--dash-deep-blue); +} + +html[data-theme="dark"] { + --pst-color-primary:var(--dash-blue); + --pst-color-link:var(--pst-color-primary); +} + +html { + /* Headers */ + --pst-font-size-h1: 28px; + --pst-font-size-h2: 24px; + --pst-font-size-h3: 20px; + + /* Sidebar styles */ + --pst-sidebar-font-size: 0.95em; + --pst-sidebar-header-font-size: 1.2em; +} + +html[data-theme=dark] .bd-content img:not(.only-dark):not(.dark-light) { + background: none; + border-radius: none; +} + +h1,h2,h3,h4,h5,h6{ + font-family: 'Montserrat', sans-serif; + font-weight: 600; +} + +p, a, li, ol { + font-family: 'Open Sans', sans-serif; +} + +p { + font-size: 0.95em; + line-height: 1.5; +} + +.sidebar-end-items__item { + position: relative; +} + +select { + width: 100%; + padding: 10px; + appearance: none; + background: transparent; + border-radius: 0.25rem; +} + +html[data-theme=dark] select { + color: #fff; +} + +html[data-theme="light"] select{ + color: #000; +} + +html[data-theme="light"] { + --table-bg-color-odd: #eeeeee; + --table-bg-color-even: #ffffff; +} + +tbody tr:nth-child(odd) { background-color: var(--table-bg-color-odd); } +tbody tr:nth-child(even) { background-color: var(--table-bg-color-even); } + +.table thead th.head { + vertical-align: middle; +} + diff --git a/_static/img/favicon-144x144.png b/_static/img/favicon-144x144.png new file mode 100644 index 000000000..5a92e49f8 Binary files /dev/null and b/_static/img/favicon-144x144.png differ diff --git a/_static/img/favicon-16x16.png b/_static/img/favicon-16x16.png new file mode 100644 index 000000000..28332377a Binary files /dev/null and b/_static/img/favicon-16x16.png differ diff --git a/_static/img/favicon-32x32.png b/_static/img/favicon-32x32.png new file mode 100644 index 000000000..3f4d052c3 Binary files /dev/null and b/_static/img/favicon-32x32.png differ diff --git a/_static/img/favicon-96x96.png b/_static/img/favicon-96x96.png new file mode 100644 index 000000000..4681cfb34 Binary files /dev/null and b/_static/img/favicon-96x96.png differ diff --git a/conf.py b/conf.py new file mode 100644 index 000000000..a7f21feac --- /dev/null +++ b/conf.py @@ -0,0 +1,133 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'Dash Platform' +copyright = '2023, Dash Core Group, Inc' +author = 'thephez' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = u'latest' +# The full version, including alpha/beta/rc tags. +release = u'latest' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'hoverxref.extension', + 'myst_parser', + 'sphinx.ext.autodoc', + 'sphinx_copybutton', + 'sphinx_design', + 'sphinx.ext.intersphinx', +] + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'README.md', '.devcontainer', 'scripts', 'img/dev/gifs/README.md'] + +# The master toctree document. +master_doc = 'index' + +hoverxref_role_types = { + 'hoverxref': 'tooltip', +} + +# -- Myst parser configuration ----------------------------------------------- +# Auto-generate header anchors for md headings +myst_heading_anchors = 5 + +# Enable colon_fence for better markdown compatibility +# https://myst.tools/docs/mystjs/syntax-overview#directives +myst_enable_extensions = ["colon_fence"] + +# -- intersphinx configuration ----------------------------------------------- +intersphinx_mapping = { + "user": ("https://docs.dash.org/en/stable/", None), +} + +# We recommend adding the following config value. +# Sphinx defaults to automatically resolve *unresolved* labels using all your Intersphinx mappings. +# This behavior has unintended side-effects, namely that documentations local references can +# suddenly resolve to an external location. +# See also: +# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#confval-intersphinx_disabled_reftypes +intersphinx_disabled_reftypes = ["*"] + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "pydata_sphinx_theme" +html_static_path = ['_static'] +html_logo = 'img/dash_logo.png' +html_css_files = [ + 'css/footer.css', + 'css/pydata-overrides.css', +] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +html_sidebars = { + # "index": ["sidebar-main.html"], + "**": ["sidebar-nav-bs"] +} + +html_theme_options = { +# "announcement": "Test build of Dash Core documentation migrated from Readme.io!", + "external_links": [ + {"name": "Core docs", "url": "https://docs.dash.org/projects/core/en/stable/docs/index.html"}, + {"name": "User docs", "url": "https://docs.dash.org/"}, + {"name": "Dash.org", "url": "https://www.dash.org"}, + {"name": "Forum", "url": "https://www.dash.org/forum"}, + ], + "use_edit_page_button": True, + "github_url": "https://github.com/dashpay/docs-platform", + "show_toc_level": 2, + "show_nav_level": 1, + "favicons": [ + { + "rel": "icon", + "sizes": "16x16", + "href": "img/favicon-16x16.png", + }, + { + "rel": "icon", + "sizes": "32x32", + "href": "img/favicon-32x32.png", + }, + { + "rel": "icon", + "sizes": "96x96", + "href": "img/favicon-96x96.png", + }, + { + "rel": "icon", + "sizes": "144x144", + "href": "img/favicon-144x144.png", + }, + ], +# "navbar_start": ["navbar-logo", "languages"], +# "navbar_center": ["languages", "navbar-nav", "languages"], +# "navbar_end": ["navbar-icon-links", "version"], +# "secondary_sidebar_items": ["languages", "page-toc", "edit-this-page", "sourcelink"], +# "footer_items": ["languages", "copyright", "sphinx-version", "theme-version"], +# "primary_sidebar_end": ["languages"], +} + +html_context = { + # "github_url": "https://github.com", # or your GitHub Enterprise site + "github_user": "dashpay", + "github_repo": "docs-platform", + "github_version": "0.24.0", + "doc_path": "", +} + diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 000000000..0283e0110 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,7 @@ +```{eval-rst} +.. _platform-index: +``` + +# Platform docs + +Welcome to the Dash Platform developer documentation. \ No newline at end of file diff --git a/img/dash-d.png b/img/dash-d.png new file mode 100644 index 000000000..c02c266cc Binary files /dev/null and b/img/dash-d.png differ diff --git a/img/dash_logo.png b/img/dash_logo.png new file mode 100644 index 000000000..a00358aae Binary files /dev/null and b/img/dash_logo.png differ diff --git a/img/dash_logo_white.png b/img/dash_logo_white.png new file mode 100644 index 000000000..20466d376 Binary files /dev/null and b/img/dash_logo_white.png differ diff --git a/index.md b/index.md new file mode 100644 index 000000000..165cd54fb --- /dev/null +++ b/index.md @@ -0,0 +1,32 @@ +```{eval-rst} + +================== +Dash Documentation +================== + +Dash aims to be the most user-friendly and scalable payments-focused +cryptocurrency in the world. The Dash network features instant transaction +confirmation, double spend protection, optional privacy equal to that of +physical cash, a self-governing, and a self-funding model driven by incentivized +full nodes. While Dash is based on Bitcoin and compatible with many key +components of the Bitcoin ecosystem, its two-tier network structure offers +significant improvements in transaction speed, privacy and governance. This +section of the documentation describes these and many more key features that set +Dash apart in the blockchain economy. + +Check out the `official Dash website `__ to learn how +`individuals `__ and `businesses +`__ can use Dash. + +.. toctree:: + :maxdepth: 3 + :titlesonly: + :hidden: + + docs/index + +.. image:: https://raw.githubusercontent.com/dashpay/docs/master/img/businessplan.svg + :class: no-scaled-link + :align: center + :width: 90% +``` diff --git a/make.bat b/make.bat new file mode 100644 index 000000000..954237b9b --- /dev/null +++ b/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%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.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..d48fdda0c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +Babel==2.12.1 +myst-parser==1.0.0 +pydata-sphinx-theme==0.12.0 +sphinx==5.3.0 +sphinx-copybutton==0.5.2 +sphinx-hoverxref==1.3.0 +sphinx-multiproject==1.0.0rc1 +sphinx_design==0.4.1 +jinja2==3.1.2 \ No newline at end of file