mirror of
https://github.com/enso-org/enso.git
synced 2024-12-18 14:01:37 +03:00
341b235fb1
Two tasks: - [Task link](https://www.pivotaltracker.com/story/show/184024127) - [Task link](https://www.pivotaltracker.com/story/show/184024148) This PR implements the generation of HTML from Documentation IR for section headers and the Synopsis section. The synopsis contains documentation of the type/module + a list of the type's constructors. https://user-images.githubusercontent.com/6566674/212684680-d999b525-56c7-4952-8ccc-192989acdf33.mp4 # Important Notes - Paddings are removed from the documentation panel because they are now implemented in the HTML generator, but it doesn't affect the looks much (documentation still looks awful). All other changes do not affect the current look of the component browser and are only shown in the demo scene. https://user-images.githubusercontent.com/6566674/212685347-addb9204-8441-44be-8d8e-3c2626d77f77.mp4
39 lines
1.4 KiB
Rust
39 lines
1.4 KiB
Rust
//! This script would run Tailwind CLI utility to generate a CSS stylesheet by scanning the
|
|
//! source code for class names and including needed CSS rules in the output file.
|
|
//!
|
|
//! See crate documentation to learn more.
|
|
|
|
use ide_ci::prelude::*;
|
|
|
|
use ide_ci::programs::Npm;
|
|
|
|
|
|
|
|
/// The path to the input file. One can define arbitrary CSS rules there and they will be copied
|
|
/// in the output file.
|
|
const CSS_INPUT_PATH: &str = "assets/input.css";
|
|
/// The filename of the resulting CSS stylesheet. It will be generated inside `OUT_DIR`.
|
|
const CSS_OUTPUT_FILENAME: &str = "stylesheet.css";
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result {
|
|
// We should rerun the tailwind on changes in our sources.
|
|
// Tailwind scans this directory to determine the used classes.
|
|
println!("cargo:rerun-if-changed=src");
|
|
// We should rerun the tailwind on changes in the input CSS file.
|
|
// It may contain custom CSS rules.
|
|
println!("cargo:rerun-if-changed={CSS_INPUT_PATH}");
|
|
println!("cargo:rerun-if-changed=tailwind.config.js");
|
|
|
|
install_and_run_tailwind().await?;
|
|
Ok(())
|
|
}
|
|
|
|
async fn install_and_run_tailwind() -> Result {
|
|
Npm.cmd()?.install().run_ok().await?;
|
|
let out_path = PathBuf::from(std::env::var("OUT_DIR").unwrap()).join(CSS_OUTPUT_FILENAME);
|
|
let args: &[&str] = &["--", "-i", CSS_INPUT_PATH, "-o", out_path.as_str()];
|
|
Npm.cmd()?.run("generate", args).run_ok().await?;
|
|
Ok(())
|
|
}
|