Skip to content
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

Refactor documentation links to source on GitHub #379

Merged
merged 10 commits into from
Dec 1, 2020
Merged

Conversation

kitchoi
Copy link
Contributor

@kitchoi kitchoi commented Dec 1, 2020

The documentation has URL links to sources on GitHub. Some of them can be replaced by cross references to the API documentation. Some of them cannot.

When we need to move files across (e.g. for solving #320, see #359), we would have to update these links laboriously. This PR refactors the links so that "https://github.com/enthought/envisage/tree/master/..." is only defined once, in conf.py. And when we do move the example files, only the link in conf.py requires changes.

There are some drive-by to replace GitHub links with API documentation references, as well as removing some dead links.

Copy link
Contributor

@aaronayres35 aaronayres35 left a comment

Choose a reason for hiding this comment

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

LGTM!
I did have one question though: why not include |Hello World|, or |Plugin|, etc. in the conf.py file. It seems that they only needed to be updated in a single file, so if we were changing them there is only 1 place to update them anyway, which makes sense. But, that might not be obvious initially though, and someone might think that when things get moved they only need to update the links in confy.py.

Not a suggested change, just something to consider. It certainly might be overkill to try to keep track of all reference links in conf.py. Some of them like |Plugin| though could potentially be referenced in more places as documentation is updated.

Also I built the docs and things look good. I did not try every single link, but did a random sample and it all seems to work as expected.

.. |acme.motd.software_quotes| replace:: :github-demo:`acme.motd.software_quotes <MOTD/acme/motd/software_quotes/software_quotes_plugin.py>`
.. |MOTD| replace:: :github-demo:`MOTD <MOTD/acme/motd/motd.py>`
.. |IMOTD| replace:: :github-demo:`IMOTD <MOTD/acme/motd/i_motd.py>`
.. |MOTDPlugin| replace:: :github-demo:`MOTDPlugin <MOTD/acme/motd/motd_plugin.py>`
Copy link
Contributor

Choose a reason for hiding this comment

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

Im guessing the reason we have two things linking to MOTD/acme/motd/motd_plugin.py is because they existed both ways in the docs currently? That seems fine to me, but maybe we would want to consolidate so any doc trying to link to this page says either |acme.motd| or |MOTDPlugin|?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes they both reference to the same file, but they are different appearance so by keeping both, we keep the sentences unchanged.
|acme.motd| will appear as "acme.motd" that links to the motd_plugin.py file. MOTDPlugin will appear as "MOTDPlugin" that links to the same file.

Copy link
Member

@mdickinson mdickinson Dec 1, 2020

Choose a reason for hiding this comment

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

You could always change the link text in the place that's referring to the link.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, sorry; ignore me. I was missing context.

@aaronayres35
Copy link
Contributor

LGTM!
I did have one question though: why not include |Hello World|, or |Plugin|, etc. in the conf.py file. It seems that they only needed to be updated in a single file, so if we were changing them there is only 1 place to update them anyway, which makes sense. But, that might not be obvious initially though, and someone might think that when things get moved they only need to update the links in confy.py.

Not a suggested change, just something to consider. It certainly might be overkill to try to keep track of all reference links in conf.py. Some of them like |Plugin| though could potentially be referenced in more places as documentation is updated.

Also I built the docs and things look good. I did not try every single link, but did a random sample and it all seems to work as expected.

I guess moving files would really only require changes to this:

'github-demo': (
        'https://github.com/enthought/envisage/tree/master/examples/%s',   # noqa: E501
        '')

as others all link to api docs...
So feel free to disregard my comment (although I do still find it a little confusing why |ExtensionPoint| is included but |Plugin| is not, etc.

@kitchoi
Copy link
Contributor Author

kitchoi commented Dec 1, 2020

I did have one question though: why not include |Hello World|, or |Plugin|, etc. in the conf.py file. It seems that they only needed to be updated in a single file, so if we were changing them there is only 1 place to update them anyway, which makes sense. But, that might not be obvious initially though, and someone might think that when things get moved they only need to update the links in confy.py.

Agreed it would be clearer if the substitutions are maintained in one place. I moved those across to conf.py too.

Copy link
Contributor

@aaronayres35 aaronayres35 left a comment

Choose a reason for hiding this comment

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

Still LGTM! Thank you!

@kitchoi kitchoi merged commit 52c4791 into master Dec 1, 2020
@kitchoi kitchoi deleted the refactor-doc-links branch December 1, 2020 15:35
aaronayres35 pushed a commit that referenced this pull request Dec 2, 2020
* Refactor external links to demo examples from extension_points.rst

* Update links to github in introduction.rst

* Refactor substitutions

* Group substitutions

* Update other references to github links

* Flake8

* Remove two other links to github that point to TraitsGUI

* Remove redundant newlines

* Maintain all substituions in the same place

* Remove two redundant lines
aaronayres35 added a commit that referenced this pull request Dec 2, 2020
* Fix index slice in ExtensionPointChangedEvent when plugin changes (#357)

* Turn off macOS builds on Travis CI (#375)

This PR turns off expensive macOS builds on Travis CI. We'll eventually use GitHub Actions to replace these.

* update changelog with backported PRs

* Make example run from any directory (#377)

* Make it possible to run example scripts from anywhere.

* Add a docstring for the test case

* Add missing __init__.py

* Import abcdefg...

* Refactor documentation links to source on GitHub (#379)

* Refactor external links to demo examples from extension_points.rst

* Update links to github in introduction.rst

* Refactor substitutions

* Group substitutions

* Update other references to github links

* Flake8

* Remove two other links to github that point to TraitsGUI

* Remove redundant newlines

* Maintain all substituions in the same place

* Remove two redundant lines

* Contribute examples to etsdemo (#380)

* remove logging from hello world and motd

* remove logging from other examples

* move examples into envisage

* update the single URL in docs/conf.py

* add examples as package_data

* add entry point

* flake8

* add demo folder and update package_data based off code review suggestion

* Update docs/source/conf.py

Co-authored-by: Kit Choi <[email protected]>

* rename and add test for entry point

* move GUI_Application example into envisage/examples

* move old examples into envisage/examples/demo/legacy

* Revert "move old examples into envisage/examples/demo/legacy"

This reverts commit c026040.

* move old examples into a new subdirectory called legacy

* add a readme to reference new location for examples

Co-authored-by: Kit Choi <[email protected]>

* more changelog updates

* more changes to changelog

Co-authored-by: Kit Choi <[email protected]>
Co-authored-by: Mark Dickinson <[email protected]>
aaronayres35 added a commit that referenced this pull request Dec 4, 2020
* Fix index slice in ExtensionPointChangedEvent when plugin changes (#357)

* Turn off macOS builds on Travis CI (#375)

This PR turns off expensive macOS builds on Travis CI. We'll eventually use GitHub Actions to replace these.

* update changelog with backported PRs

* Make example run from any directory (#377)

* Make it possible to run example scripts from anywhere.

* Add a docstring for the test case

* Add missing __init__.py

* Import abcdefg...

* Refactor documentation links to source on GitHub (#379)

* Refactor external links to demo examples from extension_points.rst

* Update links to github in introduction.rst

* Refactor substitutions

* Group substitutions

* Update other references to github links

* Flake8

* Remove two other links to github that point to TraitsGUI

* Remove redundant newlines

* Maintain all substituions in the same place

* Remove two redundant lines

* Contribute examples to etsdemo (#380)

* remove logging from hello world and motd

* remove logging from other examples

* move examples into envisage

* update the single URL in docs/conf.py

* add examples as package_data

* add entry point

* flake8

* add demo folder and update package_data based off code review suggestion

* Update docs/source/conf.py

Co-authored-by: Kit Choi <[email protected]>

* rename and add test for entry point

* move GUI_Application example into envisage/examples

* move old examples into envisage/examples/demo/legacy

* Revert "move old examples into envisage/examples/demo/legacy"

This reverts commit c026040.

* move old examples into a new subdirectory called legacy

* add a readme to reference new location for examples

Co-authored-by: Kit Choi <[email protected]>

* more changelog updates

* more changes to changelog

Co-authored-by: Kit Choi <[email protected]>
Co-authored-by: Mark Dickinson <[email protected]>
aaronayres35 added a commit that referenced this pull request Dec 4, 2020
* Backports for 5.0.0 and update changelog (#378)

* Fix index slice in ExtensionPointChangedEvent when plugin changes (#357)

* Turn off macOS builds on Travis CI (#375)

This PR turns off expensive macOS builds on Travis CI. We'll eventually use GitHub Actions to replace these.

* update changelog with backported PRs

* Make example run from any directory (#377)

* Make it possible to run example scripts from anywhere.

* Add a docstring for the test case

* Add missing __init__.py

* Import abcdefg...

* Refactor documentation links to source on GitHub (#379)

* Refactor external links to demo examples from extension_points.rst

* Update links to github in introduction.rst

* Refactor substitutions

* Group substitutions

* Update other references to github links

* Flake8

* Remove two other links to github that point to TraitsGUI

* Remove redundant newlines

* Maintain all substituions in the same place

* Remove two redundant lines

* Contribute examples to etsdemo (#380)

* remove logging from hello world and motd

* remove logging from other examples

* move examples into envisage

* update the single URL in docs/conf.py

* add examples as package_data

* add entry point

* flake8

* add demo folder and update package_data based off code review suggestion

* Update docs/source/conf.py

Co-authored-by: Kit Choi <[email protected]>

* rename and add test for entry point

* move GUI_Application example into envisage/examples

* move old examples into envisage/examples/demo/legacy

* Revert "move old examples into envisage/examples/demo/legacy"

This reverts commit c026040.

* move old examples into a new subdirectory called legacy

* add a readme to reference new location for examples

Co-authored-by: Kit Choi <[email protected]>

* more changelog updates

* more changes to changelog

Co-authored-by: Kit Choi <[email protected]>
Co-authored-by: Mark Dickinson <[email protected]>

* add release date

Co-authored-by: Kit Choi <[email protected]>
Co-authored-by: Mark Dickinson <[email protected]>
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.

3 participants