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

Update rendering of docs, fix some docstrings #7

Closed
wants to merge 1 commit into from
Closed
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
32 changes: 28 additions & 4 deletions docs/assets/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.highlight .gp { /* Generic.Prompt */
.highlight .gp {
/* Generic.Prompt */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about this, VSCode auto-formatted it.

user-select: none;
}

Expand All @@ -7,9 +8,32 @@
font-size: inherit;
}

/* https://mkdocstrings.github.io/handlers/python/#recommended-style-material */
/* https://mkdocstrings.github.io/python/usage/customization/#material */

/* Indentation. */
div.doc-contents:not(.first) {
padding-left: 15px;
border-left: 4px solid rgba(230, 230, 230);
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);
}
7 changes: 7 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,19 @@ plugins:
- mkdocstrings:
handlers:
python:
import:
- https://mkdocstrings.github.io/objects.inv
options:
filters: ["!^_[^_]", "!__new__"]
show_signature_annotations: true
show_source: false
show_root_heading: true
show_root_full_path: false
merge_init_into_class: true
separate_signature: true
signature_crossrefs: true
show_symbol_type_heading: true
show_symbol_type_toc: true

markdown_extensions:
- pymdownx.highlight
Expand Down
5 changes: 4 additions & 1 deletion mkdocstrings_handlers/crystal/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ def lookup(self, identifier: str | DocPath) -> DocItem:

Params:
identifier: The item to search for.

Returns:
An object that's a subclass of DocItem.

Raises:
CollectionError: When an item by that identifier couldn't be found.
"""
Expand Down Expand Up @@ -465,7 +467,8 @@ def __getitem__(self, key: str) -> D:
"""`mapping["identifier"]` to get the item by this identifier (see [DocItem.rel_id][mkdocstrings_handlers.crystal.items.DocItem.rel_id]).

Returns:
A [DocItem][mkdocstrings_handlers.crystal.items.DocItem]
A [DocItem][mkdocstrings_handlers.crystal.items.DocItem].

Raises:
KeyError: if the item is missing.
"""
Expand Down