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

Docs: Update folder structure and make all internal handbook links relative #6161

Merged
merged 2 commits into from
Apr 20, 2018

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Apr 13, 2018

Description

This is follow-up for #6126. With the https://meta.trac.wordpress.org/changeset/7104 change introduced by @pento we can now update all docs links to use GitHub relative urls to make navigation work with both handbook and GitHub.

This PR tries to come up with a folder structure that will work for all existing urls. I think it works fine for all urls that are referencing other documents for those documents that are in subfolders.

I need to think a bit more about it. With the changes proposed it works fine on GitHub but might not work in all cases in Gutenberg handbook...

@gziolo gziolo added the [Type] Developer Documentation Documentation for developers label Apr 13, 2018
@gziolo gziolo self-assigned this Apr 13, 2018
docs/language.md Outdated
@@ -79,7 +79,7 @@ After running this through the parser we're left with a simple object we can man

This has dramatic implications for how simple and performant we can make our parser. These explicit boundaries also protect damage in a single block from bleeding into other blocks or tarnishing the entire document. It also allows the system to identify unrecognized blocks before rendering them.

_N.B.:_ The defining aspect of blocks are their semantics and the isolation mechanism they provide; in other words, their identity. On the other hand, where their data is stored is a more liberal aspect. Blocks support more than just static local data (via JSON literals inside the HTML comment or within the block's HTML), and more mechanisms (_e.g._, global blocks or otherwise resorting to storage in complementary `WP_Post` objects) are expected. See [attributes](../block-api/attributes) for details.
_N.B.:_ The defining aspect of blocks are their semantics and the isolation mechanism they provide; in other words, their identity. On the other hand, where their data is stored is a more liberal aspect. Blocks support more than just static local data (via JSON literals inside the HTML comment or within the block's HTML), and more mechanisms (_e.g._, global blocks or otherwise resorting to storage in complementary `WP_Post` objects) are expected. See [attributes](./block-api/attributes.md) for details.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is an example where it will no longer work as expected. Unless we put this file inside docs/language/README.md and update the regular expression to remove README.md from links, too.

@mcsf
Copy link
Contributor

mcsf commented Apr 16, 2018

This PR tries to come up with a folder structure that will work for all existing urls. I think it works fine for all urls that are referencing other documents for those documents that are in subfolders.

I need to think a bit more about it. With the changes proposed it works fine on GitHub but might not work in all cases in Gutenberg handbook...

I'm all for making the experience of writing docs less handbook-dependent, especially if that means that you can structure docs in a way that makes sense regardless of context—and keeping .md suffixes is a part of that.

The way I see it, we can add further improvements to the handbook theme beyond https://meta.trac.wordpress.org/changeset/7104. Whenever fitting, introducing certain tokens or conventions in the docs could help the theme perform better corrections. For instance, regarding pointing from docs/language.md to docs/block-api/attributes.md, you commented:

This is an example where it will no longer work as expected. Unless we put this file inside docs/language/README.md and update the regular expression to remove README.md from links, too.

Perhaps in these cases we could disambiguate, e.g. write the URL as ../docs/block-api/attributes.md, so that the theme can recognize ../docs as a prefix that indicates the root of the docset, yet preserving navigation within the repository.

@gziolo
Copy link
Member Author

gziolo commented Apr 16, 2018

Perhaps in these cases we could disambiguate, e.g. write the URL as ../docs/block-api/attributes.md, so that the theme can recognize ../docs as a prefix that indicates the root of the docset, yet preserving navigation within the repository.

Great idea, it should work properly. I will update this PR to match this proposal. We will still have to fix the part on .org side to make sure it understand this convention :)

@adamsilverstein
Copy link
Member

Thanks for working on this, I like how it makes writing the docs easier as well as solving the issue of the github links not working properly.

@gziolo
Copy link
Member Author

gziolo commented Apr 18, 2018

This is updated, all links to GitHub documents located in docs folder work perfectly fine when navigating on GitHub. It should be merged as soon as Gutenberg handbook is updated to work with the new link patterns:

  • ../../docs/*/*.md
  • ../../docs/*.md
  • ../docs/*/*.md
  • ../docs/*.md

I think those are all 4 possibilities.

@pento
Copy link
Member

pento commented Apr 20, 2018

.org handler was added here: https://meta.trac.wordpress.org/changeset/7141

@pento pento merged commit 30ee8de into master Apr 20, 2018
@pento pento deleted the update/docs branch April 20, 2018 01:29
@pento pento added this to the 2.8 milestone Apr 20, 2018
@gziolo
Copy link
Member Author

gziolo commented Apr 20, 2018

Yay, all works as expected. Thanks @pento for your help and @mcsf for such a great idea 💯

nuzzio pushed a commit to nuzzio/gutenberg that referenced this pull request Apr 25, 2018
kjellr added a commit to kjellr/gutenberg that referenced this pull request Jun 4, 2018
The docs file structure was updated in WordPress#6161. This broke the FAQ link in our README. This PR updates the link  with the correct destination.
Soean pushed a commit that referenced this pull request Jun 18, 2018
The docs file structure was updated in #6161. This broke the FAQ link in our README. This PR updates the link  with the correct destination.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants