Skip to content

Commit

Permalink
Merge pull request #6447 from squidfunk/goal/goats-horn
Browse files Browse the repository at this point in the history
Merged features tied to 'Goat's Horn' funding goal
  • Loading branch information
squidfunk authored Dec 7, 2023
2 parents 560bb90 + 39d390e commit 0f991a3
Show file tree
Hide file tree
Showing 87 changed files with 2,572 additions and 322 deletions.
40 changes: 17 additions & 23 deletions docs/insiders/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ a handful of them, [thanks to our awesome sponsors]!
## What's in it for me?

The moment you [become a sponsor][how to become a sponsor], you'll get __immediate
access to 25 additional features__ that you can __start using now__, and
access to 19 additional features__ that you can __start using now__, and
which are currently exclusively available to sponsors:

<div class="mdx-columns" markdown>
Expand All @@ -112,12 +112,6 @@ which are currently exclusively available to sponsors:
- [x] [Blog plugin: related links]
- [x] [Meta plugin]
- [x] [Tags plugin: additional indexes]
- [x] [Document contributors]
- [x] [Automatic light / dark mode]
- [x] [Content tabs: anchor links]
- [x] [Tooltips]
- [x] [Card grids]
- [x] [Privacy plugin]

</div>

Expand Down Expand Up @@ -270,22 +264,6 @@ features prefixed with a checkmark symbol, denoting whether a feature is
:octicons-check-circle-fill-24:{ style="color: var(--md-default-fg-color--lightest)" } planned, but not yet implemented. When the funding goal is hit, the features
are released for general availability.

#### $ 14,000 – Goat's Horn

- [x] [Privacy plugin]
- [x] [Card grids]
- [x] [Tooltips]
- [x] [Content tabs: anchor links]
- [x] [Automatic light / dark mode]
- [x] [Document contributors]

[Privacy plugin]: ../setup/ensuring-data-privacy.md
[Card grids]: ../reference/grids.md
[Tooltips]: ../reference/tooltips.md
[Content tabs: anchor links]: ../reference/content-tabs.md#anchor-links
[Automatic light / dark mode]: ../setup/changing-the-colors.md#automatic-light-dark-mode
[Document contributors]: ../setup/adding-a-git-repository.md#document-contributors

#### $ 16,000 – Chipotle

- [x] [Meta plugin]
Expand Down Expand Up @@ -344,6 +322,22 @@ This section lists all funding goals that were previously completed, which means
that those features were part of Insiders, but are now generally available and
can be used by all users.

#### $ 14,000 – Goat's Horn

- [x] [Privacy plugin]
- [x] [Card grids]
- [x] [Tooltips]
- [x] [Content tabs: anchor links]
- [x] [Automatic light / dark mode]
- [x] [Document contributors]

[Privacy plugin]: ../setup/ensuring-data-privacy.md#built-in-privacy-plugin
[Card grids]: ../reference/grids.md
[Tooltips]: ../reference/tooltips.md
[Content tabs: anchor links]: ../reference/content-tabs.md#anchor-links
[Automatic light / dark mode]: ../setup/changing-the-colors.md#automatic-light-dark-mode
[Document contributors]: ../setup/adding-a-git-repository.md#document-contributors

#### $ 12,000 – Piri Piri

- [x] [Blog plugin]
Expand Down
4 changes: 2 additions & 2 deletions docs/plugins/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The following settings are available:
#### <!-- md:setting config.enabled -->
<!-- md:version 9.2.0 -->
<!-- md:version 9.3.0 -->
<!-- md:default `false` -->

Use this setting to enable or disable the plugin when [building your project].
Expand Down Expand Up @@ -103,7 +103,7 @@ CI=true mkdocs build

#### <!-- md:setting config.plugins -->

<!-- md:version 9.2.0 -->
<!-- md:version 9.3.0 -->
<!-- md:default none -->

Use this setting to list the plugins that are part of the group. The syntax is
Expand Down
31 changes: 8 additions & 23 deletions docs/plugins/privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ external assets. With just a single line of configuration, the plugin can
automatically identify and download external assets, making GDPR compliance
as effortless as it can possibly be.

---

<!-- md:sponsors --> __Sponsors only__ – this plugin is currently reserved to
[our awesome sponsors].

[our awesome sponsors]: ../insiders/index.md

## Objective

### How it works
Expand Down Expand Up @@ -106,8 +99,7 @@ pipelines tailored to your project:

## Configuration

<!-- md:sponsors -->
<!-- md:version insiders-4.9.0 -->
<!-- md:version 9.5.0 -->
<!-- md:plugin [privacy] – built-in -->
<!-- md:flag multiple -->
<!-- md:flag experimental -->
Expand Down Expand Up @@ -135,8 +127,7 @@ The following settings are available:
#### <!-- md:setting config.enabled -->
<!-- md:sponsors -->
<!-- md:version insiders-4.10.0 -->
<!-- md:version 9.5.0 -->
<!-- md:default `true` -->

Use this setting to enable or disable the plugin when [building your project].
Expand All @@ -155,8 +146,7 @@ This configuration enables the plugin only during continuous integration (CI).

#### <!-- md:setting config.concurrency -->

<!-- md:sponsors -->
<!-- md:version insiders-4.30.0 -->
<!-- md:version 9.5.0 -->
<!-- md:default available CPUs - 1 -->

With more CPUs available, the plugin can do more work in parallel, and thus
Expand Down Expand Up @@ -186,8 +176,7 @@ The following settings are available for caching:

#### <!-- md:setting config.cache -->

<!-- md:sponsors -->
<!-- md:version insiders-4.30.0 -->
<!-- md:version 9.5.0 -->
<!-- md:default `true` -->

Use this setting to instruct the plugin to bypass the cache, in order to
Expand All @@ -205,8 +194,7 @@ plugins:

#### <!-- md:setting config.cache_dir -->

<!-- md:sponsors -->
<!-- md:version insiders-4.30.0 -->
<!-- md:version 9.5.0 -->
<!-- md:default `.cache/plugin/privacy` -->

It is normally not necessary to specify this setting, except for when you want
Expand All @@ -233,8 +221,7 @@ The following settings are available for external assets:

#### <!-- md:setting config.assets -->

<!-- md:sponsors -->
<!-- md:version insiders-4.37.0 -->
<!-- md:version 9.5.0 -->
<!-- md:default `true` -->

Use this setting to control whether the plugin should download external
Expand All @@ -253,8 +240,7 @@ plugins:

#### <!-- md:setting config.assets_fetch -->

<!-- md:sponsors -->
<!-- md:version insiders-4.37.0 -->
<!-- md:version 9.5.0 -->
<!-- md:default `true` -->

Use this setting to control whether the plugin should downloads or only report
Expand All @@ -272,8 +258,7 @@ plugins:

#### <!-- md:setting config.assets_fetch_dir -->

<!-- md:sponsors -->
<!-- md:version insiders-4.37.0 -->
<!-- md:version 9.5.0 -->
<!-- md:default `assets/external` -->

It is normally not necessary to specify this setting, except for when you want
Expand Down
9 changes: 4 additions & 5 deletions docs/reference/content-tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ See additional configuration options:
### Anchor links
<!-- md:sponsors -->
<!-- md:version insiders-4.17.0 -->
<!-- md:version 9.5.0 -->
<!-- md:flag experimental -->
In order to link to content tabs and share them more easily, [Insiders] adds
an anchor link to each content tab automatically, which you can copy via right
click or open in a new tab:
In order to link to content tabs and share them more easily, an anchor link is
automatically added to each content tab, which you can copy via right click or
open in a new tab:
=== "Open me in a new tab ..."
Expand Down
6 changes: 2 additions & 4 deletions docs/reference/grids.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ elements in a rectangular shape.
### Using card grids
<!-- md:sponsors -->
<!-- md:version insiders-4.12.0 -->
<!-- md:version 9.5.0 -->
<!-- md:flag experimental -->
Card grids wrap each grid item with a beautiful hover card that levitates on
Expand Down Expand Up @@ -226,8 +225,7 @@ to the grid.

### Using generic grids

<!-- md:sponsors -->
<!-- md:version insiders-4.12.0 -->
<!-- md:version 9.5.0 -->
<!-- md:flag experimental -->

Generic grids allow for arranging arbitrary block elements in a grid, including
Expand Down
3 changes: 1 addition & 2 deletions docs/reference/tooltips.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ See additional configuration options:
### Improved tooltips
<!-- md:sponsors -->
<!-- md:version insiders-4.15.0 -->
<!-- md:version 9.5.0 -->
<!-- md:flag experimental -->
When improved tooltips are enabled, Material for MkDocs replaces the browser's
Expand Down
11 changes: 6 additions & 5 deletions docs/setup/adding-a-git-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ them at your own risk.

#### Document contributors

<!-- md:sponsors -->
<!-- md:version insiders-4.19.0 -->
<!-- md:version 9.5.0 -->
<!-- md:plugin [git-committers] -->
<!-- md:flag experimental -->

Expand Down Expand Up @@ -324,16 +323,18 @@ them at your own risk.

#### Document authors

<!-- md:sponsors -->
<!-- md:version insiders-4.19.0 -->
<!-- md:version 9.5.0 -->
<!-- md:plugin [git-authors] -->
<!-- md:flag experimental -->

The [git-authors] plugin is a lightweight alternative to the
[git-committers] plugin and extracts the authors of a document from git to display
them at the bottom of each page.

[Insiders] offers deep integration for [git-authors]. This means the [customized overrides](https://timvink.github.io/mkdocs-git-authors-plugin/usage.html#mkdocs-material-theme) are not necessary, and additional styling (such as nice icons) are added. Simply install it with `pip`:
Material for MkDocs offers deep integration for [git-authors]. This means the
[customized overrides](https://timvink.github.io/mkdocs-git-authors-plugin/usage.html#mkdocs-material-theme)
are not necessary, and additional styling (such as nice icons) are added.
Simply install it with `pip`:

```
pip install mkdocs-git-authors-plugin
Expand Down
3 changes: 1 addition & 2 deletions docs/setup/changing-the-colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ default color palette.

#### Automatic light / dark mode

<!-- md:sponsors -->
<!-- md:version insiders-4.18.0 -->
<!-- md:version 9.5.0 -->
<!-- md:flag experimental -->
<!-- md:example color-palette-system-preference -->

Expand Down
3 changes: 1 addition & 2 deletions docs/setup/ensuring-data-privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ copyright: >

### Built-in privacy plugin

<!-- md:sponsors -->
<!-- md:version insiders-4.9.0 -->
<!-- md:version 9.5.0 -->
<!-- md:plugin [privacy][built-in privacy plugin] -->
<!-- md:flag experimental -->

Expand Down
2 changes: 1 addition & 1 deletion material/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

__version__ = "9.4.14"
__version__ = "9.5.0"

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{ 'assets/javascripts/custom.fe17d8dd.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/custom.2340dcd7.min.js' | url }}"></script>
{% endblock %}
20 changes: 4 additions & 16 deletions material/plugins/blog/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def on_files(self, files, *, config):
root = posixpath.normpath(self.config.blog_dir)
site = config.site_dir

# Compute path to posts directory
# Compute and normalize path to posts directory
path = self.config.post_dir.format(blog = root)
path = posixpath.normpath(path)

Expand Down Expand Up @@ -265,10 +265,11 @@ def on_page_markdown(self, markdown, *, page, config, files):
# is not already present, so we can remove footnotes or other content
# from the excerpt without affecting the content of the excerpt
if separator not in page.markdown:
path = page.file.src_path
if self.config.post_excerpt == "required":
docs = os.path.relpath(config.docs_dir)
path = os.path.relpath(page.file.abs_src_path, docs)
raise PluginError(
f"Couldn't find '{separator}' separator in '{path}'"
f"Couldn't find '{separator}' in post '{path}' in '{docs}'"
)
else:
page.markdown += f"\n\n{separator}"
Expand Down Expand Up @@ -476,19 +477,6 @@ def _resolve_authors(self, config: MkDocsConfig):

# Validate authors and throw if errors occurred
errors, warnings = config.validate()
if not config.authors and warnings:
log.warning(
f"Action required: the format of the authors file changed.\n"
f"All authors must now be located under the 'authors' key.\n"
f"Please adjust '{file}' to match:\n"
f"\n"
f"authors:\n"
f" squidfunk:\n"
f" avatar: https://avatars.githubusercontent.com/u/932156\n"
f" description: Creator\n"
f" name: Martin Donath\n"
f"\n"
)
for _, w in warnings:
log.warning(w)
for _, e in errors:
Expand Down
4 changes: 2 additions & 2 deletions material/plugins/blog/structure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, file: File, config: MkDocsConfig):
self.markdown = f.read()

# Sadly, MkDocs swallows any exceptions that occur during parsing.
# As we want to provide the best possible authoring experience, we
# Since we want to provide the best possible user experience, we
# need to catch errors early and display them nicely. We decided to
# drop support for MkDocs' MultiMarkdown syntax, because it is not
# correctly implemented anyway. When using MultiMarkdown syntax, all
Expand All @@ -80,7 +80,7 @@ def __init__(self, file: File, config: MkDocsConfig):
self.markdown = self.markdown[match.end():].lstrip("\n")

# The post's metadata could not be parsed because of a syntax error,
# which we display to the user with a nice error message
# which we display to the author with a nice error message
except Exception as e:
raise PluginError(
f"Error reading metadata of post '{path}' in '{docs}':\n"
Expand Down
8 changes: 4 additions & 4 deletions material/plugins/blog/structure/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ def __init__(self, *args, **kwargs):
# Normalize the supported types for post dates to datetime
def pre_validation(self, config: Config, key_name: str):

# If the date points to a scalar value, convert it to a dictionary,
# since we want to allow the user to specify custom and arbitrary date
# values for posts. Currently, only the `created` date is mandatory,
# because it's needed to sort posts for views.
# If the date points to a scalar value, convert it to a dictionary, as
# we want to allow the author to specify custom and arbitrary dates for
# posts. Currently, only the `created` date is mandatory, because it's
# needed to sort posts for views.
if not isinstance(config[key_name], dict):
config[key_name] = { "created": config[key_name] }

Expand Down
4 changes: 2 additions & 2 deletions material/plugins/group/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def on_startup(self, *, command, dirty):
# little hacky, but has huge potential making plugin configuration easier.
# There's one little caveat: the `__init__` and `on_startup` methods of the
# plugins that are part of the group are called after all other plugins, so
# the `event_priority` decorator for `on_startup` events and is effectively
# useless. However, the `on_startup` event is only intended to set up the
# the `event_priority` decorator for `on_startup` methods is effectively
# useless. However, the `on_startup` method is only intended to set up the
# plugin and doesn't receive anything else than the invoked command and
# whether we're running a dirty build, so there should be no problems.
@event_priority(150)
Expand Down
Loading

0 comments on commit 0f991a3

Please sign in to comment.