Skip to content

Commit

Permalink
docs: Scaffold support for api docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
seandstewart committed Jul 25, 2024
1 parent 5019468 commit d664e0a
Show file tree
Hide file tree
Showing 25 changed files with 2,101 additions and 505 deletions.
42 changes: 42 additions & 0 deletions docs/css/typelib.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Indentation. */
div.doc-contents:not(.first) {
padding-left: 25px;
border-left: .05rem solid var(--md-typeset-table-color);
}

/* Mark external links as such. */
a.external::after,
a.autorefs-external::after {
/* https://primer.style/octicons/arrow-up-right-24 */
mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
content: ' ';

display: inline-block;
vertical-align: middle;
position: relative;

height: 1em;
width: 1em;
background-color: var(--md-typeset-a-color);
}

a.external:hover::after,
a.autorefs-external:hover::after {
background-color: var(--md-accent-fg-color);
}

/* Avoid breaking parameters name, etc. in table cells. */
td code {
word-break: normal !important;
}

/*[data-md-color-scheme="default"] {*/
/* --doc-symbol-parameter-fg-color: #d3a81b;*/
/* --doc-symbol-parameter-bg-color: #d3a81b1a;*/
/*}*/

/*[data-md-color-scheme="slate"] {*/
/* --doc-symbol-parameter-fg-color: #dfbe50;*/
/* --doc-symbol-parameter-bg-color: #dfbe501a;*/
/*}*/
17 changes: 17 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Welcome to MkDocs

For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Commands

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.

## Project layout

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
128 changes: 128 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#file: noinspection YAMLSchemaValidation
site_name: typelib
site_url: https://pages.github.io/python-typelib
repo_name: seandstewart/python-typelib
repo_url: https://github.com/seandstewart/python-typelib
watch: [mkdocs.yml, README.md, CHANGELOG.md, src/typelib, docs]
theme:
name: material
features:
- search.highlight
- search.share
- search.suggest
- navigation.instant
- navigation.instant.progress
- navigation.tabs
- navigation.top
- toc.integrate
- toc.follow
- content.code.select
- content.code.copy
- content.code.annotate
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
primary: white
accent: black
toggle:
icon: material/brightness-7
name: Switch to dark mode

# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: black
accent: white
toggle:
icon: material/brightness-4
name: Switch to system preference
font:
text: "IBM Plex Mono"
code: "Fira Code"

extra_css:
- css/typelib.css

plugins:
- gen-files:
scripts:
- scripts/gen_ref_pages.py
- awesome-pages
- literate-nav:
nav_file: SUMMARY.md
- mkdocstrings:
enable_inventory: true
handlers:
python:
import:
- https://docs.python.org/3/objects.inv
options:
docstring_options:
ignore_init_summary: true
docstring_section_style: list
heading_level: 1
inherited_members: true
merge_init_into_class: true
parameter_headings: true
separate_signature: true
show_root_heading: true
show_root_full_path: false
show_signature_annotations: true
show_symbol_type_heading: true
show_symbol_type_toc: true
signature_crossrefs: true
summary: true
- open-in-new-tab
- tags
- social
- search
- autorefs

markdown_extensions:
- abbr
- admonition
- attr_list
- footnotes
- md_in_html
- pymdownx.arithmatex
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.critic
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.highlight:
pygments_lang_class: true
anchor_linenums: true
line_spans: __span
- pymdownx.magiclink
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- toc:
permalink: true
permalink_title: Anchor link to this section for reference


extra:
version:
provider: mike

Loading

0 comments on commit d664e0a

Please sign in to comment.