diff --git a/compiler-core/src/docs.rs b/compiler-core/src/docs.rs index 3c4781723d5..dbbfa1a7a85 100644 --- a/compiler-core/src/docs.rs +++ b/compiler-core/src/docs.rs @@ -363,7 +363,7 @@ pub fn generate_html( ), }); - // lunr.min.js, search-data.js, search_data.json and index.js + // lunr.min.js, search_data.json and index.js files.push(OutputFile { path: Utf8PathBuf::from("js/lunr.min.js"), @@ -376,11 +376,6 @@ pub fn generate_html( }) .expect("search index serialization"); - files.push(OutputFile { - path: Utf8PathBuf::from("search-data.js"), - content: Content::Text(format!("window.Gleam.initSearch({});", search_data_json)), - }); - files.push(OutputFile { path: Utf8PathBuf::from("search_data.json"), content: Content::Text(search_data_json.to_string()), diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__canonical_link.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__canonical_link.snap index 7bb68cb1431..2dc77128c81 100644 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__canonical_link.snap +++ b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__canonical_link.snap @@ -1,6 +1,7 @@ --- source: compiler-core/src/docs/tests.rs expression: "compile_with_markdown_pages(config, modules, pages,\nCompileWithMarkdownPagesOpts::default())" +snapshot_kind: text --- //// LICENSE.html @@ -313,11 +314,14 @@ expression: "compile_with_markdown_pages(config, modules, pages,\nCompileWithMar }); hljs.highlightAll(); + - - - + @@ -678,11 +682,14 @@ expression: "compile_with_markdown_pages(config, modules, pages,\nCompileWithMar }); hljs.highlightAll(); + - - - + @@ -1043,10 +1050,13 @@ expression: "compile_with_markdown_pages(config, modules, pages,\nCompileWithMar }); hljs.highlightAll(); + - - - + diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__discarded_arguments_are_not_shown.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__discarded_arguments_are_not_shown.snap index 55fd3906874..5341d401f56 100644 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__discarded_arguments_are_not_shown.snap +++ b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__discarded_arguments_are_not_shown.snap @@ -1,6 +1,7 @@ --- source: compiler-core/src/docs/tests.rs expression: "compile(config, modules)" +snapshot_kind: text --- //// app.html @@ -349,10 +350,13 @@ expression: "compile(config, modules)" }); hljs.highlightAll(); + - - - + diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__docs_of_a_type_constructor_are_not_used_by_the_following_function.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__docs_of_a_type_constructor_are_not_used_by_the_following_function.snap index ae63f70fecb..70374ad5eda 100644 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__docs_of_a_type_constructor_are_not_used_by_the_following_function.snap +++ b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__docs_of_a_type_constructor_are_not_used_by_the_following_function.snap @@ -1,6 +1,7 @@ --- source: compiler-core/src/docs/tests.rs expression: "compile(config, modules)" +snapshot_kind: text --- //// app.html @@ -424,10 +425,13 @@ expression: "compile(config, modules)" }); hljs.highlightAll(); + - - - + diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__hello_docs.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__hello_docs.snap index ef42e14b907..ed516bb2889 100644 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__hello_docs.snap +++ b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__hello_docs.snap @@ -1,6 +1,7 @@ --- source: compiler-core/src/docs/tests.rs expression: "compile(config, modules)" +snapshot_kind: text --- //// app.html @@ -350,10 +351,13 @@ expression: "compile(config, modules)" }); hljs.highlightAll(); + - - - + diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__internal_definitions_are_not_included.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__internal_definitions_are_not_included.snap index d5a5e563ac4..43cb634a82d 100644 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__internal_definitions_are_not_included.snap +++ b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__internal_definitions_are_not_included.snap @@ -1,6 +1,7 @@ --- source: compiler-core/src/docs/tests.rs expression: "compile(config, modules)" +snapshot_kind: text --- //// app.html @@ -319,10 +320,13 @@ expression: "compile(config, modules)" }); hljs.highlightAll(); + - - - + diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__long_function_wrapping.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__long_function_wrapping.snap index aa2d5fe05ec..8d79a96b260 100644 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__long_function_wrapping.snap +++ b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__long_function_wrapping.snap @@ -1,6 +1,7 @@ --- source: compiler-core/src/docs/tests.rs expression: "compile(config, modules)" +snapshot_kind: text --- //// app.html @@ -423,10 +424,13 @@ function for a fallback value.

}); hljs.highlightAll(); + - - - + diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_function_comment_is_trimmed.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_function_comment_is_trimmed.snap index cec17872cd0..451c215b160 100644 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_function_comment_is_trimmed.snap +++ b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_function_comment_is_trimmed.snap @@ -1,6 +1,7 @@ --- source: compiler-core/src/docs/tests.rs expression: "compile(config, modules)" +snapshot_kind: text --- //// app.html @@ -353,10 +354,13 @@ expression: "compile(config, modules)" }); hljs.highlightAll(); + - - - + diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_module_comment_is_trimmed.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_module_comment_is_trimmed.snap index a4bb0867b56..c72cd86a808 100644 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_module_comment_is_trimmed.snap +++ b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_module_comment_is_trimmed.snap @@ -1,6 +1,7 @@ --- source: compiler-core/src/docs/tests.rs expression: "compile(config, modules)" +snapshot_kind: text --- //// app.html @@ -323,10 +324,13 @@ expression: "compile(config, modules)" }); hljs.highlightAll(); + - - - + diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_standalone_pages_is_not_trimmed.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_standalone_pages_is_not_trimmed.snap index 695b69128d4..5994aaec5cf 100644 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_standalone_pages_is_not_trimmed.snap +++ b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__markdown_code_from_standalone_pages_is_not_trimmed.snap @@ -1,6 +1,7 @@ --- source: compiler-core/src/docs/tests.rs expression: "compile_with_markdown_pages(config, vec![], pages,\nCompileWithMarkdownPagesOpts::default())" +snapshot_kind: text --- //// one.html @@ -313,10 +314,13 @@ expression: "compile_with_markdown_pages(config, vec![], pages,\nCompileWithMark }); hljs.highlightAll(); + - - - + diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__no_hex_publish.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__no_hex_publish.snap index cf4add106d6..8b08ae94567 100644 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__no_hex_publish.snap +++ b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__no_hex_publish.snap @@ -1,6 +1,7 @@ --- source: compiler-core/src/docs/tests.rs expression: "compile_with_markdown_pages(config, modules, pages,\nCompileWithMarkdownPagesOpts { hex_publish: Some(DocContext::Build) })" +snapshot_kind: text --- //// LICENSE.html @@ -306,11 +307,14 @@ expression: "compile_with_markdown_pages(config, modules, pages,\nCompileWithMar }); hljs.highlightAll(); + - - - + @@ -664,11 +668,14 @@ expression: "compile_with_markdown_pages(config, modules, pages,\nCompileWithMar }); hljs.highlightAll(); + - - - + @@ -1022,10 +1029,13 @@ expression: "compile_with_markdown_pages(config, modules, pages,\nCompileWithMar }); hljs.highlightAll(); + - - - + diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__output_of_search_data_js.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__output_of_search_data_js.snap deleted file mode 100644 index 6bb082c829b..00000000000 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__output_of_search_data_js.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: compiler-core/src/docs/tests.rs -expression: json_wrapped_in_js -snapshot_kind: text ---- -window.Gleam.initSearch({"items":[{"type":"module","parentTitle":"gleam/option","title":"gleam/option","doc":"","ref":"gleam/option.html"},{"type":"type","parentTitle":"gleam/option","title":"Option","doc":"`Option` represents a value that may be present or not. `Some` means the value is present, `None` means the value is not.","ref":"gleam/option.html#Option"},{"type":"function","parentTitle":"gleam/option","title":"unwrap","doc":"Extracts the value from an `Option`, returning a default value if there is none.","ref":"gleam/option.html#unwrap"},{"type":"constant","parentTitle":"gleam/dynamic/decode","title":"bool","doc":"A decoder that decodes `Bool` values.\n\n # Examples\n\n \n let result = decode.run(dynamic.from(True), decode.bool)\n assert result == Ok(True)\n \n","ref":"gleam/dynamic/decode.html#bool"}],"proglang":"gleam"}); diff --git a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__tables.snap b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__tables.snap index f7a86d7a0dd..8a5c9df7a66 100644 --- a/compiler-core/src/docs/snapshots/gleam_core__docs__tests__tables.snap +++ b/compiler-core/src/docs/snapshots/gleam_core__docs__tests__tables.snap @@ -1,6 +1,7 @@ --- source: compiler-core/src/docs/tests.rs expression: "compile(config, modules)" +snapshot_kind: text --- //// app.html @@ -353,10 +354,13 @@ expression: "compile(config, modules)" }); hljs.highlightAll(); + - - - + diff --git a/compiler-core/src/docs/tests.rs b/compiler-core/src/docs/tests.rs index 78640e7fb42..5e04616f549 100644 --- a/compiler-core/src/docs/tests.rs +++ b/compiler-core/src/docs/tests.rs @@ -551,11 +551,3 @@ fn output_of_search_data_json() { let json = serde_to_string(&data).unwrap(); insta::assert_snapshot!(json); } - -#[test] -fn output_of_search_data_js() { - let data = create_sample_search_data(); - let json = serde_to_string(&data).unwrap(); - let json_wrapped_in_js = format!("window.Gleam.initSearch({});", json); - insta::assert_snapshot!(json_wrapped_in_js); -} diff --git a/compiler-core/templates/documentation_layout.html b/compiler-core/templates/documentation_layout.html index b79413a7903..3af4592e4e7 100644 --- a/compiler-core/templates/documentation_layout.html +++ b/compiler-core/templates/documentation_layout.html @@ -302,10 +302,13 @@

Modules

}); hljs.highlightAll(); + - - - +