remove id attribute from pages
really, use the one from branches instead
This commit is contained in:
parent
600651ec16
commit
f518d7a0ff
|
@ -97,7 +97,7 @@ impl SemaRoots {
|
||||||
let successfully_parsed = successfully_parsed;
|
let successfully_parsed = successfully_parsed;
|
||||||
|
|
||||||
if successfully_parsed {
|
if successfully_parsed {
|
||||||
let attribute_warning_span = roots
|
let _attribute_warning_span = roots
|
||||||
.attributes
|
.attributes
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|attributes| attributes.percent.clone())
|
.map(|attributes| attributes.percent.clone())
|
||||||
|
@ -109,28 +109,6 @@ impl SemaRoots {
|
||||||
_ => panic!("parse_attributes called for a non-.tree file"),
|
_ => panic!("parse_attributes called for a non-.tree file"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if attributes.id.is_empty() {
|
|
||||||
attributes.id = format!("treehouse-missingno-{}", treehouse.next_missingno());
|
|
||||||
diagnostics.push(Diagnostic {
|
|
||||||
severity: Severity::Warning,
|
|
||||||
code: Some("attr".into()),
|
|
||||||
message: "page does not have an `id` attribute".into(),
|
|
||||||
labels: vec![Label {
|
|
||||||
style: LabelStyle::Primary,
|
|
||||||
file_id,
|
|
||||||
range: attribute_warning_span.clone(),
|
|
||||||
message: String::new(),
|
|
||||||
}],
|
|
||||||
notes: vec![
|
|
||||||
format!(
|
|
||||||
"note: a generated id `{}` will be used, but this id is unstable and will not persist across generations",
|
|
||||||
attributes.id
|
|
||||||
),
|
|
||||||
format!("help: run `treehouse fix {}` to add missing ids to pages", treehouse.path(file_id)),
|
|
||||||
],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(thumbnail) = &attributes.thumbnail {
|
if let Some(thumbnail) = &attributes.thumbnail {
|
||||||
|
|
|
@ -7,10 +7,6 @@ use crate::{state::FileId, vfs::VPathBuf};
|
||||||
/// Top-level `%%` root attributes.
|
/// Top-level `%%` root attributes.
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
pub struct RootAttributes {
|
pub struct RootAttributes {
|
||||||
/// Permanent ID of this page.
|
|
||||||
#[serde(default)]
|
|
||||||
pub id: String,
|
|
||||||
|
|
||||||
/// Template to use for generating the page.
|
/// Template to use for generating the page.
|
||||||
/// Defaults to `_tree.hbs`.
|
/// Defaults to `_tree.hbs`.
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
use treehouse::vfs::{
|
use treehouse::vfs::{entries, query, BufferedFile, Content, MemDir, ToDynDir, VPath, VPathBuf};
|
||||||
entries, query, BufferedFile, Content, Dir, MemDir, ToDynDir, VPath, VPathBuf,
|
|
||||||
};
|
|
||||||
|
|
||||||
const HEWWO: &[u8] = b"hewwo :3";
|
const HEWWO: &[u8] = b"hewwo :3";
|
||||||
const FWOOFEE: &[u8] = b"fwoofee -w-";
|
const FWOOFEE: &[u8] = b"fwoofee -w-";
|
||||||
|
|
Loading…
Reference in a new issue