You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a proof of if ftd is ready, and as an example of content centric site, clippy site is pretty decent goal (eg if we can't create a site like this with ftd, ftd has failed).
If you go to that site you see something like this:
[
{
"id": "absurd_extreme_comparisons",
"group": "correctness",
"level": "Deny",
"docs": {
"What it does": "Checks for comparisons where one side of the relation is\neither the minimum or maximum value for its type and warns if it involves a\ncase that is always true or always false. Only integer and boolean types are\nchecked.",
"Why is this bad": "An expression like `min <= x` may misleadingly imply\nthat is is possible for `x` to be less than the minimum. Expressions like\n`max < x` are probably mistakes.",
"Known problems": "For `usize` the size of the current compile target will\nbe assumed (e.g., 64 bits on 64 bit systems). This means code that uses such\na comparison to detect target pointer width will trigger this lint. One can\nuse `mem::sizeof` and compare its value or conditional compilation\nattributes\nlike `#[cfg(target_pointer_width = \"64\")] ..` instead.",
"Example": "```rust\nlet vec: Vec<isize> = vec![];\nif vec.len() <= 0 {}\nif 100 > std::i32::MAX {}\n```"
}
},
.. omitted ..
]
FTD Is Better Than JSON For This Use Case
The JSON is really hard to write by hand. Same can be expressed better using ftd:
-- clippy.check: absurd_extreme_comparisons
group: correctness
level: Deny
what-it-does:
> Checks for comparisons where one side of the relation is
> either the minimum or maximum value for its type and warns if it involves a
> case that is always true or always false. Only integer and boolean types are
> checked.
why-it-is-bad:
> An expression like `min <= x` may misleadingly imply
> that is is possible for `x` to be less than the minimum. Expressions like
> `max < x` are probably mistakes.
known-problems:
> For `usize` the size of the current compile target will
> be assumed (e.g., 64 bits on 64 bit systems). This means code that uses such
> a comparison to detect target pointer width will trigger this lint.
>
> One can use `mem::sizeof` and compare its value or conditional compilation
> attributes like `#[cfg(target_pointer_width = \"64\")] ..` instead."
example:
> -- ft.code:
> lang: rs
>
> let vec: Vec<isize> = vec![];
> if vec.len() <= 0 {}
> if 100 > std::i32::MAX {}
As you can see, for multiline/prose data, JSON is particularly a bad format. YML may be better, but look at the example, this is not just text, but a UI.
This much we can do soon.
Building The App
The app itself, that consumes the JSON and build the UI on that page, is done using Javascript/CSS. Our goal with FTD is to make ftd powerful enough, that the search, filtering etc can be implemented with just ftd.
Currently you can build most the UI, including the click to expand/collapse behaviour, but not the search and filtering.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As a proof of if ftd is ready, and as an example of content centric site, clippy site is pretty decent goal (eg if we can't create a site like this with ftd, ftd has failed).
If you go to that site you see something like this:
The underlying data is JSON file like this:
FTD Is Better Than JSON For This Use Case
The JSON is really hard to write by hand. Same can be expressed better using ftd:
As you can see, for multiline/prose data, JSON is particularly a bad format. YML may be better, but look at the
example
, this is not just text, but a UI.This much we can do soon.
Building The App
The app itself, that consumes the JSON and build the UI on that page, is done using Javascript/CSS. Our goal with FTD is to make ftd powerful enough, that the search, filtering etc can be implemented with just ftd.
Currently you can build most the UI, including the click to expand/collapse behaviour, but not the search and filtering.
Beta Was this translation helpful? Give feedback.
All reactions