Closed
Bug 797472
Opened 12 years ago
Closed 12 years ago
Content model for live samples
Categories
(developer.mozilla.org Graveyard :: Wiki pages, defect)
developer.mozilla.org Graveyard
Wiki pages
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: lorchard, Assigned: lorchard)
References
Details
(Whiteboard: p=2 s=2012-10-16)
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.
Updated•12 years ago
|
Whiteboard: p=2
Comment 2•12 years ago
|
||
I confirm that we will need to track revisions (and author should be linked to revision).
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → lorchard
Assignee | ||
Updated•12 years ago
|
Whiteboard: p=2 → p=2 s=2012-10-16
Assignee | ||
Comment 3•12 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•12 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.)
Assignee | ||
Comment 5•12 years ago
|
||
Almost merged: https://github.com/mozilla/kuma/pull/645
Comment 6•12 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•12 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
Closed: 12 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•