Need to create new Django content models for live samples. Going from the jsFiddle model, we need at least these fields: * parent document (since sheppy told me we can associate samples with a page) * caption * html * css * js * author * modified, created Thinking we also want to track revisions, so need to somewhat mirror the doc/rev relationship too.
I confirm that we will need to track revisions (and author should be linked to revision).
Rethinking this in context of louisremi's experimental PR: https://github.com/mozilla/kuma/pull/644 Rather than develop a completely separate collection of content objects devoted to code samples, maybe a live sample could be authored right inline on a wiki document as a group of code listings (ie. a <div> with HTML / CSS / JS sub-tabs). Then, I can build the server-side tooling to extract the cluster of code listings for a given sample ID, combine them into a working HTML document, and serve that up at an iframe-ready URL (bug 797474) louisremi's code does the above entirely with client-side JS, a sandboxed iframe, and a data: URL. But, there's some concern about browser compatibility, which is what makes me think we might need a server-side solution instead
(Oh, but one of the really important things: Managing code samples inline and extracting the code to build a page means that edits to a code sample would appear just like an edit to prose, with respect to change feeds and dashboards.)
Almost merged: https://github.com/mozilla/kuma/pull/645
Commits pushed to master at https://github.com/mozilla/kuma https://github.com/mozilla/kuma/commit/1ec9f1f45632e1133d26d606ab6094b1ea0d94ee bug 797472: Tooling to extract a code sample and parts from a document https://github.com/mozilla/kuma/commit/084ccaca0eab72c086d350bf6ef13805c41fa2c2 bug 797472: Model additions to extract code sample parts from a Document object https://github.com/mozilla/kuma/commit/0ccc3501b1e3ffede05f6e1164c97b6df2d49bf9 bug 797472: Tweak to use jinja2.escape in tests
Going to say that covers the initial stab at content models for live samples (or lack thereof). Code listings are managed as inline content on documents, and extracted to produce a live sample.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.