Skip to content

Commit

Permalink
Add docs site (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp authored May 30, 2024
1 parent 288b232 commit bd83918
Show file tree
Hide file tree
Showing 9 changed files with 438 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
7 changes: 7 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This rule is here to avoid the scrollbar appearing when this
* is not hosted on ReadTheDocs
*/
#rtd-footer-container {
display: none;
}
8 changes: 8 additions & 0 deletions docs/_templates/navbar_center.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ul id="navbar-main-elements" class="navbar-nav">
<li class="nav-item current active">
<a class="reference internal nav-link" href="{{ pathto("index") }}">{{ project }}</a>
</li>
<li class="nav-item">
<a class="reference internal nav-link" href="https://conda.org">conda.org</a>
</li>
</ul>
13 changes: 13 additions & 0 deletions docs/action.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Github Actions action

We also provide a convenience Actions wrapper you can use in your CI/CD workflows. All options are documented in the [`action.yml` file](https://github.com/jaimergp/conda-subchannel/blob/main/action.yml).

This will run `conda subchannel` for you and then upload the resulting files to GH Pages. A few `index.md` files are thrown in so Github Pages renders them in a nice way. They will summarize which subdirs are available and some details about the available repodata.json files. See the live demo below for more details.

## Live demo

A simple example (only `python=3.9` is kept) is available at [`jaimergp/conda-subchannel-demo`](https://github.com/jaimergp/conda-subchannel-demo). This repository publishes its subchannel at https://jaimergp.github.io/conda-subchannel-demo/, which can be used with conda clients like:

```
$ conda create --override-channels -c https://jaimergp.github.io/conda-subchannel-demo/ python=3.9
```
105 changes: 105 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Copyright (C) 2024 conda
# SPDX-License-Identifier: BSD-3-Clause
# 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 = html_title = "conda-subchannel"
copyright = "2024, conda-subchannel contributors"
author = "conda-subchannel contributors"
html_baseurl = "https://jaimergp.github.io/conda-subchannel"

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

extensions = [
"myst_parser",
"sphinx.ext.napoleon",
"sphinx.ext.autosummary",
"sphinx.ext.graphviz",
"sphinx.ext.ifconfig",
"sphinx.ext.inheritance_diagram",
"sphinx.ext.viewcode",
"sphinx_sitemap",
"sphinx_design",
"sphinx_copybutton",
"sphinx_reredirects",
]

myst_heading_anchors = 3
myst_enable_extensions = [
"amsmath",
"colon_fence",
"deflist",
"dollarmath",
"html_admonition",
"html_image",
"linkify",
"replacements",
"smartquotes",
"substitution",
"tasklist",
]


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 = "conda_sphinx_theme"
html_static_path = ["_static"]

html_css_files = [
"css/custom.css",
]

# Serving the robots.txt since we want to point to the sitemap.xml file
html_extra_path = ["robots.txt"]

html_theme_options = {
"navigation_depth": -1,
"use_edit_page_button": True,
"navbar_center": ["navbar_center"],
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/conda/conda-subchannel",
"icon": "fa-brands fa-square-github",
"type": "fontawesome",
},
{
"name": "Element",
"url": "https://app.element.io/#/room/#conda_conda:gitter.im",
"icon": "_static/element_logo.svg",
"type": "local",
},
{
"name": "Discourse",
"url": "https://conda.discourse.group/",
"icon": "fa-brands fa-discourse",
"type": "fontawesome",
},
],
}

html_context = {
"github_user": "jaimergp",
"github_repo": "conda-subchannel",
"github_version": "main",
"doc_path": "docs",
}

# We don't have a locale set, so we can safely ignore that for the sitemaps.
sitemap_locales = [None]
# We're hard-coding stable here since that's what we want Google to point to.
sitemap_url_scheme = "{link}"

# -- For sphinx_reredirects ------------------------------------------------

redirects = {}
54 changes: 54 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# conda-subchannel

Welcome to the conda-subchannel documentation! The conda-subchannel project
allows you to republish a subset of existing channels under a static website
by leveraging [CEP-15][CEP-15].

This is mostly targeted at tasks like:

- Only enabling certain versions of known packages to group of users (e.g. team environments,
plugin ecosystems, etc.).
- Snapshotting known states of a channel for checkpoints of reproducibility.
- Removing unwanted dependencies from a channel (e.g. incompatible with of a license).

## Learn

::::{grid} 2

:::{grid-item-card} 🏡 Getting started
:link: start
:link-type: doc
New to conda-subchannel? Start here to learn the essentials
:::

:::{grid-item-card} 🔧 Usage
:link: usage
:link-type: doc
Learn about all available configuration options

::::

## Development

::::{grid} 2

:::{grid-item-card} 📝 Changelog
:link: https://github.com/jaimergp/conda-subchannel/blob/main/CHANGELOG.md
Recent changes and updates to the project
:::
:::{grid-item-card} 🐞 Found a bug?
:link: https://github.com/jaimergp/conda-subchannel/issues/new/choose
File an issue in our tracker
:::
::::


```{toctree}
:hidden:
start
usage
action
```

[CEP-15]: https://github.com/conda/ceps/blob/a0807260bb5c303bbd99c690eb1ea993373f9fd9/cep-15.md
3 changes: 3 additions & 0 deletions docs/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
User-agent: *

Sitemap: https://jaimergp.github.io/conda-subchannel/sitemap.xml
Loading

0 comments on commit bd83918

Please sign in to comment.