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: Improve Quick start instructions #1458

Merged
merged 2 commits into from
Dec 30, 2020
Merged

Conversation

waldyrious
Copy link
Contributor

Summary

  • Slightly tweak Python server instructions to be more generic
  • Clarify the section about customizing the main container

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Repo settings
  • Other, please describe:

If changing the UI of default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

- Slightly tweak Python server instructions to be more generic
- Clarify the section about customizing the main container
@vercel
Copy link

vercel bot commented Dec 29, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/docsify-core/docsify-preview/esq553l1l
✅ Preview: https://docsify-preview-git-fork-waldyrious-patch-1.docsify-core.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 29, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 64de258:

Sandbox Source
docsify-template Configuration

@sy-records sy-records requested a review from a team December 30, 2020 00:25
@@ -97,7 +97,7 @@ If you want, you can show a loading dialog before docsify starts to render your
<div id="app">Please wait...</div>
```

You should set the `data-app` attribute if you changed `el`:
By default, the `id` attribute of the main container is `app`. If you want to use a different id, you must also set the `data-app` attribute, and [configure](configuration.md#el) the `el` parameter accordingly:
Copy link
Member

Choose a reason for hiding this comment

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

A bit weird that we need to set data-app like this. Let's fix in v5.

/wish-there-was-a-bot-command-to-open-an-new-issue-right-from-here

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@sy-records let's get things moving. Let's make changes more organic (as per the other v5 topic I closed), and we can release a major version bump any time we fix a small feature that is breaking. In this case, this one is worth it in my opinion.

Copy link
Member

@trusktr trusktr left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@sy-records sy-records merged commit 9a15ffb into docsifyjs:master Dec 30, 2020
sy-records added a commit that referenced this pull request Dec 30, 2020
@sy-records
Copy link
Member

Sorry, The branch is wrong, We didn't notice... @trusktr 😅

@waldyrious waldyrious deleted the patch-1 branch December 30, 2020 10:13
@waldyrious
Copy link
Contributor Author

Sorry, The branch is wrong, We didn't notice... @trusktr 😅

I see that develop is already the default branch on GitHub, so this shouldn't happen from PRs initiated from the GitHub interface. However, in this case I clicked the "Edit document" link at https://docsify.js.org/#/quickstart. It seems like the edit code needs to be fixed to target the correct branch. 🙂

I noticed the master branch being hardcoded in several places:

I'd be happy to submit a PR fixing those, if that list is exhaustive, and hardcoding develop is the right solution (it would be nice if the default branch could be detected dynamically).

@sy-records
Copy link
Member

Oh, I see, thanks for the feedback @waldyrious

@trusktr
Copy link
Member

trusktr commented Dec 30, 2020

I'd be happy to submit a PR fixing those, if that list is exhaustive, and hardcoding develop is the right solution (it would be nice if the default branch could be detected dynamically).

@waldyrious That would be great indeed to update those. Not sure about the dynamic part. Maybe GitHub had an API to fetch the default branch?

EDIT: looks like it does! See here: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#get-a-repository, in particular the default_branch value that is returned.

Here's the example payload for Docsify:

https://api.github.com/repos/docsifyjs/docsify

@sy-records
Copy link
Member

@waldyrious Can you resubmit a PR for #1458?

@waldyrious
Copy link
Contributor Author

@trusktr thanks for the information! I took a look at the code but it's a little more complex than I anticipated at first.

I suppose one would have to use the get function from ajax.js to make the API request, then use JSON.parse to extract the default_branch key from the resulting object; however, the various replacements done while preparing the edit link seem to require some extra logic to detect the branch from which the site is served. I think I'll leave this to someone more familiar with the code :)

@waldyrious Can you resubmit a PR for #1458?

@sy-records sure! I just submitted #1466.

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