Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mkdocs configuration #63

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Docs
on:
pull_request:
push:
branches:
- main
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
with:
environments: docs
- name: Build docs
run: pixi run -e docs docs-build
- name: Deploy docs
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: pixi run -e docs mkdocs gh-deploy --force
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# multiregex

[![CI](https://img.shields.io/github/actions/workflow/status/quantco/multiregex/ci.yml?style=flat-square&branch=main)](https://github.com/quantco/multiregex/actions/workflows/ci.yml)
[![Documentation](https://img.shields.io/badge/docs-7E56C2?style=flat-square)](https://quantco.github.io/multiregex)
[![conda-forge](https://img.shields.io/conda/vn/conda-forge/multiregex?logoColor=white&logo=conda-forge&style=flat-square)](https://prefix.dev/channels/conda-forge/packages/multiregex)
[![pypi-version](https://img.shields.io/pypi/v/multiregex.svg?logo=pypi&logoColor=white&style=flat-square)](https://pypi.org/project/multiregex)
[![python-version](https://img.shields.io/pypi/pyversions/multiregex?logoColor=white&logo=python&style=flat-square)](https://pypi.org/project/multiregex)
Expand Down
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

3 changes: 3 additions & 0 deletions docs/api-documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# API Documentation

::: multiregex
13 changes: 0 additions & 13 deletions docs/changelog.rst

This file was deleted.

107 changes: 0 additions & 107 deletions docs/conf.py

This file was deleted.

19 changes: 19 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# multiregex

Quickly match many regexes against a string. Provides 2-10x speedups over naïve regex matching.

You can also link to code in the auto-generated API documentation:

<!-- Lengthy version -->

See our fancy [`get_pattern_candidates`](api-documentation/#multiregex.RegexMatcher.get_pattern_candidates) method.

<!--
Shorthand "Cross-references":
https://mkdocstrings.github.io/usage/#cross-references
Note the [][] syntax!
-->

In case you forgot to check the [`get_pattern_candidates`][multiregex.RegexMatcher.get_pattern_candidates] method!

[API Documentation](api-documentation.md)
17 changes: 0 additions & 17 deletions docs/index.rst

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

7 changes: 7 additions & 0 deletions docs/styles/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
Allows to highlight the specific entry that is jumped to when clicking on an internal link.
*/
:target {
border: 1px solid red;
border-radius: 5px;
}
63 changes: 63 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
site_name: multiregex
site_description: Quickly match many regexes against a string. Provides 2-10x speedups over naïve regex matching.
site_url: https://quantco.github.io/multiregex
theme:
name: material
palette:
# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
primary: deep purple
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to system preference
primary: deep purple
features:
- content.action.edit
- search.suggest
- search.highlight
- content.code.annotate
- content.code.copy
icon:
repo: fontawesome/brands/github-alt
edit: material/pencil

# For the optional feature of highlighting selected element after jumping to it
extra_css:
- styles/custom.css

repo_name: quantco/multiregex
repo_url: https://github.com/quantco/multiregex
edit_uri: edit/main/docs/
plugins:
- search
- mkdocstrings:
handlers:
python:
options:
unwrap_annotated: true
show_symbol_type_heading: true
docstring_style: numpy
docstring_section_style: spacy
separate_signature: true
merge_init_into_class: true

nav:
- index.md
- api-documentation.md
markdown_extensions:
- admonition
- pymdownx.highlight
- pymdownx.superfences
- pymdownx.inlinehilite
Loading