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

feat: support reference-style linking in documents #1048

Merged
merged 3 commits into from
Oct 27, 2018

Conversation

phated
Copy link
Contributor

@phated phated commented Oct 18, 2018

Motivation

Needed reference link support for the gulp docusaurus website. Fixes #257

Have you read the Contributing Guidelines on pull requests?

Yep.

Test Plan

Create a page with a reference link that is described in #257 and generate a Docusaurus page. The link should be replaced correctly.

I wanted to submit this as a proposal for a fix because I'm using local changes currently. If you need changes or tests added, just let me know. Thanks!

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-preview ready!

Built with commit 87abf1f

https://deploy-preview-1048--docusaurus-preview.netlify.com

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 18, 2018
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-preview ready!

Built with commit c26e0dd

https://deploy-preview-1048--docusaurus-preview.netlify.com

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Oct 18, 2018

Deploy preview for docusaurus-preview ready!

Built with commit 62968ae

https://deploy-preview-1048--docusaurus-preview.netlify.com

Copy link
Contributor

@endiliey endiliey left a comment

Choose a reason for hiding this comment

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

Adding tests will be awesome

@phated
Copy link
Contributor Author

phated commented Oct 20, 2018

@endiliey before I add the tests, is this a passable solution?

@endiliey
Copy link
Contributor

endiliey commented Oct 21, 2018

Seems so to me. Though i wanted to confirm it through tests and see what are you trying to achieve. Im not quite sure on the reference style linking

@yangshun
Copy link
Contributor

@phated Do you have the Gulp Docusaurus website hosted somewhere for us to have a look?

@phated
Copy link
Contributor Author

phated commented Oct 21, 2018

It's not available yet. We're putting some finishing touches on next week.

@yangshun
Copy link
Contributor

@phated I'm interested in seeing the WIP too if possible.

On a side note, I see that the unofficial Gulp docs - https://gulpjs.org/ is built using VuePress so I'm surprised that you're still going ahead with a Docusaurus version (you're welcome to of course).

@yangshun yangshun changed the title Replace reference links in documents (fixes #257) feat: replace reference links in documents Oct 21, 2018
@phated
Copy link
Contributor Author

phated commented Oct 21, 2018

Like you said, it's the unofficial docs and has nothing to do with us. Our domain is gulpjs.com for the official project.

@phated
Copy link
Contributor Author

phated commented Oct 26, 2018

@yangshun if you didn't catch the gulp announcement yesterday - our docusaurus website is live at https://gulpjs.com/docs/en/getting-started/quick-start

@yangshun
Copy link
Contributor

@phated I didn't catch it. This is sweet! Would you mind submitting a PR to add Gulp has a pinned user to Docusaurus website? Congrats on the launch!

@phated
Copy link
Contributor Author

phated commented Oct 27, 2018

@yangshun Thanks! I plan to submit our logo in a PR once we land this because currently we have to publish from my laptop only.

@endiliey are my submitted tests sufficient?

Copy link
Contributor

@endiliey endiliey left a comment

Choose a reason for hiding this comment

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

LGTM

So there are two ways of referencing link

// inline-style links : 
This is [Document 1](doc1.md)

// reference-style links e.g:  
This is [Document 1][doc1].

Then anywhere in the document
[doc1]: doc1.md

I did a small test
syntax

Works great
reference

I added the v2 implementation as well in this PR

@endiliey endiliey changed the title feat: replace reference links in documents feat: support reference-style linking in documents Oct 27, 2018
@endiliey endiliey merged commit bbf355f into facebook:master Oct 27, 2018
@phated
Copy link
Contributor Author

phated commented Oct 30, 2018

Could we get a 1.x release for this? I need our team members to have an installable version to publish with.

@yangshun
Copy link
Contributor

yangshun commented Nov 3, 2018

@phated Sorry for the delay, we just released v1.5.1 on npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support reference style linking
5 participants