]> git.proxmox.com Git - rustc.git/blobdiff - src/librustdoc/html/layout.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / librustdoc / html / layout.rs
index 4ca71ea8684b29e62e16dea28d1985007eb2f126..7d6d4b71e2eaf6d9fa68236ea4e939fa28df2976 100644 (file)
@@ -10,33 +10,31 @@ use crate::html::render::{ensure_trailing_slash, StylePath};
 use askama::Template;
 
 #[derive(Clone)]
-crate struct Layout {
-    crate logo: String,
-    crate favicon: String,
-    crate external_html: ExternalHtml,
-    crate default_settings: FxHashMap<String, String>,
-    crate krate: String,
+pub(crate) struct Layout {
+    pub(crate) logo: String,
+    pub(crate) favicon: String,
+    pub(crate) external_html: ExternalHtml,
+    pub(crate) default_settings: FxHashMap<String, String>,
+    pub(crate) krate: String,
     /// The given user css file which allow to customize the generated
     /// documentation theme.
-    crate css_file_extension: Option<PathBuf>,
+    pub(crate) css_file_extension: Option<PathBuf>,
     /// If true, then scrape-examples.js will be included in the output HTML file
-    crate scrape_examples_extension: bool,
+    pub(crate) scrape_examples_extension: bool,
 }
 
-crate struct Page<'a> {
-    crate title: &'a str,
-    crate css_class: &'a str,
-    crate root_path: &'a str,
-    crate static_root_path: Option<&'a str>,
-    crate description: &'a str,
-    crate keywords: &'a str,
-    crate resource_suffix: &'a str,
-    crate extra_scripts: &'a [&'a str],
-    crate static_extra_scripts: &'a [&'a str],
+pub(crate) struct Page<'a> {
+    pub(crate) title: &'a str,
+    pub(crate) css_class: &'a str,
+    pub(crate) root_path: &'a str,
+    pub(crate) static_root_path: Option<&'a str>,
+    pub(crate) description: &'a str,
+    pub(crate) keywords: &'a str,
+    pub(crate) resource_suffix: &'a str,
 }
 
 impl<'a> Page<'a> {
-    crate fn get_static_root_path(&self) -> &str {
+    pub(crate) fn get_static_root_path(&self) -> &str {
         self.static_root_path.unwrap_or(self.root_path)
     }
 }
@@ -51,10 +49,10 @@ struct PageLayout<'a> {
     sidebar: String,
     content: String,
     krate_with_trailing_slash: String,
-    crate rustdoc_version: &'a str,
+    pub(crate) rustdoc_version: &'a str,
 }
 
-crate fn render<T: Print, S: Print>(
+pub(crate) fn render<T: Print, S: Print>(
     layout: &Layout,
     page: &Page<'_>,
     sidebar: S,
@@ -86,7 +84,7 @@ crate fn render<T: Print, S: Print>(
     .unwrap()
 }
 
-crate fn redirect(url: &str) -> String {
+pub(crate) fn redirect(url: &str) -> String {
     // <script> triggers a redirect before refresh, so this is fine.
     format!(
         r##"<!DOCTYPE html>