diff --git a/.github/workflows/landing-page.yml b/.github/workflows/landing-page.yml new file mode 100644 index 000000000..be8916847 --- /dev/null +++ b/.github/workflows/landing-page.yml @@ -0,0 +1,35 @@ +name: Landing-page + +on: + push: + branches: + - main + - feature/simplify-landing-page + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + pip install .[docs] + pip install sphinx_design + + - name: Build landing-page + run: | + cd doc/landing-page + make html + - name: Publish + uses: tsunematsu21/actions-publish-gh-pages@v1.0.2 + with: + dir: doc/landing-page/_build/html + repo: dfetch-org/dfetch-org.github.io + branch: main + token: ${{ secrets.GH_DFETCH_ORG_DEPLOY }} diff --git a/.gitignore b/.gitignore index 6f25c30c3..fbd3082b7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ dist coverage.xml example/Tests/ build +doc/landing-page/_build diff --git a/dfetch.yaml b/dfetch.yaml index 442679819..f1a42f29f 100644 --- a/dfetch.yaml +++ b/dfetch.yaml @@ -1,7 +1,7 @@ manifest: - version: 0.0 # DFetch Module syntax version + version: 0.0 - remotes: # declare common sources in one place + remotes: - name: github url-base: https://github.com/ diff --git a/doc/conf.py b/doc/conf.py index c2ff74ded..2d6905a5c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -77,7 +77,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "venv"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "venv", "landing-page"] # The name of the Pygments (syntax highlighting) style to use. pygments_style = "sphinx" diff --git a/doc/landing-page/Makefile b/doc/landing-page/Makefile new file mode 100644 index 000000000..fe606aa63 --- /dev/null +++ b/doc/landing-page/Makefile @@ -0,0 +1,21 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = DFetch +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) + touch "$(BUILDDIR)/html/.nojekyll" diff --git a/doc/landing-page/conf.py b/doc/landing-page/conf.py new file mode 100644 index 000000000..a39d638c9 --- /dev/null +++ b/doc/landing-page/conf.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Documentation build configuration file, created by +# sphinx-quickstart on Thu Jan 11 16:03:16 2018. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# 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 + +from dfetch import __version__ + +# -- 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 = ['sphinx.ext.autodoc', 'sphinx_autodoc_annotation', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'sphinxarg.ext', 'sphinx.ext.autosectionlabel'] +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.viewcode", + "sphinx.ext.napoleon", + "sphinxarg.ext", + "sphinx.ext.autosectionlabel", + "plantweb.directive", + "sphinxcontrib.asciinema", + "sphinx_design", +] + +# 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" + +# General information about the project. +project = "Dfetch" +copyright = "2021, Dfetch-org" +author = "DFetch" + +# 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 = __version__ +# The full version, including alpha/beta/rc tags. +release = "" + +# 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 = "en" + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "venv"] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + +# -- 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" + +html_css_files = [ + "css/custom.css", +] + +html_logo = "../images/dfetch_logo.png" + +# 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 = { + "show_powered_by": False, + "github_user": "dfetch-org", + "github_repo": "dfetch", + "github_banner": True, + "show_related": True, + "note_bg": "#FFF59C", + "nosidebar": True, +} + +# 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. +# +# This is required for the alabaster theme +# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars +html_sidebars = { + "**": [ + "about.html", + "searchbox.html", + "navigation.html", + "relations.html", # needs 'show_related': True theme option to display + ] +} + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = "dfetchdoc" + + +# -- 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, "dfetch.tex", "Dfetch Documentation", "Dfetch", "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, "dfetch", "Dfetch 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, + "dfetch", + "Dfetch Documentation", + author, + "Dfetch", + "One line description of project.", + "Miscellaneous", + ), +] + +# Options for asciicasts +sphinxcontrib_asciinema_defaults = { + "theme": "monokai", + "preload": 1, + "font-size": "10px", + "speed": 1.5, + "loop": False, + "autoplay": True, +} diff --git a/doc/landing-page/index.rst b/doc/landing-page/index.rst new file mode 100644 index 000000000..933022f1a --- /dev/null +++ b/doc/landing-page/index.rst @@ -0,0 +1,102 @@ +.. Dfetch documentation master file + +:sd_hide_title: + +.. image:: ../images/dfetch_header.png + :width: 100% + :align: center + + +Dfetch +###### + +.. grid:: 3 + + .. grid-item:: + + .. button-link:: https://pypi.org/project/dfetch/ + :color: primary + :shadow: + :expand: + + :material-regular:`download;2em` Download + + .. grid-item:: + + .. button-link:: https://dfetch.rtfd.io/ + :color: secondary + :shadow: + :expand: + + :material-regular:`description;2em` Docs + + .. grid-item:: + + .. button-link:: https://github.com/dfetch-org/dfetch/ + :color: secondary + :shadow: + :expand: + + :material-regular:`article;2em` Source + +.. asciinema:: ../asciicasts/basic.cast + +Are you tired of managing dependencies using Git submodules or SVN externals? Introducing *Dfetch*, a VCS agnostic, no-hassle, source-only solution +that allows you to easily retrieve dependencies as plain text from various sources. *Dfetch* eliminates the need for Git submodules or SVN externals +by providing a efficient and user-friendly way to manage your project's dependencies using *vendoring*. It promotes upstreaming changes and allows for local +customizations all while maintaining self-contained code repositories. + +Say goodbye to the hassle of traditional dependency management solutions and hello to a more efficient and streamlined process with *Dfetch*. + +.. card:: :material-regular:`done_all;4em;sd-text-primary` **Check for updates** + :class-card: sd-bg-dark sd-text-light + + *Dfetch* simplifies dependency management by allowing users to easily check for + updates and integrate them seamlessly into their codebase. + + .. asciinema:: ../asciicasts/check.cast + + +.. grid:: 1 1 2 2 + + .. grid-item:: + + :material-regular:`shuffle;4em;sd-text-primary` **VCS-agnostic** + + *Dfetch* is a versatile solution, being VCS agnostic it can be used with both Git and SVN, enabling users to seamlessly manage dependencies regardless of their VCS of choice and even to mix them. + + + .. grid-item:: + + :material-regular:`archive;4em;sd-text-primary` **Self-contained** + + *Dfetch* ensures self-contained repositories by including dependencies directly within the project, eliminating external links and making deployment easier. + + + .. grid-item:: + + :material-regular:`build;4em;sd-text-primary` **Simple yaml config** + + *Dfetch* simplifies configuration with its easy-to-use YAML file, allowing users to set up and manage dependencies with minimal setup and effort. + + + .. grid-item:: + + :material-regular:`lock_open;4em;sd-text-primary` **No lock-in** + + *Dfetch* provides freedom of choice, users are not locked into using *Dfetch*, they can easily switch to other dependency management solutions. + + +.. card:: :material-regular:`smart_toy;4em;sd-text-primary` **Integrate** + :class-card: sd-bg-dark sd-text-light + + *Dfetch* streamlines the integration process by being easily adaptable to various CI/CD automated tools, making it a breeze to implement in any development workflow. + It can generate reports for Github, Gitlab, Jenkins, DependencyTrack and more! + + .. asciinema:: ../asciicasts/check-ci.cast + + +.. card:: Example config + + .. literalinclude:: ../../dfetch.yaml + :language: yaml diff --git a/doc/landing-page/make.bat b/doc/landing-page/make.bat new file mode 100644 index 000000000..9807c5ed0 --- /dev/null +++ b/doc/landing-page/make.bat @@ -0,0 +1,36 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build +set SPHINXPROJ=DFetch + +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/doc/landing-page/static/css/custom.css b/doc/landing-page/static/css/custom.css new file mode 100644 index 000000000..c502c39b1 --- /dev/null +++ b/doc/landing-page/static/css/custom.css @@ -0,0 +1,110 @@ +@import url("https://fonts.googleapis.com/css?family=Roboto:100,300,300i,400,500,700,900"); + +.sphinxsidebar .caption-text { + font-size: 130%; +} + +.logo { + width: 100%; +} + +.sphinxsidebarwrapper .internal, +.sphinxsidebarwrapper .external { + font-weight: 300; +} + +body { + font-family: Roboto; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: Roboto !important; + font-weight: 300 !important; +} + +.toctree-l1 { + padding-bottom: 0.5em; +} + +.body p, +.body dd, +.body li { + font-family: Roboto; + font-size: 1em; + font-weight: 300; + line-height: 2; + text-align: justify; +} + +.search { + margin-bottom: 1em; +} + +.sphinxsidebarwrapper ul { + margin-bottom: 1em; +} + +.sphinxsidebar input[type="submit"] { + font-family: "Roboto", serif; +} + +.caption { + margin-top: 1em; +} + +.caption-text { + font-weight: 500; +} + +.sphinxsidebarwrapper .logo-name { + display: none; +} + +.sphinxsidebarwrapper .logo { + margin-bottom: 2em; +} + +img { + height: auto; + max-width: 100%; +} + +div.admonition { + border: none; + border-radius: 0; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), + 0 3px 1px -2px rgba(0, 0, 0, 0.2); + font-family: Roboto; + padding: 2em; + position: relative; + transition: box-shadow 0.25s; +} + +div.admonition p.admonition-title { + font-family: "Roboto", serif; + font-weight: 300; + margin: 0 0 5px 0; +} + +div.admonition p { + font-weight: 300; + margin-top: 1em; +} + +.admonition a { + font-weight: 300; +} + +strong { + font-weight: 400; +} + +.pre { + padding-left: 0.2em; + padding-right: 0.2em; +} diff --git a/pyproject.toml b/pyproject.toml index e7d20e4aa..2c405a5ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,6 +70,7 @@ docs =[ 'sphinx-argparse==0.4.0', 'plantweb==1.2.1', 'sphinxcontrib.asciinema==0.3.7', + # 'sphinx_design==0.3.0' # Required for landing page, but requires sphinx <6 ] test = [ 'pytest==7.2.2',