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

Using RST for documentation generation#169

Merged
kumare3 merged 7 commits intomasterfrom
pmahindrakar/rst-docs
May 24, 2021
Merged

Using RST for documentation generation#169
kumare3 merged 7 commits intomasterfrom
pmahindrakar/rst-docs

Conversation

@pmahindrakar-oss
Copy link
Copy Markdown
Contributor

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

TL;DR

  • Using protoc gen doc RST support to make it simpler to generate docs and correctly link them internally
    This avoids the post build script to fix the html links which was proposed and implemented here
    Fix the links in generated html files #168

  • Fixed the documentation warning that arose of the usage of RST which required fixing the comments in the proto files

  • As part of this did clean up the proto files to remove the commented out validation code which was using protoc-gen-validate . Once we officially support then the code can revived from older version instead of keeping commented out code in the repo

  • Also removed unused imports from the proto files which would generate warnings during the doc generation process

  • Fixed the referenced links to google.protobuf.[timestamp|Duration|struct] by generating there documentation as part of the core.rst . This doc is generated at the tail end of the core documentation and helps with not having dead links to these where they are referenced in our documentation

  • Using a template for all RST file generation except for core. This was done to exclude the Scalar value doc to be generated in each module of the documentation
    https://github.com/pseudomuto/protoc-gen-doc/blob/ae63e7aba9ef91669b2bc76634b33feead0e4f1a/resources/markdown.tmpl#L98

The new template removes the Scalar value and is only generated during core module generation and hence other modules can refer to the scalar values from the core.

  • Updated the contribution doc to use the protoc-gen-doc branch until RST support is officially available

https://docs.flyte.org/projects/flyteidl/en/docs-staging/developing.html#docs-generation

Rest of the docs can be seen here
https://docs.flyte.org/projects/flyteidl/en/docs-staging/protos/index.html

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 <prafulla.mahindrakar@gmail.com>
Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>
Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>
Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>
…oto files and fixed doc issues

Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>
Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>
Copy link
Copy Markdown
Contributor

@kumare3 kumare3 left a comment

Choose a reason for hiding this comment

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

I would like if the make generate just works without the additional steps

Comment thread developing.rst Outdated

.. prompt:: bash

git clone https://github.com/paweld2/protoc-gen-doc.git
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need to do this? We can just reference the gitsha in go get right? Other option is to fork the repo into flyteorg and use the fork?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or branch

Copy link
Copy Markdown
Contributor Author

@pmahindrakar-oss pmahindrakar-oss May 24, 2021

Choose a reason for hiding this comment

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

Done. Using boiler plate code now and updated the documentation.
Also currently the gihub workflows don't call make generate and hence don't find any issues.
We will have to fix the github workflows to use it so that the DELTA_CHECK catches any new files or changes

@pmahindrakar-oss
Copy link
Copy Markdown
Contributor Author

@kumare3 we need those additional steps for doc generation
We can separate steps for doc generation completely from make generate .

Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>
@pmahindrakar-oss pmahindrakar-oss requested a review from kumare3 May 24, 2021 06:22
@kumare3 kumare3 mentioned this pull request May 24, 2021
9 tasks
@kumare3 kumare3 merged commit 08a958c into master May 24, 2021
@pmahindrakar-oss pmahindrakar-oss deleted the pmahindrakar/rst-docs branch May 25, 2021 03:51
eapolinario pushed a commit that referenced this pull request Sep 8, 2023
* Fix the links in generated html files

* 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 <prafulla.mahindrakar@gmail.com>

* Using protoc-gen-doc plugin directly

Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>

* Removed the example message

Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>

* Fixed datacatalog file generation

Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>

* Using template to generate docs and also removed unused imports in proto files and fixed doc issues

Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>

* Minor doc fix

Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>

* Added dependency to protoc-gen in biolerplate module

Signed-off-by: Prafulla Mahindrakar <prafulla.mahindrakar@gmail.com>
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.

3 participants