Skip to content

Commit 9ee0d4c

Browse files
committed
Update links, minor additions in docs
1 parent acd7a4b commit 9ee0d4c

7 files changed

Lines changed: 19 additions & 14 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
*mkdocstrings-crystal* allows you to insert API documentation (generated from [Crystal][]'s source code and doc comments) as part of any page on a [MkDocs][] site.
1212

13+
[See it in action][showcase].
14+
1315
To install it, run (possibly in a [virtualenv][]):
1416

1517
```shell
@@ -62,6 +64,7 @@ mkdocs serve # live preview
6264

6365
[crystal]: https://crystal-lang.org/
6466
[mkdocs]: https://www.mkdocs.org/
65-
[mkdocstrings]: https://pawamoy.github.io/mkdocstrings/
67+
[mkdocstrings]: https://mkdocstrings.github.io/
6668
[virtualenv]: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment
6769
[documentation site]: https://mkdocstrings.github.io/crystal/
70+
[showcase]: https://mkdocstrings.github.io/crystal/showcase.html

docs/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
# mkdocstrings-crystal
22

3-
Crystal language doc generator for [MkDocs][], via [mkdocstrings][].
3+
**[Crystal][] language doc generator for [MkDocs][], via [mkdocstrings][].**
44

55
## Installation
66

77
```console
88
$ pip install mkdocstrings-crystal
99
```
1010

11-
[Continue with **quickstart**](quickstart/index.md).
11+
[Continue with **quickstart**](quickstart/index.md).
12+
Or use [the migration guide](quickstart/migrate.md) for a low-effort transition from `crystal doc`.
1213

1314
## Introduction
1415

1516
Crystal has [its own easy-to-use generator of API documentation sites](https://crystal-lang.org/reference/using_the_compiler/#crystal-docs), but it's very rigid, as it doesn't attempt to do anything other than API documentation, so [these sites](https://crystal-lang.org/api/0.35.1/Process.html) end up being very isolated and prevent the author from presenting some kind of *story* about using their library.
1617

1718
Instead, this plugin is all about that *story*. It's very inspiring to look at [Python's documentation for `subprocess`](https://docs.python.org/3/library/subprocess.html), and hard to imagine a world in which this document is just an alphabetic dump of the functions in it.
1819

19-
So (matching the [idea behind *mkdocstrings*](https://pawamoy.github.io/mkdocstrings/usage/) but for Crystal), this allows you to just write textual documentation in Markdown and, in the middle of it, mention any identifier of a Crystal type, method etc., and have its API documentation (signature and doc comment) printed out right there.
20+
So (matching the [idea behind *mkdocstrings*](https://mkdocstrings.github.io/usage/) but for Crystal), this allows you to just write textual documentation in Markdown and, in the middle of it, mention any identifier of a Crystal type, method etc., and have its API documentation (signature and doc comment) printed out right there.
2021

2122
## Usage
2223

@@ -51,7 +52,7 @@ Then, in any `docs/**/*.md` file, you can **mention a Crystal identifier alone o
5152

5253
-- and in the output this will be replaced with generated API documentation for it, much like Crystal's own doc generator does.
5354

54-
Learn more about this syntax: [in *mkdocstrings* in general](https://pawamoy.github.io/mkdocstrings/usage/) (Crystal specifics are below).
55+
Learn more about this syntax: [in *mkdocstrings* in general](https://mkdocstrings.github.io/usage/) (Crystal specifics are below).
5556

5657
The auto-replacement, of course, happens as part of a normal MkDocs build process:
5758

@@ -64,7 +65,7 @@ $ mkdocs serve # live preview
6465

6566
The syntax for these "callouts" is almost exactly the same as in Crystal's own doc comments. As you may also know, if you **mention an identifier in backticks within a doc comment (e.g. <code>\`SomeClass#some_method\`</code>)**, Crystal's doc generator will cross-link to it. The same also works seamlessly here, and you don't need to change anything (other than possible edge cases).
6667

67-
But another powerful feature of this plugin is that you can **[cross-reference](https://pawamoy.github.io/mkdocstrings/usage/#cross-references) items like this *anywhere* on the site**, not just in doc comments. But the syntax is **`[SomeClass#some_method][]`** instead. Or `[with custom text][SomeClass#some_method]`. Note, though, that currently this cross-reference syntax is quite rigid, and you need to specify the exact absolute identifier as *mkdocstrings-crystal* determines it. To find that out, you could click on the wanted item in the navigation and then copy the anchor part from the URL bar -- the part after (not including) `#`.
68+
But another powerful feature of this plugin is that you can **[cross-reference](https://mkdocstrings.github.io/usage/#cross-references) items like this *anywhere* on the site**, not just in doc comments. But the syntax is **`[SomeClass#some_method][]`** instead. Or `[with custom text][SomeClass#some_method]`. Note, though, that currently this cross-reference syntax is quite rigid, and you need to specify the exact absolute identifier as *mkdocstrings-crystal* determines it. To find that out, you could click on the wanted item in the navigation and then copy the anchor part from the URL bar -- the part after (not including) `#`.
6869

6970
## Usage details
7071

@@ -73,5 +74,6 @@ We have been talking about seamlessly inserting Crystal documentation, but where
7374
Continue to [Configuration](configuration.md).
7475

7576

77+
[crystal]: https://crystal-lang.org/
7678
[mkdocs]: https://www.mkdocs.org/
77-
[mkdocstrings]: https://pawamoy.github.io/mkdocstrings/
79+
[mkdocstrings]: https://mkdocstrings.github.io/

docs/assets/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
font-size: inherit;
88
}
99

10-
/* https://pawamoy.github.io/mkdocstrings/handlers/python/#recommended-style-material */
10+
/* https://mkdocstrings.github.io/handlers/python/#recommended-style-material */
1111

1212
.doc-contents th, .doc-contents td {
1313
padding: 0.5em 0.8em !important;

docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Handler options
44

5-
(See also: [*mkdocstrings* global options](https://pawamoy.github.io/mkdocstrings/usage/#global-options))
5+
(See also: [*mkdocstrings* global options](https://mkdocstrings.github.io/usage/#global-options))
66

77
### `crystal_docs_flags:`
88

@@ -16,7 +16,7 @@ A list of command line arguments to pass to `crystal doc`. Mainly used to choose
1616
: Set to `true` to also recursively render all `Foo::Sub::Types` whenever rendering a given class `Foo`.
1717

1818
`file_filters:` [list of strings]
19-
: If a particular module spans over several files, you might want to choose to render only the sub-items (see `nested_types`) that came from a particular file. These patterns are regular expressions (not anchored) applied to the file path. Negating the patterns is done by starting it with `!` (which is then excluded from the following regex). This is very similar to [what's done in *mkdocstrings*](https://pawamoy.github.io/mkdocstrings/reference/handlers/python/#mkdocstrings.handlers.python.PythonCollector.default_config)
19+
: If a particular module spans over several files, you might want to choose to render only the sub-items (see `nested_types`) that came from a particular file. These patterns are regular expressions (not anchored) applied to the file path. Negating the patterns is done by starting it with `!` (which is then excluded from the following regex). This is very similar to [what's done in *mkdocstrings*](https://mkdocstrings.github.io/reference/handlers/python/#mkdocstrings.handlers.python.PythonCollector.default_config)
2020

2121
### `rendering:`
2222

docs/quickstart/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Let's configure [MkDocs][] with *mkdocstrings-crystal*. Add/merge this config as
5151
: Activate the upstream *mkdocstrings* plugin and tell it to collect items from Crystal, not Python, by default.
5252

5353
`watch: [src]`
54-
: Watch a directory for [auto-reload](https://pawamoy.github.io/mkdocstrings/usage/#watch-directories). Assuming the sources are under `src/`.
54+
: Watch a directory for [auto-reload](https://mkdocstrings.github.io/usage/#watch-directories). Assuming the sources are under `src/`.
5555

5656
[`pymdownx.*` extensions](https://facelessuser.github.io/pymdown-extensions/)
5757
: Python-Markdown is an "old-school" Markdown parser, and these extensions bring the defaults more in line with what people are used to now.

docs/showcase.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Here are some websites using this doc generator:
88
## Tourmaline
99

1010
* [Home page](https://tourmaline.dev/)[Repository](https://github.com/protoncr/tourmaline)
11-
* [Textual docs page with generated references](https://tourmaline.dev/usage/features/handlers/)[**Source**](https://github.com/protoncr/tourmaline/blob/master/docs/usage/features/handlers.md)
11+
* [**Textual docs page with generated references**](https://tourmaline.dev/usage/features/handlers/)[**Source**](https://github.com/protoncr/tourmaline/blob/master/docs/usage/features/handlers.md)
1212
* [Generated API docs page](https://tourmaline.dev/api_reference/Tourmaline/Client/)[gen_doc_stubs.py](https://github.com/protoncr/tourmaline/blob/master/docs/gen_doc_stubs.py)
1313
* [Partly inferred nav](https://github.com/protoncr/tourmaline/blob/master/docs/SUMMARY.md)
1414
* [**Custom styling**](https://github.com/protoncr/tourmaline/blob/master/docs/stylesheets/extra.css)

docs/troubleshooting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ You can always [customize the styles with CSS](styling.md), but make sure you've
3232

3333
## MkDocs warns me about links to unfound documentation files
3434

35-
[See documentation of *mkdocstrings*](https://pawamoy.github.io/mkdocstrings/troubleshooting/#mkdocs-warns-me-about-links-to-unfound-documentation-files)
35+
[See documentation of *mkdocstrings*](https://mkdocstrings.github.io/troubleshooting/#mkdocs-warns-me-about-links-to-unfound-documentation-files)
3636

3737
## Warning: could not find cross-reference target
3838

39-
[See documentation of *mkdocstrings*](https://pawamoy.github.io/mkdocstrings/troubleshooting/#warning-could-not-find-cross-reference-target)
39+
[See documentation of *mkdocstrings*](https://mkdocstrings.github.io/troubleshooting/#warning-could-not-find-cross-reference-target)

0 commit comments

Comments
 (0)