Skip to content

Commit

Permalink
Merge pull request #10 from vict0rsch/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vict0rsch authored Nov 14, 2023
2 parents 25a7cce + 0b39db4 commit 93bf8b3
Show file tree
Hide file tree
Showing 12 changed files with 643 additions and 500 deletions.
36 changes: 36 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.9"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the
# dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true
# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements-docs.txt
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ An interactive Python implementation of the Gitmoji convention: [gitmoji.dev/](h
pip install gitmopy
```

![demo-gitmopy](./assets/demo-gitmopy.gif)
![demo-gitmopy](https://raw.githubusercontent.com/vict0rsch/gitmopy/main/assets/demo-gitmopy.gif)

## How to use

Expand All @@ -32,7 +32,7 @@ alias gpya="gitmopy commit --add"
alias gpyk="gitmopy commit --add --keep-alive"
```

![gpyk depo](assets/gpyk.png)
![gpyk depo](https://raw.githubusercontent.com/vict0rsch/gitmopy/main/assets/gpyk.png)

## Examples

Expand Down Expand Up @@ -90,7 +90,7 @@ $ gitmopy commit --help
$ gitmopy info
gitmopy info:
version : 0.4.1
version : 0.4.2
app path : /Users/victor/.gitmopy
history : /Users/victor/.gitmopy/history.json
config : /Users/victor/.gitmopy/config.yaml
Expand All @@ -101,6 +101,7 @@ Current configuration:
skip_message : False
capitalize_title: True
enable_history : True
emoji_set : gitmoji
```

Update configuration with
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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)
Empty file added docs/_static/css/custom.css
Empty file.
122 changes: 122 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# 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 = 'gitmopy'
copyright = '2023, vict0rsch'
author = 'vict0rsch'

version = '0.4.1'
release = '0.4.1'

import sys
from pathlib import Path

ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT))

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"myst_parser",
"sphinx.ext.viewcode",
"sphinx_math_dollar",
"sphinx.ext.mathjax",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"autoapi.extension",
"sphinx.ext.napoleon",
"sphinx_autodoc_typehints",
"sphinx.ext.todo",
"sphinx_design",
"sphinx_copybutton",
"sphinxext.opengraph",
]


templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "furo"
html_static_path = ['_static']
html_css_files = ["css/custom.css"]

# -- Options for intersphinx extension ---------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration

intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
}

# -- Options for todo extension ----------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/todo.html#configuration

todo_include_todos = True


# Configuration section from vipyto:
# ----------------------------------

# Configuratiion for sphinx.ext.autodoc & autoapi.extension
# https://autoapi.readthedocs.io/

autodoc_typehints = "description"
autoapi_type = "python"
autoapi_dirs = [str(ROOT/ "gitmopy")]
autoapi_member_order = "groupwise"
autoapi_template_dir = "_templates/autoapi"
autoapi_python_class_content = "init"
autoapi_options = [
"members",
"undoc-members",
]
autoapi_keep_files = False

# Configuration for sphinx_math_dollar

# sphinx_math_dollar
# https://www.sympy.org/sphinx-math-dollar/

# Note: CHTML is the only output format that works with \mathcal{}
mathjax_path = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML"
mathjax3_config = {
"tex": {
"inlineMath": [
["$", "$"],
["\\(", "\\)"],
],
"processEscapes": True,
},
"jax": ["input/TeX", "output/CommonHTML", "output/HTML-CSS"],
}

# Configuration for sphinx_autodoc_typehints
# https://github.com/tox-dev/sphinx-autodoc-typehints
typehints_fully_qualified = False
always_document_param_types = True
typehints_document_rtype = True
typehints_defaults = "comma"

# Configuration for the MyST (markdown) parser
# https://myst-parser.readthedocs.io/en/latest/intro.html
myst_enable_extensions = ["colon_fence"]

# Configuration for sphinxext.opengraph
# https://sphinxext-opengraph.readthedocs.io/en/latest/

ogp_site_url = "TODO"
ogp_social_cards = {
"enable": True,
"image": "./_static/images/SOME_IMAGE",
}

35 changes: 35 additions & 0 deletions docs/emoji_sets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Gitmopy's Emoji Sets
=====================

.. toctree::
:maxdepth: 2


Select your emoji sets from the command-line:

.. code-block:: bash
$ gitmopy config
Gitmojis
--------

Default standard gitmojis are from `gitmoji.dev <https://gitmoji.dev/>`_.

.. literalinclude:: ../gitmopy/assets/gitmojis.yaml
:language: yaml

AI-Devmojis
-----------

Alternative gitmojis tailored for AI/ML development. Suggestions are welcome, open a PR/issue on the `gitmopy repo <https://github.com/vict0rsch/gitmopy>`_.

.. literalinclude:: ../gitmopy/assets/ai_devmojis.yaml
:language: yaml

Custom
------

You can also define your own emoji sets in a YAML file. Run ``gitmopy info`` to see the path to that custom emojis file on your system.

Custom emojis are loaded *after* the default emoji set you have selected (gitmojis or ai-devmojis). This means that you can override any emoji from the default set with your own custom emoji.
10 changes: 10 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. include:: ../README.md
:parser: myst_parser.sphinx_

.. toctree::
:hidden:
:maxdepth: 4

self
emoji_sets

35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sphinx
myst-parser
furo
sphinx-copybutton
sphinx-autodoc-typehints
sphinx-autoapi
sphinx-math-dollar
sphinx-design
sphinx-copybutton
sphinxext-opengraph
Loading

0 comments on commit 93bf8b3

Please sign in to comment.