Skip to content

Add mdbook preprocessor to rewrite template links#447

Merged
cb341 merged 6 commits into
mainfrom
feature/mdbook-rewrite-links
May 20, 2026
Merged

Add mdbook preprocessor to rewrite template links#447
cb341 merged 6 commits into
mainfrom
feature/mdbook-rewrite-links

Conversation

@cb341
Copy link
Copy Markdown
Contributor

@cb341 cb341 commented Apr 29, 2026

Previously file links in the mdbook docs would simply download the file. This can be annoying because it takes an extra step to get to the source code of the file if it needs to be opened first.

My proposal is to simply rewrite the file links such that they point onto our GitHub instead.

BEFORE

CleanShot.2026-05-20.at.11.12.49.mp4

AFTER

CleanShot.2026-05-20.at.11.11.25.mp4

@cb341 cb341 self-assigned this Apr 29, 2026
@cb341 cb341 force-pushed the feature/mdbook-rewrite-links branch from 43e2a47 to 170ec5a Compare April 30, 2026 12:54
Comment thread ruby_on_rails/cucumber.md Outdated
Copy link
Copy Markdown
Contributor Author

@cb341 cb341 Apr 30, 2026

Choose a reason for hiding this comment

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

This file didn't exist for some reason despite being referenced int he docs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this still needed? Rails has /up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

that's fair..
but then we need a different boilerplate setup for the initial cucumber test.

https://open-source.renuo.ch/application-setup-guide/ruby_on_rails/cucumber.html?highlight=cucum#cucumber

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good point, but

If you add Cucumber to an existing project, test a real page instead of using the given example test.

I'm assuming there is already at least one controller. Otherwise, adding Cucumber before being able to test anything doesn't make sense.

@cb341 cb341 marked this pull request as ready for review April 30, 2026 13:07
@cb341 cb341 requested a review from hunchr May 5, 2026 20:14
Comment thread bin/mdbook-rewrite-links Outdated
Comment thread bin/mdbook-rewrite-links
Comment thread bin/mdbook-rewrite-links Outdated
@cb341 cb341 force-pushed the feature/mdbook-rewrite-links branch from 38c69f5 to 8418df9 Compare May 6, 2026 06:49
@hunchr hunchr removed their request for review May 8, 2026 09:31
@hunchr
Copy link
Copy Markdown
Member

hunchr commented May 8, 2026

I have no idea what this is about. Please assign someone who knows the ASG.

@cb341 cb341 force-pushed the feature/mdbook-rewrite-links branch from 8418df9 to 67a95ea Compare May 20, 2026 09:02
@cb341 cb341 force-pushed the feature/mdbook-rewrite-links branch from 67a95ea to 98e0981 Compare May 20, 2026 09:03
@cb341 cb341 requested a review from hunchr May 20, 2026 09:14
Copy link
Copy Markdown
Member

@hunchr hunchr left a comment

Choose a reason for hiding this comment

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

Why don't we just link to GH directly?

Comment thread bin/mdbook-rewrite-links Outdated
@cb341
Copy link
Copy Markdown
Contributor Author

cb341 commented May 20, 2026

Why don't we just link to GH directly?

That works poorly when you want to use the docs in an offline environment.
With relative paths you can still navigate files.

@cb341 cb341 requested a review from hunchr May 20, 2026 09:55
…mplate for now. We need to update the cucumber page anyways
@cb341 cb341 merged commit 9c8fd62 into main May 20, 2026
2 checks passed
@cb341 cb341 deleted the feature/mdbook-rewrite-links branch May 20, 2026 11:55
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

Successfully merging this pull request may close these issues.

2 participants