apache / apisix-website

Apache APISIX Website
https://apisix.apache.org/
Apache License 2.0
127 stars 179 forks source link

implementing uniform doc page `id` for all documentation #363

Closed iamayushdas closed 3 years ago

iamayushdas commented 3 years ago

Actual Behaviour

The page id is not uniform for any of the documentations present in website

Expected Behaviour

There should be a uniformity in id for all docs of our sub projects.

  1. you can see here in screenshots that id is random for every page
  2. having uniform id's are very useful for developers to play with the DOM and implementing new features

Screenshots of the issue

Screenshot from 2021-06-11 12-27-12 Screenshot from 2021-06-11 12-26-29

Proposed solution Making uniform subheadings to every documentation.

Would you like to work on the issue?

Yes i would like to work on it

@juzhiyuan @Yiyiyimu please share your opinion

juzhiyuan commented 3 years ago

Not sure exactly what you mean 😳😳 Could you please describe more clearly?

iamayushdas commented 3 years ago

I have used subheading id as get selector to Manipulate DOM in naming the doc dropdown

But newly added commit in "apisix helm chart" has changed the subheading and therefore id is also changed

iamayushdas commented 3 years ago

Go to:

  1. Apisix website
  2. Choose apisix helm chart from doc dropdown You will see that docs is no longer renamed to what it was supposed to be. @juzhiyuan
juzhiyuan commented 3 years ago

Oh yes, I see what happens.

juzhiyuan commented 3 years ago

Just do it

iamayushdas commented 3 years ago

After new features from V2 i have got a way to fix this, I am fixing this please reopen it, @juzhiyuan @Yiyiyimu

spacewander commented 3 years ago

@iamayushdas First of all, you should discuss this in the mail list dev@apisix.apache.org before sending a bunch of PRs. It seems only a few people know this purpose.

Secondly, please modify the doc in a repo first, and evaluate the effect. Don't change a lot of things. Change it step by step.

Thirdly, it is not a good idea to put a visible mark on an obvious place. I just spend some time on this issue and get an idea:

Since the doc is pulled from other repo before building it on the website, we can introduce a preprocessor that converts the invisible mark to the mark that can be recognized by the render.

I am not sure if it works but at least there is way to achieve the goal with a better solution.

juzhiyuan commented 3 years ago

Agree with @spacewander, please have 1 repo test, or your bunch of PRs will confuse people who don't know this case :)

iamayushdas commented 3 years ago

okay we could first go with apisix-dashboard @juzhiyuan

iamayushdas commented 3 years ago

@iamayushdas First of all, you should discuss this in the mail list dev@apisix.apache.org before sending a bunch of PRs. It seems only a few people know this purpose.

Secondly, please modify the doc in a repo first, and evaluate the effect. Don't change a lot of things. Change it step by step.

Thirdly, it is not a good idea to put a visible mark on an obvious place. I just spend some time on this issue and get an idea:

Since the doc is pulled from other repo before building it on the website, we can introduce a preprocessor that converts the invisible mark to the mark that can be recognized by the render.

I am not sure if it works but at least there is way to achieve the goal with a better solution.

I understood sir, thank you for making me understand

juzhiyuan commented 3 years ago

Thirdly, it is not a good idea to put a visible mark on an obvious place. I just spend some time on this issue and get an idea:

As for this, because I haven't experienced this case, then it's ok for me to do this (is Docusarus using this? @iamayushdas) Waiting for more suggestions :)

cc @liuxiran @bzp2010 @lilien1010 @tokers @Yiyiyimu

iamayushdas commented 3 years ago

cc @liuxiran @bzp2010 @lilien1010 @tokers @Yiyiyimu yes docusaurus is using this now on @juzhiyuan

Docusaurus has opted this way for adding id's to be more precise. they have changed the md style in such a way that we can add precise id without harming our website reference md file - https://github.com/facebook/docusaurus/blob/master/website/docs/api/plugins/plugin-content-blog.md

screenshot:

image

website created from above md file: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog

screenshot: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog

Screenshot 2021-06-24 at 3 55 22 PM
spacewander commented 3 years ago

Are we discussing the "invisible mark way"? We should use a better way to solve the issue. A visible scar is unacceptable.

iamayushdas commented 3 years ago

If we change the subtitle with the name of sub-project then, then that name will automatically become the id

For example- if i name the sub title

APISIX-dashboard

This will automatically attach an id to the subtitle

apisix-dashboard

Also i am discussing about the invisible mark manner in docusaurus mailing list. @spacewander

iamayushdas commented 3 years ago

image

iamayushdas commented 3 years ago

Thirdly, it is not a good idea to put a visible mark on an obvious place. I just spend some time on this issue and get an idea:

As for this, because I haven't experienced this case, then it's ok for me to do this (is Docusarus using this? @iamayushdas) Waiting for more suggestions :)

cc @liuxiran @bzp2010 @lilien1010 @tokers @Yiyiyimu @gxthrj