-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from azriel91/feature/better-error-feedback
- Loading branch information
Showing
14 changed files
with
665 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,40 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use crate::theme::ThemeWarnings; | ||
|
||
/// Graphviz dot source and CSS styles. | ||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] | ||
pub struct DotSrcAndStyles { | ||
/// Graphviz dot source to run in `dot`. | ||
pub dot_src: String, | ||
/// Tailwind CSS styles to put into `<styles>..</styles>`. | ||
pub styles: String, | ||
/// Warnings detected while computing CSS utility classes. | ||
pub theme_warnings: ThemeWarnings, | ||
} | ||
|
||
impl DotSrcAndStyles { | ||
/// Returns a new `DotSrcAndStyles` object. | ||
pub fn new(dot_src: String, styles: String, theme_warnings: ThemeWarnings) -> Self { | ||
Self { | ||
dot_src, | ||
styles, | ||
theme_warnings, | ||
} | ||
} | ||
|
||
/// Returns the Graphviz dot source to run in `dot`. | ||
pub fn dot_src(&self) -> &str { | ||
&self.dot_src | ||
} | ||
|
||
/// Returns the tailwind CSS styles to put into `<styles>..</styles>`. | ||
pub fn styles(&self) -> &str { | ||
&self.styles | ||
} | ||
|
||
/// Returns the warnings detected while computing CSS utility classes. | ||
pub fn theme_warnings(&self) -> &ThemeWarnings { | ||
&self.theme_warnings | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.