Skip to content

Define what the AST looks like #1

Description

@adgad

e.g.

interface RecommendLink <: Parent {
  type: "element"
  recommendLinkId: string // these are taken from the XML attributes
  title: string
  children: [Element | Comment | Text] // TODO: do we want to define this strictly, or allow elements?
}
  • We are not going to implement the <experimental> tag. Things that are currently being published inside that tag should have definitions.
    • maybe if we need this kind of functionality, we should introduce a property. But lets not.
  • For references, CP will still iterate through the AST to create the references array
    • This repo can provide Node definitions for "complete" nodes (i.e. a tweet with all teh embed stuff)
    • we can also provide helper functions to get the data (e.g. given a tweet ID, get the embed), which can be used in both CP and Spark Preview if required
    • somehow in our node definitions, differentiate between things which have an ID OR content

Activity

  1. chee commented on Nov 8, 2022

    @chee
    Contributor

    https://github.com/Financial-Times/cp-content-pipeline/blob/main/packages/schema/src/tags/index.ts#L37-L74

      Link,
      Experimental: createTagWithoutReference('Experimental', 'experimental'),
      ImageSet,
      Recommended,
      RecommendedTitle: createTagWithoutReference(
        'RecommendedTitle',
        'recommended-title'
      ),
      Paragraph: createTagWithoutReference('Paragraph', 'p'),
      UnorderedList: createTagWithoutReference('UnorderedList', 'ul'),
      OrderedList: createTagWithoutReference('OrderedList', 'ol'),
      ListItem: createTagWithoutReference('ListItem', 'li'),
      Layout: createTagWithoutReference('Layout', '.n-content-layout, .layout'),
      LayoutContainer: createTagWithoutReference(
        'LayoutContainer',
        '.n-content-layout__container, .layout-container'
      ),
      LayoutSlot: createTagWithoutReference(
        'LayoutSlot',
        '.n-content-layout__slot, .layout-slot'
      ),
      LayoutImage,
      PullQuote,
      PullQuoteText: createTagWithoutReference('PullQuoteText', 'pull-quote-text'),
      PullQuoteSource: createTagWithoutReference(
        'PullQuoteText',
        'pull-quote-source'
      ),
      Blockquote: createTagWithoutReference('Blockquote', 'blockquote'),
      Tweet,
      LineBreak: createTagWithoutReference('LineBreak', 'br'),
      HorizontalRule: createTagWithoutReference('HorizontalRule', 'hr'),
      Emphasis: createTagWithoutReference('Emphasis', 'em'),
      Strong: createTagWithoutReference('Strong', 'strong'),
      Strikethrough: createTagWithoutReference('Strikethrough', 's'),
      Flourish,

    this is the list of tags so far.

    we'll also want chapter, heading, subheading... scrollyblock... not sure what else

  2. atanasdinov commented on Nov 16, 2022

    @atanasdinov

    @chee you can use the following APIs to fetch the current internal and non-internal XSD schemas:

    • GET https://api.ft.com/schemas/body.xsd
    • GET https://api.ft.com/schemas/body-internal.xsd
  3. locked and limited conversation to collaborators on Mar 10, 2023
  4. converted this issue into a discussion #30 on Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions