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

Restyle Docs Site #3935

Merged
merged 29 commits into from
Aug 15, 2021
Merged

Conversation

AyhamAl-Ali
Copy link
Member

@AyhamAl-Ali AyhamAl-Ali commented Apr 29, 2021

Description

  • Completely new styling to SkriptLang official documentation website.

  • Fixed some docs contains missing entries returning empty in the website instead of returning the default return.

  • Added favicon to the website.

  • Added Tutorials page (Will have a PR for it soon)

  • Merged Fix hex codes documentation #3889 PR with this PR.

  • Added quick made logos in the Assets folder in case someone needed it.

  • Added idScroll.js to automatically highlight current element in the side-navigation

  • Added copyrights section to the home page.

  • Added Github page to the menu.

  • Added code blocks syntax highlighting

  • Added Advanced Live Search Bar

  • Improved homepage, download links and contributors

  • Fixed HTML tags not working in the patterns of /classes/

  • Many issues fixed (check the related issues section)

  • Fixed some old Skript github links.

TODO:
✔️ - Fix some patterns have HTML codes but due to cleanPattern method they are not parsed.

LIVE VIEW: https://opg4mers.com/skdocs

How it looks (not updated)

image

image

image

image

image


Target Minecraft Versions: Any
Requirements: None
Related Issues: #3889 (Merged PR) (#1598 CSS and overall styling improvements) (#611 Related to tutorial and later will have a PR for that as well) (#4072 #4011 Fixed patterns) (#1184 fix a wrong example) (CSS and responsivity improvements) #2705 (#1338 Adding more description as requested in the comment) #2425 #1253

- Completely new styling to SkriptLang official documentation website.

- Fixed some docs contains missing entries returning  empty in the website instead of returning the default return.

- Added favicon to the website.
- Added Tutorials page (Will have a PR for it soon)
- Merged SkriptLang#3889 PR with this PR.

- Added quick made logos in the Assets folder in case someone needed it.

- Added idScroll.js to automatically highlight current element in the side-navigation
- Added copyrights section to the home page.
- Added Github page to the menu.

Fixed some old Skript github links.

**TODO:**
- Fix some patterns have HTML codes but due to cleanPattern method they are not parsed.
@TPGamesNL TPGamesNL added 2.6 documentation Related to Skript's official documentation. enhancement Feature request, an issue about something that could be improved, or a PR improving something. labels Apr 30, 2021
Added Active Tab JS code to make current page tabs highlighted

Fixed some pages should have no-left-panel 

Fixed some pages have some clipped content such as Text page the copyrights at the end was clipped

Fixed images in assets folder were corrupted due being copied as String in the Java Code

Fixed multiple styling

Fixed responsiveness

Added Skript Version to nav-bar
Fixed a typo Github -> GitHub

Packed all JS codes into main.js
Copy link
Member

@TPGamesNL TPGamesNL left a comment

Choose a reason for hiding this comment

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

I very much like this new design, but I do have some comments.

If anyone wants to preview it, extract this zip and open index.html: docs.zip (it doesn't have any region or economy related stuff, but it's good enough for a preview)

src/main/java/ch/njol/skript/doc/HTMLGenerator.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/doc/HTMLGenerator.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/doc/HTMLGenerator.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/doc/HTMLGenerator.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/doc/HTMLGenerator.java Outdated Show resolved Hide resolved
docs/text.html Outdated Show resolved Hide resolved
docs/text.html Outdated Show resolved Hide resolved
docs/tutorials.html Outdated Show resolved Hide resolved
docs/index.html Outdated Show resolved Hide resolved
docs/index.html Outdated Show resolved Hide resolved
@AyhamAl-Ali
Copy link
Member Author

SkriptDocs2.6.zip
This is the docs file after update

src/main/java/ch/njol/skript/doc/HTMLGenerator.java Outdated Show resolved Hide resolved
docs/text.html Outdated Show resolved Hide resolved
docs/text.html Outdated Show resolved Hide resolved
Copy link
Member

@TPGamesNL TPGamesNL left a comment

Choose a reason for hiding this comment

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

(if anyone wants to see this online: https://tpgames.tk/docs/index.html)
I did notice that going to https://tpgames.tk/docs/, instead of https://tpgames.tk/docs/index.html will cause some issues:
image
(grey line appears and Home is no longer selected)
Correct version:
image

(btw, sorry: GitHub messed up the review a bit and split it up into two parts)

docs/index.html Outdated Show resolved Hide resolved
docs/index.html Outdated Show resolved Hide resolved
- Fix indentation using spaces not tabs (Caused some elements to looks like it has padding)
- Replaced `fit-content` with `max-content` for Firefox compatibility.
- Fix active tab in default home page when not having `index.html` in the link
- Fix left-panel scrollbar appearing in default home page.
- Fix indentation using spaces not tabs (Caused some elements to look like it has padding)
- Replaced `fit-content` with `max-content` for Firefox compatibility.
- Fix active tab in default home page when not having `index.html` in the link
- Fix left-panel scrollbar appearing in default home page.
@AyhamAl-Ali
Copy link
Member Author

Editing the commit message due to a typo caused the commits to duplicate, sorry.
Live test here: http://opg4mers.com/skdocs/

@FranKusmiruk
Copy link
Member

it is probably because I am using a small screen but in the home page the documentation block gets out of place:
image

@AyhamAl-Ali
Copy link
Member Author

AyhamAl-Ali commented Jul 3, 2021

it is probably because I am using a small screen but in the home page the documentation block gets out of place:

True, the website is still not perfect with responsivity but I will try to improve it with time.
I will push a quick fix for this to be like this in smaller screens
image

After that the block will disappear as it used to be

@AyhamAl-Ali
Copy link
Member Author

Second commit message is wrong. This is the correct issue related #2705

Copy link
Member

@BaeFell BaeFell left a comment

Choose a reason for hiding this comment

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

Just a minor change that I don't think was needed. Everything else looks ok.

@TPGamesNL
Copy link
Member

@AyhamAl-Ali Can you edit the PR message to include all related issues?

@AyhamAl-Ali
Copy link
Member Author

@AyhamAl-Ali Can you edit the PR message to include all related issues?

Done 👍

@TPGamesNL
Copy link
Member

Can you modify docs/README.md to tell how to generate docs?

@TPGamesNL
Copy link
Member

Part of the bottom of the screen doesn't contain content:
image

Also, I'm not marking #4072 as completed / PR available when there's the scenario of |) remaining. I'll take a look at fixing that in cleanPatterns later.

The link icon looks weird in size/position now:
image
I think it'd be a good idea to make clicking the icon copy the link.

@AyhamAl-Ali
Copy link
Member Author

Part of the bottom of the screen doesn't contain content:
image

Also, I'm not marking #4072 as completed / PR available when there's the scenario of |) remaining. I'll take a look at fixing that in cleanPatterns later.

The link icon looks weird in size/position now:
image
I think it'd be a good idea to make clicking the icon copy the link.

Okay, I will look into this as soon as I can and regarding the cleanPattern yes there is still a remaining scenario as you said so it is not fully fixed yet.

- Fixed `cleanPattern` method not fully handling optional brackets (Thanks to @TPGamesNL  for helping me with this)
- Fixed `classes (types)` having unneeded <code> tags in the patterns
- Fixed `classes (types)` patterns not parsing HTML well
- Fixed `classes (types)` patterns not parsing links
- Improved `HTMLGenerator.class` to use StringBuilder in some cases
- Fixed `CommandSender` type example
@AyhamAl-Ali
Copy link
Member Author

Few things left for this PR and it will be ready to merge

  • Fixing a bug with command arguments being deleted by the HTML filter
  • Improving the homepage

@AyhamAl-Ali
Copy link
Member Author

AyhamAl-Ali commented Aug 5, 2021

Due to this commit this issue can be marked as PR Available #4072

@AyhamAl-Ali
Copy link
Member Author

Keeping up.. Big update is coming :)

- I introduce to you "The Search Bar" which will search the patterns and the syntax name for matches + it has a filter for versions (v:X.Y[.Z][+] - Ex. v: 2.5.3 will filter searches that only match the current search value and the version 2.5.3) (if '+' is added to the end it will also match all versions above the requested version Ex. v:2.5.3+ will match 2.6 and up as well) + added auto focus to the search bar for quicker search.

- HighlightJs - This is a nice little addition to the website that will make all the codes look much nicer with colors (even tho not made for Skript but later I will have an update for Skript Syntax highlighting using my own Sk-VSC extension) This has 1 issue though, it made the docs pages take 1-2 seconds to load because it will highlight all the code blocks in the page which are so many.

- Improved the homepage + Added a quick overview code to the homepage as a quick Skript example for the users to have an idea what Skript code looks like + download links and contributors size

- Improved some styling and changed some old colors + fixed some responsivity

- Added jQuery, HighlightJS to the libraries

- Fixed DocumentationID annotation, field and method not being used at all in docs generation.

- Fixed duplicated IDs - This was due to [wrong]? registration of syntaxes by registering the same class for multiple patterns which caused the docs to have multiple elements with the same ID which broke the search-bar but it has been fixed.

- Fixed some typos.

- Added multiple placeholders to the docs such as: ${latest-version} ${contributors-size} ${{skript.build.date}.

- Fixed code example that uses html list were not working
@AyhamAl-Ali
Copy link
Member Author

Adding to the latest commit..

  • Fixed [on] not being added to events that begin with On as it should be.

Also, this update contains syntax highlighting for the code blocks which is very nice and cool but it has 1 little issue about loading the doc pages (will take about 1-2 seconds to load the page) which if it is very annoying for most of the users I can enable it only in the homepage which doesn't take long time but other pages will not have any syntax highlighting so I would like to hear your opinion here or on discord AyhamAlali#0001

- Keep in mind that any syntax documentation annotation support HTML codes so if you are using any character that might be treated as HTML tag must be escaped.
- Add open-graph meta tags
@AyhamAl-Ali
Copy link
Member Author

✅ This PR is now ready to be merged.

Copy link
Member

@Moderocky Moderocky left a comment

Choose a reason for hiding this comment

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

LGTM.

As per our discussion, you can make a follow-up PR with any speed + SH improvements. :)

- Added a quick fix for the newlines being removed due to minifyHtml which fixes the code example syntax highlighting.
@TPGamesNL TPGamesNL merged commit 7a1929a into SkriptLang:master Aug 15, 2021
@AzonFR
Copy link

AzonFR commented Aug 30, 2021

The new design is perfect
Proposal: it would be cool to have a "recent" category that shows the latest additions

@APickledWalrus
Copy link
Member

The new design is perfect

Proposal: it would be cool to have a "recent" category that shows the latest additions

I like this idea. Could probably do something with the since tag to make this possible.

@AyhamAl-Ali
Copy link
Member Author

The new design is perfect
Proposal: it would be cool to have a "recent" category that shows the latest additions

I like this idea. Could probably do something with the since tag to make this possible.

Indeed. The base of this feature has already been implemented in the search feature, feature already in process + ability to choose new stuff in specific versions :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to Skript's official documentation. enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants