import popcorn
import popcorn::pop_config
import popcorn::pop_repos
+import popcorn::pop_json
# Nitweb config file.
class NitwebConfig
super AppConfig
- redef var default_db_name = "nitweb"
+ redef fun default_db_name do return "nitweb"
# Model to use.
var model: Model
#
# Can be serialized to json.
class APIError
- super Jsonable
serialize
# Reponse status
# * a `NSToken` for tokens like `::`, `>` and `$`
# * a `MSRef` for references to mentities
interface NSEntity
- super Jsonable
+ super Serializable
end
# A reference to a MEntity that can be rendered as a link.
v.serialize_attribute("mdoc", mentity.mdoc_or_fallback)
v.serialize_attribute("visibility", mentity.visibility.to_s)
v.serialize_attribute("modifiers", mentity.collect_modifiers)
+ v.serialize_attribute("class_name", mentity.class_name)
var mentity = self.mentity
if mentity isa MMethod then
v.serialize_attribute("msignature", mentity.intro.msignature)
# Add doc down processing
redef fun core_serialize_to(v) do
v.serialize_attribute("html_synopsis", html_synopsis.write_to_string)
- v.serialize_attribute("html_documentation", html_documentation.write_to_string)
end
end
end
return new Namespace.from([mmodule.full_name, "$::", mclass.intro_mmodule.to_ns_ref: nullable NSEntity])
end
+
+ redef fun web_url do return "{mclass.web_url}/lin#{full_name}"
end
redef class MProperty
end
return res
end
+
+ redef fun web_url do return "{mproperty.web_url}/lin#{full_name}"
end
redef class MClassType
end
redef class POSetElement[E]
- super Jsonable
+ super Serializable
- redef fun serialize_to(v) do
+ redef fun core_serialize_to(v) do
assert self isa POSetElement[MEntity]
- v.serialize_attribute("greaters", to_mentity_refs(greaters))
v.serialize_attribute("direct_greaters", to_mentity_refs(direct_greaters))
v.serialize_attribute("direct_smallers", to_mentity_refs(direct_smallers))
- v.serialize_attribute("smallers", to_mentity_refs(smallers))
end
end