Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Fix the links in generated html files #168

Closed
wants to merge 1 commit into from

Conversation

pmahindrakar-oss
Copy link
Contributor

@pmahindrakar-oss pmahindrakar-oss commented May 21, 2021

TL;DR

Following are the comments from CONTRIBUTING.MD file which also explaing the issue

Docs structure

The index.rst files for protos are kept in parallel folder structure under the docs folder.
All the proto definitions are within protos/flyteidl and there corresponding docs are kept in protos/docs

Each module in protos has same named module under the docs also.
eg : protos/flyteidl/core has same named doc structure placing it index and other documentation files in protos/docs/core

Docs Generation

Currently pseudomuto/protoc-gen-doc is being used for generating the MD files which are placed in protos/docs and corresponding folder based on the module

protoc-gen-doc generates a single MD file if we include all the protos and doesn't provide a way to split these.
The MD files are then fed as input to sphinx for html doc generation
Inorder to modularize this and not have one single huge html file the MD files are being generated per module(eg :core,admin,plugin)
But due to this process if there references in html/md files which don't exist in the same file then they lead to broken links.

eg: If we generate admin docs through this process , they would generate admin.md file in protos/docs/admin folder but if they reference docs from core
like for flyteidl.core.ResourceType then they would try to find it in the same MD/html file which wont be available

Inorder to fix this issue an additional post build step has been added to fix such links.
Check conf.py for sphinx to see build-finished event handler

Note : The plan is to move to generating RST file instead of MD files once this PR is checkedin pseudomuto/protoc-gen-doc#440 (comment)
which would simplify the doc generation further

Tested in docs-staging

https://docs.flyte.org/projects/flyteidl/en/docs-staging/

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

How did you fix the bug, make the feature etc. Link to any design docs etc

Tracking Issue

https://github.com/lyft/flyte/issues/

Follow-up issue

NA
OR
https://github.com/lyft/flyte/issues/

* Added handler for build finished event to fix doc links

* Added contributing guide

* Adding wait for the subprocess

* Fixed the path issue with finding the script for fixing the links

* Added darwin switch for sed -i flag

* Fixed non darwin with -i flag for sed

* Using find instead of xargs as it fails on readthedocs

* Moving the substitution errors to /dev/null

* Escaped the Link values

Signed-off-by: Prafulla Mahindrakar <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant