We will design a function model for Z89/HTML Fragment. Functions will return HTML strings wrapped in a Z89 type. They will be rendered on both the Wikifunctions platform and within Wikipedia articles.
Investigate and implement how Z89/HTML Fragment should be represented, stored, and processed within the function model.
Details
- Implement a basic function model for Z89/HTML Fragment, where:
- Z89K1 is a string containing sanitized HTML content.
{ "Z1K1": "Z89", "Z89K1": "<strong>Strong text</strong>" }
- We start with no built-ins. The community can make functions like ‘concat Z89’ or a composition to turn a string into a Z89.
- Functions will allow the manipulation of these fragments (e.g., combining strings or applying formatting).
- makeStrong() to add bold formatting.
- joinHTML() to combine multiple HTML fragments.
- Example function implementation to make text Bold in Python:
- makeStrong(), which takes a Z89 and returns a Z89.
def Z22222(Z2222K1): return '<strong>' + Z2222K1 + '</strong>'
- Example function to combine different HTML outputs:
- joinHTML takes a Z89 and returns a Z89.
- makeHTML takes a Z6/String and returns a Z89
- makeBoldHTML takes a Z6/String and returns a Z89
joinHTML([makeHTML("this is "), makeBoldHTML("the result"), makeHTML(" I want to see")])
Closing reason
We go with the current Z89 function model and don't change it for now