Content model for live samples

RESOLVED FIXED

Status

RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: lorchard, Assigned: lorchard)

Tracking

Details

(Whiteboard: p=2 s=2012-10-16)

(Assignee)

Description

6 years ago
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.
(Assignee)

Updated

6 years ago
Blocks: 797474
Duplicate of this bug: 797596
Whiteboard: p=2
I confirm that we will need to track revisions (and author should be linked to revision).
(Assignee)

Updated

6 years ago
Assignee: nobody → lorchard
(Assignee)

Updated

6 years ago
Whiteboard: p=2 → p=2 s=2012-10-16
(Assignee)

Comment 3

6 years ago
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
(Assignee)

Comment 4

6 years ago
(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.)

Comment 6

6 years ago
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
(Assignee)

Comment 7

6 years ago
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.