Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API changes #30

Open
holloway opened this issue Jan 28, 2025 · 4 comments
Open

API changes #30

holloway opened this issue Jan 28, 2025 · 4 comments

Comments

@holloway
Copy link
Contributor

holloway commented Jan 28, 2025

docList API

docRetrieve API

  • HTML string ... output by xml2rfc when we have it, and the output of rfc2html when we don’t - decorating it with metadata and things like the ToC extracted from whichever html form is available

  • Additional 'errata' field so that I have the data to render this... ie errata array w/ verified errata state
    Image

  • Additional 'contents' field for the sidebar of headings (a hierarchical list of headings in the RFC text).
    Image
    Those headings link to the RFC text headings so we might need a different structure for the RFC text itself in the response so that I can easily link to specific parts of it. I presume that I'm not supposed to parse the RFC text and derive this structure.

BCP API

  • All BCPs (currently BCP1-239 ) with an 'is also' array referencing RFC ids.

FYI API

  • All FYIs (currently FYI2-38) with an 'is also' array referencing RFC ids.

STD API

  • All STDs (currently STD1-99) with a 'title' and 'is also' array referencing RFC ids.
    • In STD14, 15, 18 the <title> is sometimes rendered as (eg) [Was Simple Network Management Protocol. Now Historic.] so is that the actual title or do we need another field in the response to express whether it's historic. Same for STD12 the XML title is [Reserved for Network Time Protocol (NTP). See RFC 1305.] so is that the actual title or do I need fields to express whether it's reserved?
@rjsparks
Copy link
Member

If you aren't going to be using the output of html2rfc for the html(ized) presentation, then we should be talking about where that computation lives, and how to avoid re computation of it for the views you're working on.

@holloway
Copy link
Contributor Author

holloway commented Jan 29, 2025

@rjsparks what approach would you recommend to create the data for sections/headings like the wireframes? I presume that the Datatracker API should handle the computation, returning more structure than a string.

(fyi @jennifer-richards)

@rjsparks
Copy link
Member

That wireframe was informed by the current html produced by xml2rfc. The datatracker does not know about the insides of documents this way. The closest it gets to knowing is by using rfc2html, so providing information about the inside of a document like this will require a new kind of thing in the backend than what the datatracker has had to date.

@jennifer-richards
Copy link
Member

jennifer-richards commented Jan 31, 2025

The datatracker does not know about the insides of documents this way. The closest it gets to knowing is by using rfc2html, so providing information about the inside of a document like this will require a new kind of thing in the backend than what the datatracker has had to date.

As was mentioned on slack, datatracker's JS does have a module that extracts ToC for the sidebar of its htmlized document view. That's here https://github.com/ietf-tools/datatracker/blob/main/ietf/static/js/nav.js and provides the "Contents" sidebar tab for pages like https://datatracker.ietf.org/doc/html/draft-ietf-asap-sip-auto-peer-15.

A few options that come to mind are that we could 1) move that JS over to the rfced-www app and apply it to HTML slung at it by the datatracker API; 2) translate it (or something like it) to Python and generate a representation of the headings/targets as part of the API response alongside the HTML; or 3) same as 2 but precomputed.

(fyi, the ToC it generates currently look like this screenshot)

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants