diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dff7fe5..31b8db17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ |fixed| clarity of `flow_cap_min` description in documentation (#653). +|changed| API/schema documentation is de-ranked in documentation search bar results (#670). + |new| Math component cross-references in both directions ("uses" and "used in") in Markdown math documentation (#643). |fixed| Duplicated links in math documentation (#651). diff --git a/docs/hooks/generate_readable_schema.py b/docs/hooks/generate_readable_schema.py index 19ee6d32..8b104351 100644 --- a/docs/hooks/generate_readable_schema.py +++ b/docs/hooks/generate_readable_schema.py @@ -8,6 +8,7 @@ """ import tempfile +import textwrap from pathlib import Path import jsonschema2md @@ -55,7 +56,16 @@ def _schema_to_md(schema: dict, filename: str, config: dict) -> File: assert lines[2] == "## Properties\n\n" del lines[2] - output_full_filepath.write_text("\n".join(lines)) + initial_lines = textwrap.dedent( + """ + --- + search: + boost: 0.25 + --- + + """ + ) + output_full_filepath.write_text(initial_lines.lstrip() + "\n".join(lines)) return File( path=output_file, diff --git a/docs/reference/api/attrdict.md b/docs/reference/api/attrdict.md index fb327d0c..0ce310ee 100644 --- a/docs/reference/api/attrdict.md +++ b/docs/reference/api/attrdict.md @@ -1 +1,6 @@ -::: calliope.attrdict.AttrDict \ No newline at end of file +--- +search: + boost: 0.5 +--- + +::: calliope.attrdict.AttrDict diff --git a/docs/reference/api/backend_model.md b/docs/reference/api/backend_model.md index e075bd6c..45f4080e 100644 --- a/docs/reference/api/backend_model.md +++ b/docs/reference/api/backend_model.md @@ -1 +1,6 @@ -::: calliope.backend.backend_model.BackendModel \ No newline at end of file +--- +search: + boost: 0.5 +--- + +::: calliope.backend.backend_model.BackendModel diff --git a/docs/reference/api/example_models.md b/docs/reference/api/example_models.md index 9af2e23d..e98e8ad1 100644 --- a/docs/reference/api/example_models.md +++ b/docs/reference/api/example_models.md @@ -1 +1,6 @@ -::: calliope.examples \ No newline at end of file +--- +search: + boost: 0.5 +--- + +::: calliope.examples diff --git a/docs/reference/api/exceptions.md b/docs/reference/api/exceptions.md index 8b501da2..7bfc04cf 100644 --- a/docs/reference/api/exceptions.md +++ b/docs/reference/api/exceptions.md @@ -1 +1,6 @@ -::: calliope.exceptions \ No newline at end of file +--- +search: + boost: 0.5 +--- + +::: calliope.exceptions diff --git a/docs/reference/api/helper_functions.md b/docs/reference/api/helper_functions.md index 91e03e1c..7ecfc5b0 100644 --- a/docs/reference/api/helper_functions.md +++ b/docs/reference/api/helper_functions.md @@ -1 +1,6 @@ -::: calliope.backend.helper_functions \ No newline at end of file +--- +search: + boost: 0.5 +--- + +::: calliope.backend.helper_functions diff --git a/docs/reference/api/logging.md b/docs/reference/api/logging.md index 0647613b..654de738 100644 --- a/docs/reference/api/logging.md +++ b/docs/reference/api/logging.md @@ -1 +1,6 @@ -::: calliope.util.logging \ No newline at end of file +--- +search: + boost: 0.5 +--- + +::: calliope.util.logging diff --git a/docs/reference/api/model.md b/docs/reference/api/model.md index 696588f9..a76cdc02 100644 --- a/docs/reference/api/model.md +++ b/docs/reference/api/model.md @@ -1 +1,6 @@ -::: calliope.Model \ No newline at end of file +--- +search: + boost: 0.5 +--- + +::: calliope.Model diff --git a/docs/reference/api/schema.md b/docs/reference/api/schema.md index a3f46cfc..99ade3e1 100644 --- a/docs/reference/api/schema.md +++ b/docs/reference/api/schema.md @@ -1 +1,6 @@ -::: calliope.util.schema \ No newline at end of file +--- +search: + boost: 0.5 +--- + +::: calliope.util.schema diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 90538b72..4c3a4ad9 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -1,3 +1,8 @@ +--- +search: + boost: 0.5 +--- + # CLI Reference This page provides documentation for the `calliope` command line tool. diff --git a/mkdocs.yml b/mkdocs.yml index 6c80b722..1ea0bbad 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -25,6 +25,9 @@ theme: - navigation.top - content.code.copy - content.code.annotate + - search.suggest + - search.highlight + - search.share logo: img/logo-bw.png favicon: img/favicon.ico extra_css: