Brightspace / render-docs-action

A GitHub Action to render docs for https://docs.d2l.dev
Apache License 2.0
1 stars 0 forks source link

Rewrite links when rendering to HTML #11

Open j3parker opened 4 years ago

j3parker commented 4 years ago

In Markdown our links should be tailored GitHub, but when rendered we want them to be tailored to docs.d2l.dev.

File extensions

In all cases, .md should be dropped. E.g. ../foo.md should become ../foo when rendered to HTML.

Relative links

Relative links don't need any additional rewriting.

Absolute path reference

Absolute path references start with a /, e.g. /foo/bar.md need to have the repos docroot appended. E.g. if the repo is publishing to https://docs.d2l.dev/myspot/ then /foo/bar.md should become /myspot/foo/bar.

Absolute links

Absolute links to inside the same repo should be banned. #14

Absolute links to docs.d2l.dev should mostly be banned (some minor exceptions could be warranted - e.g. to the domain itself). #13

Absolute links to another GitHub repo that includes docs should be translated into absolute path references. This requires some global knowledge and we haven't finalized the design of this. --> split off into #12

Any other absolute link should be unchanged.