Page MenuHomePhabricator

update old readthedocs links
ClosedPublic

Authored by alangenfeld on Mon, Mar 16, 11:03 PM.

Details

Summary

fixes #2264

Test Plan

eyes

Diff Detail

Repository
R1 dagster
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alangenfeld created this revision.Mon, Mar 16, 11:03 PM
alangenfeld edited the summary of this revision. (Show Details)Mon, Mar 16, 11:06 PM

We could also do this in our post-processing step, so that clicking a link on readthedocs keeps you on read the docs.

https://dagster.phacility.com/source/dagster/browse/master/docs/gatsby/scripts/sphinx.js$99-107

Something like:

const result = fileContent.replace(
      https:\/\/dagster\.readthedocs\.io\/en\/latest\/sections\/(.*?).html/g,
      function(match) {
        return `https://docs.dagster.io/latest/${match}`;
      }
);

cc @max

max accepted this revision.Wed, Mar 18, 6:59 PM

@sashank is right but a better fix is to use relative URLs or anchors

docs/sections/learn/demos/airline_demo.rst
60

hm, this is really the wrong way to do this. we should use relative links or sphinx's anchors

js_modules/dagit/src/schedules/SchedulesRoot.tsx
51

ok. i want to introduce a url-shortener of some kind and have a set of guaranteed permalinks that appear in error messages and we commit to maintaining, probably with a liveness check in CI. will make an issue to track

This revision is now accepted and ready to land.Wed, Mar 18, 6:59 PM

alright ill look at switching these to sphinx internal links before landing

use relative links and update gatsby<->sphinx hax

docs/gatsby/scripts/parse-html.js
21–22

this fixes relative links and doesn't appear to break any thing

docs/gatsby/scripts/sphinx.js
102
// (?:#[\d\w-_]*?)?  Non-capturing group of page anchor if it's present i.e `#preset` or `#pipeline`
alangenfeld requested review of this revision.Wed, Mar 18, 11:33 PM

back up for review to vet hacks

sashank accepted this revision.Thu, Mar 19, 7:34 PM

gotta love regex

js_modules/dagit/src/schedules/SchedulesRoot.tsx
51

+1

This revision is now accepted and ready to land.Thu, Mar 19, 7:34 PM
This revision was automatically updated to reflect the committed changes.