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

Preserve section links in ReSpec output #3863

Open
ralfhandl opened this issue May 28, 2024 · 1 comment
Open

Preserve section links in ReSpec output #3863

ralfhandl opened this issue May 28, 2024 · 1 comment
Assignees
Labels
Housekeeping javascript Pull requests that update Javascript code

Comments

@ralfhandl
Copy link
Contributor

Direct links to RFC sections are useful, for example in

matrix | `primitive`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
label | `primitive`, `array`, `object` | `path` | Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
form | `primitive`, `array`, `object` | `query`, `cookie` | Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8). This option replaces `collectionFormat` with a `csv` (when `explode` is false) or `multi` (when `explode` is true) value from OpenAPI 2.0.
simple | `array` | `path`, `header` | Simple style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.2). This option replaces `collectionFormat` with a `csv` value from OpenAPI 2.0.
.

Unfortunately these currently get lost when running the Markdown sources through ReSpec and result in unspecific #bib-RFC6570 links, see for example https://spec.openapis.org/oas/latest.html#style-values.

A possible solution could be to adapt the md2html processing in

if (line.indexOf('[RFC')>=0) {
line = line.replace(/\[RFC ?([0-9]{1,5})\]/g,function(match,group1){
console.warn('Fixing RFC reference',match,group1);
return '[[!RFC'+group1+']]';
});
}
and produce something like

[[RFC6570]] [section 3.2.7](https://tools.ietf.org/html/rfc6570#section-3.2.7)

that is both a bib-link and a direct link to the relevant RFC section.

@handrews handrews added the javascript Pull requests that update Javascript code label May 28, 2024
@handrews
Copy link
Member

@Bellangelo this dovetails with other things you have been tackling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping javascript Pull requests that update Javascript code
Projects
Status: No status
Development

No branches or pull requests

3 participants