Skip to content

Markdown updates for 3.1.1 - #3991

Merged
ralfhandl merged 7 commits into
OAI:v3.1.1-devfrom
lornajane:fix-markdown-3-1-1
Aug 5, 2024
Merged

Markdown updates for 3.1.1#3991
ralfhandl merged 7 commits into
OAI:v3.1.1-devfrom
lornajane:fix-markdown-3-1-1

Conversation

@lornajane

@lornajanelornajane commented Aug 1, 2024

Copy link
Copy Markdown
Contributor

Replay of the steps from #3932 to update the markdown formatting and links for 3.1.1

(mysterious python script needed a few additions, included in a comment)

@lornajane
lornajane changed the base branch from main to v3.1.1-devAugust 1, 2024 20:20
@lornajane

Copy link
Copy Markdown
ContributorAuthor

Script to update anchors and rewrite all our links:

fromsysimportargvfrompathlibimportPathimportre# this script tries to inflect the old links, some are just missing and we need to use the title's version insteadupdates= {}
updates["revision-history"] ="appendix-a-revision-history"updates["data-type-conversion"] ="appendix-b-data-type-conversion"updates["using-r-f-c6570-implementations"] ="appendix-c-using-rfc6570-implementations"updates["serializing-headers-and-cookies"] ="appendix-d-serializing-headers-and-cookies"updates["percent-encoding-and-form-media-types"] ="appendix-e-percent-encoding-and-form-media-types"updates["document-structure"] ="openapi-description-structure"updates["oas-object"] ="openapi-object"updates["components-security-schemes"] ="security-scheme-object"updates["schema-composition"] ="composition-and-inheritance-polymorphism"updates["http-codes"] ="http-status-codes"updates["oas-document"] ="openapi-description"updates["rich-text"] ="rich-text-formatting"updates["relative-references"] ="relative-references-in-urls"updates["relative-references"] ="relative-references-in-urls"updates["runtime-expression"] ="runtime-expressions"updates["runtime-expression-examples"] ="examples"updates["relative-references"] ="relative-references-in-urls"updates["relative-references-u-r-i"] ="relative-references-in-api-description-uris"updates["relative-references-u-r-l"] ="relative-references-in-api-urls"updates["binary-data"] ="working-with-binary-data"updates["base-vocabulary"] ="oas-base-vocabulary"defkebab_it(c):
ifc.lower() !=c: returnf'-{c.lower()}'returncif__name__=='__main__':
text=Path(argv[1]).read_text()
names= {}
removals= {}
formatchinre.finditer(r'\n(.*)<a name="([^"]*)"', text):
name=match.group(2)
names[name] =''.join([kebab_it(c) forcinname])
# was it a heading? file it for removaliflen(match.group(1)) andmatch.group(1)[0] =="#":
removals[name] =Trueforcurrent, replacementinnames.items():
ifreplacementinupdates:
replacement=updates[replacement]
text=text.replace(f'(#{current})', f'(#{replacement})')
# only remove if removal is indicated, otherwise updateifcurrentinremovals:
text=text.replace(f'<a name="{current}"></a>', '')
else:
text=text.replace(f'<a name="{current}"></a>', f'<a name="{replacement}"></a>')
print(text)

Comment threadversions/3.1.1.md Outdated
Comment threadversions/3.1.1.md
@ralfhandlralfhandl added the editorial Wording and stylistic issues label Aug 2, 2024
@lornajane
lornajane marked this pull request as ready for review August 5, 2024 09:11
@ralfhandl
ralfhandl requested a review from a teamAugust 5, 2024 13:18

@mikekistlermikekistler left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. 👍

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editorialWording and stylistic issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Limiting OAS3.1 to RFC7231 status codes?

4 participants

@lornajane@ralfhandl@jeremyfiel@mikekistler