You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Add an XML schema for documentation
This makes it easier to spot syntax errors when editing the class reference. The schema is referenced locally so validation can still work offline. Each class XML's schema conformance is also checked on GitHub Actions.
This commit is contained in:
@@ -1356,7 +1356,12 @@ Error DocTools::save_classes(const String &p_default_path, const Map<String, Str
|
||||
header += " inherits=\"" + c.inherits + "\"";
|
||||
}
|
||||
header += String(" version=\"") + VERSION_BRANCH + "\"";
|
||||
header += ">";
|
||||
// Reference the XML schema so editors can provide error checking.
|
||||
// Modules are nested deep, so change the path to reference the same schema everywhere.
|
||||
const String schema_path = save_path.find("modules/") != -1 ? "../../../doc/class.xsd" : "../class.xsd";
|
||||
header += vformat(
|
||||
R"( xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="%s">)",
|
||||
schema_path);
|
||||
_write_string(f, 0, header);
|
||||
|
||||
_write_string(f, 1, "<brief_description>");
|
||||
|
||||
Reference in New Issue
Block a user