-
Notifications
You must be signed in to change notification settings - Fork 14k
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
chore: Reference Github code in Docusaurus #18229
Conversation
…e/github-code-ref
I like the direction, but I am afraid about the maintenance of that solution in long term. We have a hard-coded commit ID (or git tag) and a hard-coded line number. This can be easily outdated:
As for the first case, we may use the version identifier (git tag) instead of commit in the future. However, then the second case is then even more likely. To reduce this case scenario Apache Airflow uses comments in the referenced file ( https://github.com/apache/airflow/blob/main/docs/apache-airflow/tutorial_taskflow_api.rst ), predicable comment structure (tags eg. for examples is added before this is required in the documentation). It allows also check that references on CI. |
Hey @ad-m you are perfectly right and we also share these concerns. However, for the time being, we are happy with this solution as the code references that we are looking to add do not change very often. We definitely would like to think of longer-term solutions and the Airflow solution seems well structured. I am pinging @villebro who also has some ideas on this topic. |
As the POC was successful I am removing the POC file and moving this PR to mergeable |
* POC github code reference * Add example * Remove unnecessary change * Remove POC page
* POC github code reference * Add example * Remove unnecessary change * Remove POC page
* POC github code reference * Add example * Remove unnecessary change * Remove POC page
SUMMARY
This is a POC for referencing Github code in Docusaurus.
AFTER
POC.Github.code.ref._.Superset.mp4
ADDITIONAL INFORMATION