diff --git a/libraries/from-bodyxml/index.js b/libraries/from-bodyxml/index.js index c1d19b6..46740ee 100644 --- a/libraries/from-bodyxml/index.js +++ b/libraries/from-bodyxml/index.js @@ -9,6 +9,17 @@ let ContentType = { article: "http://www.ft.com/ontology/content/Article", } +/** + * @param {string} layoutWidth + * @returns {ContentTree.LayoutWidth} + */ +function toValidLayoutWidth(layoutWidth) { + if(["auto", "in-line", "inset-left", "inset-right", "full-bleed", "full-grid", "mid-grid", "full-width"].includes(layoutWidth)) { + return /** @type {ContentTree.LayoutWidth} */(layoutWidth); + } else { + return 'full-width'; + } +} /** * @typedef {import("unist").Parent} UParent * @typedef {import("unist").Node} UNode @@ -47,6 +58,15 @@ export let defaultTransformers = { level: "subheading", } }, + /** + * @type {Transformer} + */ + h3(h3) { + return { + type: "heading", + level: "subheading", + } + }, /** * @type {Transformer} */ @@ -105,14 +125,25 @@ export let defaultTransformers = { } }, /** - * @type {Transformer} + * @type {Transformer} */ a(a) { - return { + if(a.attributes['data-asset-type'] === 'video') { + const url = a.attributes.href ?? ''; + if(url.includes('youtube.com')) { + return /** @type {ContentTree.transit.YoutubeVideo} */({ + type: "youtube-video", + url: url, + children: null + }) + } + //TODO: specialist support Vimeo, but this isn't in the Content Tree spec yet + } + return /** @type {ContentTree.transit.Link} */({ type: "link", title: a.attributes.title ?? "", url: a.attributes.href ?? "", - } + }) }, /** * @type {Transformer} @@ -161,6 +192,19 @@ export let defaultTransformers = { children: null, } }, + /** + * @type {Transformer} + */ + ["big-number"](bn) { + let number = find(bn, {name: "big-number-headline"}) + let description = find(bn, {name: "big-number-intro"}) + return { + type: "big-number", + number: number ? xastToString(number) : "", + description: description ? xastToString(description) : "", + children: null, + } + }, /** * @type {Transformer} */ @@ -168,10 +212,11 @@ export let defaultTransformers = { return { type: "layout-image", id: img.attributes.src ?? "", - credit: img.attributes["data-copyright"]?.replace(/^© /, "") ?? "", + credit: img.attributes["data-copyright"] ?? "", // todo this can't be right - alt: img.attributes.longdesc ?? "", + alt: img.attributes.alt ?? "", caption: img.attributes.longdesc ?? "", + children: null, } }, /** @@ -180,7 +225,7 @@ export let defaultTransformers = { [ContentType.imageset](content) { return { type: "image-set", - id: content.attributes.id ?? "", + id: content.attributes.url ?? "", children: null, } }, @@ -190,42 +235,89 @@ export let defaultTransformers = { [ContentType.video](content) { return { type: "video", - id: content.attributes.id ?? "", + id: content.attributes.url ?? "", embedded: content.attributes["data-embedded"] == "true" ? true : false, children: null, } }, // TODO these two Link transforms may be wrong. what is a "content" or an "article"? /** - * @type {Transformer} + * @type {Transformer} */ [ContentType.content](content) { if (content.attributes["data-asset-type"] == "flourish") { - return { + return /** @type {ContentTree.transit.Flourish} */ ({ type: "flourish", flourishType: content.attributes["data-flourish-type"] || "", - layoutWidth: content.attributes["data-layout-width"] || "", + layoutWidth: toValidLayoutWidth(content.attributes["data-layout-width"] || ""), description: content.attributes["alt"] || "", timestamp: content.attributes["data-time-stamp"] || "", // fallbackImage -- TODO should this be external in content-tree? - } + }) } - return { + const id = content.attributes.url ?? ""; + const uuid = id.split('/').pop(); + return /** @type {ContentTree.transit.Link} */({ type: "link", - url: `https://www.ft.com/content/${content.attributes.id}`, + url: `https://www.ft.com/content/${uuid}`, title: content.attributes.dataTitle ?? "", - } + }) }, /** * @type {Transformer} */ [ContentType.article](content) { + const id = content.attributes.url ?? ""; + const uuid = id.split('/').pop(); return { type: "link", - url: `https://www.ft.com/content/${content.attributes.id}`, + url: `https://www.ft.com/content/${uuid}`, title: content.attributes.dataTitle ?? "", } }, + /** + * @type {Transformer} + */ + recommended(rl) { + const link = find(rl, { name: 'ft-content'}); + const heading = find(rl, { name: 'recommended-title'}); + return { + type: "recommended", + id: link?.attributes?.url ?? "", + heading: heading ? xastToString(heading) : "", + teaserTitleOverride: link ? xastToString(link) : "", + children: null + } + }, + /** + * @type {Transformer< + * ContentTree.transit.Layout | + * ContentTree.transit.LayoutSlot | + * { type: "__LIFT_CHILDREN__"} | + * { type: "__UNKNOWN__"} + * >} + */ + div(div) { + if(div.attributes.class === "n-content-layout") { + return /** @type {ContentTree.transit.Layout} */({ + type: "layout", + layoutName: div.attributes['data-layout-name'] ?? "auto", + layoutWidth: toValidLayoutWidth(div.attributes['data-layout-width'] ?? ""), + }); + } + if(div.attributes.class === "n-content-layout__container") { + return { type: "__LIFT_CHILDREN__" }; + } + if(div.attributes.class === "n-content-layout__slot") { + return /** @type { ContentTree.transit.LayoutSlot } */({ + type: "layout-slot" + }) + } + return { type: "__UNKNOWN__" }; + }, + experimental() { + return { type: "__LIFT_CHILDREN__" } + } } /** @@ -263,14 +355,14 @@ export function fromXast(bodyxast, transformers = defaultTransformers) { type: "root", body: { type: "body", - children: xmlnode.children[0].children.map(walk), + version: 1, + // this is a flatmap because of + children: xmlnode.children[0].children.flatMap(walk), }, } } else if (isXElement(xmlnode)) { // i thought about this solution for no more than 5 seconds - if (xmlnode.name == "experimental") { - return xmlnode.children.map(walk) - } + let transformer = (xmlnode.name == "content" || xmlnode.name == "ft-content") ? String(xmlnode.attributes.type) @@ -278,7 +370,10 @@ export function fromXast(bodyxast, transformers = defaultTransformers) { if (transformer in transformers) { let ctnode = transformers[transformer](xmlnode) - if ("children" in ctnode && ctnode.children === null) { + if(ctnode.type === "__LIFT_CHILDREN__") { + // we don't want this node to stick around, but we want to keep its' children + return xmlnode.children.flatMap(walk); + } else if ("children" in ctnode && ctnode.children === null) { // this is how we indicate we shouldn't iterate, but this thing // shouldn't have any children delete ctnode.children diff --git a/libraries/from-bodyxml/test.js b/libraries/from-bodyxml/test.js index e693468..8062686 100644 --- a/libraries/from-bodyxml/test.js +++ b/libraries/from-bodyxml/test.js @@ -27,4 +27,4 @@ for (let inputName of inputNames) { } }) } -} +} \ No newline at end of file diff --git a/tests/bodyxml-to-content-tree/input/kitchen-snippet.xml b/tests/bodyxml-to-content-tree/input/kitchen-snippet.xml index c1ef35a..7fa640e 100644 --- a/tests/bodyxml-to-content-tree/input/kitchen-snippet.xml +++ b/tests/bodyxml-to-content-tree/input/kitchen-snippet.xml @@ -1 +1 @@ -

Kitchen sink realism (or kitchen sink drama) is a British cultural movement that developed in the late 1950s and early 1960s in theatre, art, novels, film, and television plays, whose protagonists usually could be described as "angry young men" who were disillusioned with modern society. It used a style of social realism, which depicted the domestic situations of working class Britons, living in cramped rented accommodation and spending their off-hours drinking in grimy pubs, to explore controversial social and political issues ranging from abortion to homelessness. The harsh, realistic style contrasted sharply with the escapism of the previous generation's so-called "well-made plays".€¥

The films, plays and novels employing this style are often set in poorer industrial areas in the North of England, and use the accents and slang heard in those regions. The film It Always Rains on Sunday (1947) is a precursor of the genre, and the John Osborne play Look Back in Anger (1956) is thought of as the first of the genre. The gritty love-triangle of Look Back in Anger, for example, takes place in a cramped, one-room flat in the English Midlands.

1947Year of release for ‘It Always Rains On Sunday’

Shelagh Delaney’s 1958 play A Taste of Honey — which was made into a film of the same name in 1961 — is about a teenage schoolgirl who has an affair with a black sailor, gets pregnant, and then moves in with a gay male acquaintance; it raises issues such as class, race, gender and sexual orientation. The conventions of the genre have continued into the 2000s, finding expression in such television shows as Coronation Street and EastEnders.

In art, “Kitchen Sink School” was a term used by critic David Sylvester to describe painters who depicted social realist–type scenes of domestic life.

Examples

List of kitchen sink films

Year in brackets

  • Look Back in Anger (1959)

  • Room at the Top (1959)

  • Saturday Night and Sunday Morning (1960)

  • The Entertainer (1960)

  • A Taste of Honey (1961)

  • A Kind of Loving (1962)

  • The L-Shaped Room (1962)

  • The Loneliness of the Long Distance Runner (1962)

Top 7 list of kitchen sink plays

Year in brackets

  1. Look Back In Anger (1956)

  2. My Flesh, My Blood (Radio play, 1957)

  3. A Taste Of Honey (1958)

  4. Sparrers Can't Sing (1960)

  5. Alfie (1963)

  6. Up the Junction (TV play, 1965)

  7. Cathy Come Home (TV play, 1966)

In the United Kingdom, the term “kitchen sink” derived from an expressionist painting by John Bratby, which contained an image of a kitchen sink. Bratby did various kitchen and bathroom-themed paintings, including three paintings of toilets. Bratby’s paintings of people often depicted the faces of his subjects as desperate and unsightly.

Before the 1950s, the United Kingdom's working class were often depicted stereotypically in Noël Coward's drawing room comedies and British films

Wikipedia

Kitchen sink realism artists painted everyday objects, such as trash cans and beer bottles. The critic David Sylvester wrote an article in 1954 about trends in recent English art, calling his article “The Kitchen Sink” in reference to Bratby’s picture. Sylvester argued that there was a new interest among young painters in domestic scenes, with stress on the banality of life. Other artists associated with the kitchen sink style include Derrick Greaves, Edward Middleditch and Jack Smith.

Before the 1950s, the United Kingdom’s working class were often depicted stereotypically in Noël Coward’s drawing room comedies and British films. Kitchen sink realism was also seen as being in opposition to the “well-made play”, the kind which theatre critic Kenneth Tynan once denounced as being set in “Loamshire”, of dramatists like Terence Rattigan. “Well-made plays” were a dramatic genre from nineteenth-century theatre which found its early 20th-century codification in Britain in the form of William Archer’s Play-Making: A Manual of Craftmanship (1912), and in the United States with George Pierce Baker’s Dramatic Technique (1919). Kitchen sink works were created with the intention of changing all that. Their political views were initially labeled as radical, sometimes even anarchic.

John Osborne's play Look Back In Anger (1956) depicted young men in a way that is similar to the then-contemporary "Angry Young Men" movement of film and theatre directors. The "angry young men" were a group of mostly working and middle class British playwrights and novelists who became prominent in the 1950s.

Following the success of the Osborne play, the label "angry young men" was later applied by British media to describe young writers who were characterised by a disillusionment with traditional British society.

The hero of Look Back In Anger is a graduate, but he is working in a manual occupation. It dealt with social alienation, the claustrophobia and frustrations of a provincial life on low incomes.[citation needed]

The impact of this work inspired Arnold Wesker and Shelagh Delaney, among numerous others, to write plays of their own.[citation needed] The English Stage Company at the Royal Court Theatre, headed by George Devine and Theatre Workshop organised by Joan Littlewood were particularly prominent in bringing these plays to public attention. Critic John Heilpern wrote that Look Back in Anger expressed such “immensity of feeling and class hatred” that it altered the course of English theatre. The term “Angry theatre” was coined by critic John Russell Taylor.

This was all part of the British New Wave—a transposition of the concurrent nouvelle vague film movement in France, some of whose works, such as The 400 Blows of 1959, also emphasised the lives of the urban proletariat. British filmmakers such as Tony Richardson and Lindsay Anderson (see also Free Cinema) channelled their vitriolic anger into film making. Confrontational films such as Saturday Night and Sunday Morning (1960) and A Taste of Honey (1961) were noteworthy movies in the genre. Saturday Night and Sunday Morning is about a young machinist who spends his wages at weekends on drinking and having a good time, until his affair with a married woman leads to her getting pregnant and him being beaten by her husband to the point of hospitalisation.

Recommended
  • Kitchenus sinkus articlus

Later, as many of these writers and directors diversified, kitchen sink realism was taken up by television directors who produced television plays. The single play was then a staple of the medium, and Armchair Theatre (1956–68), produced by the ITV contractor ABC, The Wednesday Play (1964–70) and Play for Today (1970–84), both BBC series, contained many works of this kind. Jeremy Sandford's television play Cathy Come Home (1966, directed by Ken Loach for The Wednesday Play slot) for instance, addressed the then-stigmatised issue of homelessness.

Kitchen sink realism was also used in the novels of Stan Barstow, John Braine, Alan Sillitoe and others

Kitchen sink syndrome

You’ve heard of Shiny Object Syndrome. Also known as SOS.

The tendency to get pulled off track when something new and exciting comes up. As you constantly change direction, you realize you never really get anywhere.

There’s a related syndrome I suffer from. Maybe you do, too. I’ve affectionately dubbed it Kitchen Sink Syndrome … KSS for short.

Shiny Object Syndrome’s More Annoying Cousin

With Shiny Object Syndrome, you’re always on to the next new and exciting thing before you’ve implemented the last new and exciting thing.

Kitchen Sink Syndrome is closely related. The main difference is when you move on to the next new and exciting thing, you keep trying to do the last thing, too.

Eventually, you have 18 big projects you’re trying to complete, 11 new very important skills you’re trying to learn, and 14 marketing methods you’re trying to use … oh, and don’t forget about the 26 good habits you’re trying to develop.

It is simply impossible to do all these things and do any of them well. You feel overwhelmed before you start. And like SOS, your headway on anything is non-existent.

It’s just with KSS, you’re failing at everything all at once, instead of failing at one thing at a time.

That’s harsh, I know. But, I speak from experience. If the only real failure is to not take meaningful action, both SOS and KSS are two sure ways to get there.

Why the Tendency to Make Things Harder?

Kitchen Sink Syndrome stems from a combination of a lack of confidence and a lack of prioritization.

The lack of confidence component is pretty obvious. If you feel like you always need to take one more step before you’re ready, chances are you don’t believe in the value you have to offer. You’re probably worried about failing, about being rejected, about doing something that will make you look foolish, or about having a client say they’re disappointed in the results.

Fortunately, your belief in the value you have to offer isn’t a precursor for that value to exist.

KSS is a bit worse than SOS, in my opinion, because it can actually tank a single project.

Let’s say you manage to kick your SOS, and you focus in on a single skill you’re trying to learn. If you haven’t addressed your KSS, here’s what will happen …

Instead of identifying a point of competency and working toward it through a series of exercises, reading, feedback, and trial and error, you’ll start adding more requirements to complete before you implement your new skill.

The evolution of kitchen sink drama films 

1959

Look Back in Anger

Room at the Top

1960

Saturday Night and Sunday Morning

The Entertainer

1961

A Taste of Honey

1962

A Kind of Loving

The L-Shaped Room

The Loneliness of the Long Distance Runner

Why work through one program on email marketing, when you could work through three? Why just learn how to write a good email, when you could also learn everything about segmentation? Maybe you should also learn about different email service providers before you let anyone know you can write email messages …

Everything there — studying multiple courses, learning related areas — is good. But, if you try to do it all at once or insist you do it all before using what you’re learning, then you’re never going to actually execute.

If this sounds all-too-familiar, stick with me. I have a proven treatment for Kitchen Sink Syndrome.

+

Kitchen sink realism (or kitchen sink drama) is a British cultural movement that developed in the late 1950s and early 1960s in theatre, art, novels, film, and television plays, whose protagonists usually could be described as "angry young men" who were disillusioned with modern society. It used a style of social realism, which depicted the domestic situations of working class Britons, living in cramped rented accommodation and spending their off-hours drinking in grimy pubs, to explore controversial social and political issues ranging from abortion to homelessness. The harsh, realistic style contrasted sharply with the escapism of the previous generation's so-called "well-made plays".€¥

The films, plays and novels employing this style are often set in poorer industrial areas in the North of England, and use the accents and slang heard in those regions. The film It Always Rains on Sunday (1947) is a precursor of the genre, and the John Osborne play Look Back in Anger (1956) is thought of as the first of the genre. The gritty love-triangle of Look Back in Anger, for example, takes place in a cramped, one-room flat in the English Midlands.

1947Year of release for ‘It Always Rains On Sunday’

Shelagh Delaney’s 1958 play A Taste of Honey — which was made into a film of the same name in 1961 — is about a teenage schoolgirl who has an affair with a black sailor, gets pregnant, and then moves in with a gay male acquaintance; it raises issues such as class, race, gender and sexual orientation. The conventions of the genre have continued into the 2000s, finding expression in such television shows as Coronation Street and EastEnders.

In art, “Kitchen Sink School” was a term used by critic David Sylvester to describe painters who depicted social realist–type scenes of domestic life.

Examples

List of kitchen sink films

Year in brackets

  • Look Back in Anger (1959)

  • Room at the Top (1959)

  • Saturday Night and Sunday Morning (1960)

  • The Entertainer (1960)

  • A Taste of Honey (1961)

  • A Kind of Loving (1962)

  • The L-Shaped Room (1962)

  • The Loneliness of the Long Distance Runner (1962)

Top 7 list of kitchen sink plays

Year in brackets

  1. Look Back In Anger (1956)

  2. My Flesh, My Blood (Radio play, 1957)

  3. A Taste Of Honey (1958)

  4. Sparrers Can't Sing (1960)

  5. Alfie (1963)

  6. Up the Junction (TV play, 1965)

  7. Cathy Come Home (TV play, 1966)

In the United Kingdom, the term “kitchen sink” derived from an expressionist painting by John Bratby, which contained an image of a kitchen sink. Bratby did various kitchen and bathroom-themed paintings, including three paintings of toilets. Bratby’s paintings of people often depicted the faces of his subjects as desperate and unsightly.

Before the 1950s, the United Kingdom's working class were often depicted stereotypically in Noël Coward's drawing room comedies and British films

Wikipedia

Kitchen sink realism artists painted everyday objects, such as trash cans and beer bottles. The critic David Sylvester wrote an article in 1954 about trends in recent English art, calling his article “The Kitchen Sink” in reference to Bratby’s picture. Sylvester argued that there was a new interest among young painters in domestic scenes, with stress on the banality of life. Other artists associated with the kitchen sink style include Derrick Greaves, Edward Middleditch and Jack Smith.

Before the 1950s, the United Kingdom’s working class were often depicted stereotypically in Noël Coward’s drawing room comedies and British films. Kitchen sink realism was also seen as being in opposition to the “well-made play”, the kind which theatre critic Kenneth Tynan once denounced as being set in “Loamshire”, of dramatists like Terence Rattigan. “Well-made plays” were a dramatic genre from nineteenth-century theatre which found its early 20th-century codification in Britain in the form of William Archer’s Play-Making: A Manual of Craftmanship (1912), and in the United States with George Pierce Baker’s Dramatic Technique (1919). Kitchen sink works were created with the intention of changing all that. Their political views were initially labeled as radical, sometimes even anarchic.

John Osborne's play Look Back In Anger (1956) depicted young men in a way that is similar to the then-contemporary "Angry Young Men" movement of film and theatre directors. The "angry young men" were a group of mostly working and middle class British playwrights and novelists who became prominent in the 1950s.

Following the success of the Osborne play, the label "angry young men" was later applied by British media to describe young writers who were characterised by a disillusionment with traditional British society.

The hero of Look Back In Anger is a graduate, but he is working in a manual occupation. It dealt with social alienation, the claustrophobia and frustrations of a provincial life on low incomes.[citation needed]

The impact of this work inspired Arnold Wesker and Shelagh Delaney, among numerous others, to write plays of their own.[citation needed] The English Stage Company at the Royal Court Theatre, headed by George Devine and Theatre Workshop organised by Joan Littlewood were particularly prominent in bringing these plays to public attention. Critic John Heilpern wrote that Look Back in Anger expressed such “immensity of feeling and class hatred” that it altered the course of English theatre. The term “Angry theatre” was coined by critic John Russell Taylor.

This was all part of the British New Wave—a transposition of the concurrent nouvelle vague film movement in France, some of whose works, such as The 400 Blows of 1959, also emphasised the lives of the urban proletariat. British filmmakers such as Tony Richardson and Lindsay Anderson (see also Free Cinema) channelled their vitriolic anger into film making. Confrontational films such as Saturday Night and Sunday Morning (1960) and A Taste of Honey (1961) were noteworthy movies in the genre. Saturday Night and Sunday Morning is about a young machinist who spends his wages at weekends on drinking and having a good time, until his affair with a married woman leads to her getting pregnant and him being beaten by her husband to the point of hospitalisation.

Recommended
  • Kitchenus sinkus articlus

Later, as many of these writers and directors diversified, kitchen sink realism was taken up by television directors who produced television plays. The single play was then a staple of the medium, and Armchair Theatre (1956–68), produced by the ITV contractor ABC, The Wednesday Play (1964–70) and Play for Today (1970–84), both BBC series, contained many works of this kind. Jeremy Sandford's television play Cathy Come Home (1966, directed by Ken Loach for The Wednesday Play slot) for instance, addressed the then-stigmatised issue of homelessness.

Kitchen sink realism was also used in the novels of Stan Barstow, John Braine, Alan Sillitoe and others

Kitchen sink syndrome

You’ve heard of Shiny Object Syndrome. Also known as SOS.

The tendency to get pulled off track when something new and exciting comes up. As you constantly change direction, you realize you never really get anywhere.

There’s a related syndrome I suffer from. Maybe you do, too. I’ve affectionately dubbed it Kitchen Sink Syndrome … KSS for short.

Shiny Object Syndrome’s More Annoying Cousin

With Shiny Object Syndrome, you’re always on to the next new and exciting thing before you’ve implemented the last new and exciting thing.

Kitchen Sink Syndrome is closely related. The main difference is when you move on to the next new and exciting thing, you keep trying to do the last thing, too.

Eventually, you have 18 big projects you’re trying to complete, 11 new very important skills you’re trying to learn, and 14 marketing methods you’re trying to use … oh, and don’t forget about the 26 good habits you’re trying to develop.

It is simply impossible to do all these things and do any of them well. You feel overwhelmed before you start. And like SOS, your headway on anything is non-existent.

It’s just with KSS, you’re failing at everything all at once, instead of failing at one thing at a time.

That’s harsh, I know. But, I speak from experience. If the only real failure is to not take meaningful action, both SOS and KSS are two sure ways to get there.

Why the Tendency to Make Things Harder?

Kitchen Sink Syndrome stems from a combination of a lack of confidence and a lack of prioritization.

The lack of confidence component is pretty obvious. If you feel like you always need to take one more step before you’re ready, chances are you don’t believe in the value you have to offer. You’re probably worried about failing, about being rejected, about doing something that will make you look foolish, or about having a client say they’re disappointed in the results.

Fortunately, your belief in the value you have to offer isn’t a precursor for that value to exist.

KSS is a bit worse than SOS, in my opinion, because it can actually tank a single project.

Let’s say you manage to kick your SOS, and you focus in on a single skill you’re trying to learn. If you haven’t addressed your KSS, here’s what will happen …

Instead of identifying a point of competency and working toward it through a series of exercises, reading, feedback, and trial and error, you’ll start adding more requirements to complete before you implement your new skill.

The evolution of kitchen sink drama films 

1959

Look Back in Anger

Room at the Top

1960

Saturday Night and Sunday Morning

The Entertainer

1961

A Taste of Honey

1962

A Kind of Loving

The L-Shaped Room

The Loneliness of the Long Distance Runner

Why work through one program on email marketing, when you could work through three? Why just learn how to write a good email, when you could also learn everything about segmentation? Maybe you should also learn about different email service providers before you let anyone know you can write email messages …

Everything there — studying multiple courses, learning related areas — is good. But, if you try to do it all at once or insist you do it all before using what you’re learning, then you’re never going to actually execute.

If this sounds all-too-familiar, stick with me. I have a proven treatment for Kitchen Sink Syndrome.

\ No newline at end of file diff --git a/tests/bodyxml-to-content-tree/input/simple-old-post.xml b/tests/bodyxml-to-content-tree/input/simple-old-post.xml index 3f4a490..adcc33a 100644 --- a/tests/bodyxml-to-content-tree/input/simple-old-post.xml +++ b/tests/bodyxml-to-content-tree/input/simple-old-post.xml @@ -1,12 +1,12 @@ - +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris scelerisque, nunc vel consectetur sagittis, purus ex ultrices metus, in consectetur nisl lacus congue nulla. Integer fermentum molestie dui at accumsan.

-

Nam scelerisque luctus tristique. Aliquam orci massa, hendrerit non pulvinar a, tristique vitae enim. Pellentesque laoreet condimentum nulla sed tempor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Quisque euismod euismod porta. Praesent id sapien et magna porta malesuada. Proin sit amet justo vel augue sollicitudin volutpat sodales id turpis.

-

Sed posuere vestibulum metus non cursus. Fusce ac blandit erat. Fusce turpis turpis, vehicula et condimentum quis, dapibus eget odio. Vivamus lobortis vulputate sapien quis ultrices.

+

Nam scelerisque luctus tristique. Aliquam orci massa, hendrerit non pulvinar a, tristique vitae enim. Pellentesque laoreet condimentum nulla sed tempor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Quisque euismod euismod porta. Praesent id sapien et magna porta malesuada. Proin sit amet justo vel augue sollicitudin volutpat sodales id turpis.

+

Sed posuere vestibulum metus non cursus. Fusce ac blandit erat. Fusce turpis turpis, vehicula et condimentum quis, dapibus eget odio. Vivamus lobortis vulputate sapien quis ultrices.

Morbi laoreet, sem at bibendum rutrum, ligula erat rhoncus est, eget hendrerit leo diam sit amet mauris. Curabitur cursus dictum mi id eleifend. Pellentesque sed massa sit amet massa ornare accumsan. Nulla eget lobortis velit.

Cras vel libero ut arcu hendrerit accumsan. “Vivamus ligula lectus”, vestibulum at nisi id, imperdiet “ornare libero”.

-

Maecenas ac ipsum in elit aliquam consectetur. Proin felis metus, efficitur et nulla eu, interdum malesuada diam.

Pellentesque habitant, morbi tristique +

Maecenas ac ipsum in elit aliquam consectetur. Proin felis metus, efficitur et nulla eu, interdum malesuada diam.

Pellentesque habitant, morbi tristique
-

Donec id faucibus erat. Suspendisse tempor laoreet lorem, sit amet vehicula massa facilisis at. Nulla quis feugiat massa. Praesent viverra non lectus ut ullamcorper. Phasellus porttitor neque at volutpat pulvinar.

+

Donec id faucibus erat. Suspendisse tempor laoreet lorem, sit amet vehicula massa facilisis at. Nulla quis feugiat massa. Praesent viverra non lectus ut ullamcorper. Phasellus porttitor neque at volutpat pulvinar.

“Curabitur fermentum, dolor vel interdum varius, tellus justo dapibus velit, interdum sollicitudin dolor nibh varius velit.”

diff --git a/tests/bodyxml-to-content-tree/output/kitchen-snippet.json b/tests/bodyxml-to-content-tree/output/kitchen-snippet.json index 80241e9..8d3f480 100644 --- a/tests/bodyxml-to-content-tree/output/kitchen-snippet.json +++ b/tests/bodyxml-to-content-tree/output/kitchen-snippet.json @@ -2,19 +2,102 @@ "type": "root", "body": { "type": "body", + "version": 1, "children": [ { "type": "paragraph", "children": [ { "type": "text", - "value": "Kitchen sink realism (or kitchen sink drama) is a British cultural movement that developed in the late 1950s and early 1960s in theatre, art, novels, film, and television plays, whose protagonists usually could be described as \"angry young men\" who were disillusioned with modern society. It used a style of social realism, which depicted the domestic situations of working class Britons, living in cramped rented accommodation and spending their off-hours drinking in grimy pubs, to explore controversial social and political issues ranging from abortion to homelessness. The harsh, realistic style contrasted sharply with the escapism of the previous generation's so-called \"well-made plays\".€¥" + "value": "Kitchen sink realism (or " + }, + { + "type": "link", + "url": "https://www.ft.com/kitchenus-sinkus-articlus", + "title": "", + "children": [ + { + "type": "text", + "value": "kitchen sink drama" + } + ] + }, + { + "type": "text", + "value": ") is a British cultural movement that developed in the late 1950s and early 1960s in theatre, art, novels, film, and television plays, whose protagonists usually could be described as " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "\"angry young men\"" + } + ] + }, + { + "type": "text", + "value": " who were disillusioned with modern society. It used a style of social realism, which depicted the domestic situations of working class Britons, living in cramped rented accommodation and spending their off-hours drinking in " + }, + { + "type": "strikethrough", + "children": [ + { + "type": "text", + "value": "grimy" + } + ] + }, + { + "type": "text", + "value": " pubs, to explore " + }, + { + "type": "emphasis", + "children": [ + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "controversial social" + } + ] + } + ] + }, + { + "type": "text", + "value": " and " + }, + { + "type": "emphasis", + "children": [ + { + "type": "strong", + "children": [ + { + "type": "strikethrough", + "children": [ + { + "type": "text", + "value": "political issues" + } + ] + } + ] + } + ] + }, + { + "type": "text", + "value": " ranging from abortion to homelessness. The harsh, realistic style contrasted sharply with the escapism of the previous generation's so-called \"well-made plays\".€¥" } ] }, { "type": "image-set", - "id": "0cfc1752-84a6-4477-b225-a4872f07324a" + "id": "http://api-t.ft.com/content/0cfc1752-84a6-4477-b225-a4872f07324a" }, { "type": "paragraph", @@ -132,7 +215,6 @@ }, { "type": "list", - "ordered": false, "children": [ { "type": "list-item", @@ -318,7 +400,8 @@ } ] } - ] + ], + "ordered": false }, { "type": "heading", @@ -342,7 +425,6 @@ }, { "type": "list", - "ordered": true, "children": [ { "type": "list-item", @@ -505,7 +587,8 @@ } ] } - ] + ], + "ordered": true }, { "type": "paragraph", @@ -517,13 +600,8 @@ ] }, { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " " - } - ] + "type": "text", + "value": " " }, { "type": "pullquote", @@ -638,7 +716,8 @@ }, { "type": "video", - "id": "9eef331b-04f0-4774-b487-a5aef2995e4d" + "id": "http://api-t.ft.com/content/9eef331b-04f0-4774-b487-a5aef2995e4d", + "embedded": true }, { "type": "paragraph", @@ -651,7 +730,7 @@ }, { "type": "image-set", - "id": "52b9ebb3-24db-4768-8894-77f200702bb0" + "id": "http://api-t.ft.com/content/52b9ebb3-24db-4768-8894-77f200702bb0" }, { "type": "paragraph", @@ -702,29 +781,10 @@ ] }, { + "id": "http://api-t.ft.com/content/146da558-4dee-11e3-8fa5-00144feabdc0", "type": "recommended", - "id": "146da558-4dee-11e3-8fa5-00144feabdc0", "heading": "Recommended", - "teaserTitleOverride": "Kitchenus sinkus articlus", - "teaser": { - "id": "146da558-4dee-11e3-8fa5-00144feabdc0", - "url": "https://www.ft.com/content/146da558-4dee-11e3-8fa5-00144feabdc0", - "indicators": { - "isScoop": true, - "accessLevel": "subscribed" - }, - "type": "article", - "title": "Kitchenus sinkus articlus", - "publishedDate": "???", - "firstPublishedDate": "???", - "image": { - "format": "standard-inline", - "height": 0, - "width": 0, - "id": "https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fwww.ft.com%2F__assets%2Fcreatives%2Fopen-graph%2Fft-v1.jpg?source=next-opengraph&fit=scale-down&width=900", - "url": "https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fwww.ft.com%2F__assets%2Fcreatives%2Fopen-graph%2Fft-v1.jpg?source=next-opengraph&fit=scale-down&width=900" - } - } + "teaserTitleOverride": "Kitchenus sinkus articlus" }, { "type": "paragraph", @@ -791,16 +851,16 @@ "type": "layout", "layoutName": "auto", "layoutWidth": "full-grid", - "data": { - "layout": "image-pair" - }, "children": [ { "type": "layout-slot", "children": [ { - "id": "21ee9162-d988-450a-8c1c-1551bbaae51b", - "type": "layout-image" + "type": "layout-image", + "id": "https://d1e00ek4ebabms.cloudfront.net/staging/cb0650f2-581e-47c3-a8e8-133105299fb4.png", + "caption": "Billy Liar ", + "alt": "", + "credit": "© Rex Features" } ] }, @@ -808,8 +868,11 @@ "type": "layout-slot", "children": [ { - "id": "8ccaf42d-774e-4195-8a94-4aaa384a80d0", - "type": "layout-image" + "type": "layout-image", + "id": "https://d1e00ek4ebabms.cloudfront.net/staging/23421e94-1858-46fc-a710-f3ffffa96719.png", + "caption": "Michael Caine is Alfie", + "alt": "", + "credit": "© HULTON ARCHIVE" } ] } @@ -865,9 +928,6 @@ "type": "layout", "layoutName": "card", "layoutWidth": "full-width", - "data": { - "layout": "explainer" - }, "children": [ { "type": "heading", @@ -944,9 +1004,6 @@ "type": "layout", "layoutName": "card", "layoutWidth": "inset-left", - "data": { - "layout": "explainer" - }, "children": [ { "type": "heading", @@ -1023,13 +1080,10 @@ "type": "layout", "layoutName": "timeline", "layoutWidth": "full-width", - "data": { - "layout": "timeline" - }, "children": [ { "type": "heading", - "level": "subheading", + "level": "chapter", "children": [ { "type": "text", @@ -1039,8 +1093,10 @@ }, { "type": "layout-image", - "id": "a978ba29-505f-4ce4-951b-387d60441fc4", - "children": [] + "id": "https://d1e00ek4ebabms.cloudfront.net/staging/cfbbc7af-6c2c-412c-b54e-54df47791a46.png", + "caption": "Alfie", + "alt": "", + "credit": "© HULTON ARCHIVE" }, { "type": "layout-slot", diff --git a/tests/bodyxml-to-content-tree/output/simple-old-post.json b/tests/bodyxml-to-content-tree/output/simple-old-post.json index d19ee5a..ca01852 100644 --- a/tests/bodyxml-to-content-tree/output/simple-old-post.json +++ b/tests/bodyxml-to-content-tree/output/simple-old-post.json @@ -2,10 +2,11 @@ "type": "root", "body": { "type": "body", + "version": 1, "children": [ { "type": "image-set", - "id": "aae9611e-f66c-4fe4-a6c6-2e2bdea69060" + "id": "http://api-t.ft.com/content/aae9611e-f66c-4fe4-a6c6-2e2bdea69060" }, { "type": "text", @@ -57,8 +58,24 @@ "children": [ { "type": "text", - "value": "Sed posuere vestibulum metus non cursus. Fusce ac blandit erat. Fusce turpis turpis, vehicula et condimentum quis, dapibus eget odio. Vivamus lobortis vulputate sapien quis ultrices. " + "value": "Sed posuere vestibulum metus non " + }, + { + "type": "link", + "url": "https://www.ft.com", + "title": "", + "children": [ + { + "type": "text", + "value": "cursus" + } + ] + }, + { + "type": "text", + "value": ". Fusce ac blandit erat. Fusce turpis turpis, vehicula et condimentum quis, dapibus eget odio. Vivamus lobortis vulputate sapien quis ultrices. " } + ] }, { diff --git a/tests/bodyxml-to-content-tree/output/sustainable-views-kitchen-sink-20240129.json b/tests/bodyxml-to-content-tree/output/sustainable-views-kitchen-sink-20240129.json index 2716577..c569622 100644 --- a/tests/bodyxml-to-content-tree/output/sustainable-views-kitchen-sink-20240129.json +++ b/tests/bodyxml-to-content-tree/output/sustainable-views-kitchen-sink-20240129.json @@ -2,6 +2,7 @@ "type": "root", "body": { "type": "body", + "version": 1, "children": [ { "type": "heading",