Skip to content

Commit

Permalink
skeleton docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Aug 26, 2024
1 parent 4105b49 commit 276f062
Show file tree
Hide file tree
Showing 4 changed files with 333 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
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.
184 changes: 184 additions & 0 deletions docs/stylesheets/extra.ccs
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
.md-typeset .admonition,
.md-typeset details {
border-width: 0;
border-left-width: 4px;
}

.md-typeset .doc-children {
font-size: 0.7rem;
}

/* name of a method */
code.highlight span.n:first-child {
color: red;
}
code.highlight span.n:not(:first-child) {
color: #666;
}

/* Set True/False */
.highlight span.kc {
color: #548fed;
}
/* Set parentheses color */
.highlight span.p {
color: #dfd58b;
}

/* Indentation. */
div.doc-contents:not(.first) {
padding-left: 25px;
border-left: 0.05rem solid var(--md-typeset-table-color);
}

/* Mark external links as such. */
a.autorefs-external::after {
/* https://primer.style/octicons/arrow-up-right-24 */
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="rgb(0, 0, 0)" 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;
position: relative;
top: 0.1em;
margin-left: 0.2em;
margin-right: 0.1em;

height: 1em;
width: 1em;
border-radius: 100%;
background-color: var(--md-typeset-a-color);
}
a.autorefs-external:hover::after {
background-color: var(--md-accent-fg-color);
}

.md-header {
background: rgba(0, 0, 4, 1);
/* magma ... generated with Colormap('magma').to_css() */
background: linear-gradient(
90deg,
rgba(0, 0, 4, 1) 0%,
rgba(29, 17, 70, 1) 12.5%,
rgba(80, 18, 124, 1) 25%,
rgba(130, 38, 129, 1) 37.5%,
rgba(182, 55, 121, 1) 50%,
rgba(230, 81, 99, 1) 62.5%,
rgba(251, 135, 97, 1) 75%,
rgba(254, 195, 135, 1) 87.5%,
rgba(252, 253, 191, 1) 100%
);
}

nav.md-header__inner {
min-height: 72px;
}

nav .md-header__source {
mix-blend-mode: difference;
}

nav > label.md-header__button[for="__search"] {
mix-blend-mode: difference;
}

div.cmap {
position: relative;
margin: 0;
}
div.cmap-bar {
height: 30px;
}

div.cmap-expr > .cmap-bar {
height: 24px;
}

div.cmap.grayscale > .cmap-bar, div.cmap.grayscale > img {
filter: grayscale(100%);
}

a div.cmap-bar:hover {
cursor: pointer;
filter: drop-shadow(0 0 0.4rem gray);
}

div.cmap-name {
position: absolute;
vertical-align: middle;
line-height: 30px; /* same as cmap-bar */
margin: 0 0.8rem;
font-weight: bold;
font-size: 0.75rem;
text-shadow: #000 0 1px 2px;
color: white;
mix-blend-mode: difference;
}
div.cmap:hover .cmap-name {
color: red;
}

.container {
overflow: hidden;
}

.filterDiv {
width: 100%;
display: none; /* Hidden by default */
}

/* The "show" class is added to the filtered elements */
.show {
display: block;
}

/* Style the buttons */
.btn {
border: none;
outline: none;
padding: 8px 16px;
background-color: #f1f1f1;
cursor: pointer;
}
body[data-md-color-scheme="slate"] .btn {
background-color: #414352;
color: white;
}

body[data-md-color-scheme="slate"] {
/* default is hsla(var(--md-hue),75%,95%,1) */
--md-default-fg-color: hsla(var(--md-hue),40%,95%,.75);
/* default is hsla(var(--md-hue), 15%, 21%, 1); */
--md-default-bg-color: hsla(var(--md-hue), 15%, 10%, 1);
}

/* Add a light grey background on mouse-over */
.btn:hover {
background-color: #ddd;
}
body[data-md-color-scheme="slate"] .btn:hover {
background-color: #a3a5b1;
}

/* Add a dark background to the active button */
.btn.active {
background-color: #666;
color: white;
}
body[data-md-color-scheme="slate"] .btn.active {
background-color: #a0a3b7;
color: black;
}

.colorlist {
display: flex;
flex-wrap: wrap;
justify-content: center;
font-size: 0.7rem;
}
.colorbox {
width: 7rem;
height: 3.8rem;
padding-top: 0.22rem;
margin: 0.2rem;
text-align: center;
}
103 changes: 103 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
site_name: NeuroPython workshop 2024
site_url: https://navis-org.github.io/neuropython2024/
site_description: Documentation and Materials for the NeuroPython workshop 2024
# strict: true

repo_name: navis-org/neuropython2024
repo_url: https://github.com/navis-org/neuropython2024
edit_uri: edit/main/docs/

nav:
- Home: index.md

theme:
name: "material"
features:
- content.tabs.link
- content.code.annotate
- navigation.indexes
- navigation.instant
- content.code.copy
#logo: images/icon.png
# below option would prevents loading typefaces from Google Fonts
# but see also the privacy plugin below
#font: false
icon:
#logo: fontawesome/solid/eye
repo: fontawesome/brands/github
#favicon: images/icon.png
palette:
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: fontawesome/regular/lightbulb
name: "Switch to dark mode"
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: pink
accent: pink
toggle:
icon: fontawesome/solid/lightbulb
name: "Switch to light mode"

markdown_extensions:
- admonition
- abbr
- attr_list
- md_in_html
- pymdownx.snippets
- pymdownx.tasklist
- pymdownx.emoji:
emoji_generator: !!python/name:material.extensions.emoji.to_svg
emoji_index: !!python/name:material.extensions.emoji.twemoji
- pymdownx.extra
- pymdownx.highlight
- pymdownx.tabbed:
alternate_style: true
- tables
- toc:
permalink: "#"

plugins:
# the privacy plugin will bundle external assets (like Google Fonts)
# this should make the website GDPR compliant
- privacy
# the social plugin generates social cards for each page of the project
# which are used as previews when sharing links to the documentation
- social
- section-index
- search:
separator: '[\s\-\_,:!=\[\]()"/]+|(?!\b)(?=[A-Z][a-z])|\.(?!\d)|&[lg]t;'
- autorefs
#- literate-nav
- minify:
minify_html: true
minify_js: true
minify_css: true
htmlmin_opts:
remove_comments: true
# css_files:
# - stylesheets/extra.css
- mkdocstrings:
handlers:
python:
import:
- https://docs.python.org/3/objects.inv
- https://numpy.org/doc/stable/objects.inv
options:
show_root_heading: true # default is false
docstring_style: "numpy"
line_length: 50 # default is 60
# show_if_no_docstring: true # default is false
# show_signature: false # default is true
show_signature_annotations: true # default is false
annotations_path: "source" # default is 'brief'
show_bases: false # default is true
show_source: false # default is true
docstring_section_style: "spacy" # default is "table" but the tables end up being too wide
- glightbox

extra_css:
- stylesheets/extra.css

0 comments on commit 276f062

Please sign in to comment.