-
-
Notifications
You must be signed in to change notification settings - Fork 653
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: adding ability to build docs (sidebar and toc) with generic script, small refactor to build-post-script #458
Conversation
❌ Deploy Preview for asyncapi-website failed. 🔨 Explore the source changes: 8c9d69f 🔍 Inspect the deploy log: https://app.netlify.com/sites/asyncapi-website/deploys/618a8101712cfb000882d11a |
Co-authored-by: Fran Méndez <fmvilas@gmail.com>
…ey123/website into making-build-post-list-more-generic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, but it needs some improvements :)
Thanks for the reviews. I decided to look at this again, and I felt the code was bloating in areas, and I think it was time to separate some of the logic. The new improvements are:
This will allow us to continue using Hopefully, that makes sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One suggestion and one question :)
Co-authored-by: Maciej Urbańczyk <urbanczyk.maciej.95@gmail.com>
…ey123/website into making-build-post-list-more-generic
The main issue I see here (if I am following correctly 😱), is the urls proposed? So I wanted to give another explanation here of how you want to structure the urls for tools. (First, remember that I'm talking to you about how I'm already planning on changing our docs main domain as well, so my examples below will make more sense.) docs.asyncapi.com/tools/modelina No subsections yet, cause one thing at a time. Later, we can add/migrate the tools docs and create needed subsections. |
Thanks @alequetzalli
Yeah at the moment this PR will extend what we have to get the docs onto the main website, but from what I'm reading maybe we should hold fire on this work until you have Sorry I'm not up to speed on whats happening with |
IMHO, I think you are correct and that we should hold off on merging this one until the new URL redirects are in place. I am thinking I shall prioritize and do this the week after the conference because if I try to get it done before, I don't think Lukasz will have time to process my PRs. 😂😂😂
Yes, you're totally right! Sorry about that, I noticed context was missing here. I have created a Docs issue in our Docs Board to detail all the change implications from this URL cleanup I'm talking here: #459 |
This pull request has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation. There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
This pull request has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation. There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
closing this PR as there is no progress and there were also many changes in related scripts. Better open fresh Pr if you still want to work on it |
Description
I'm currently working on #442 which allows us to pull down docs from external repos and render them on our website, a small part of that process the the ability to generate the needed
.json
file required for the side navigation and table of contents in the docs.I started by writing my own file which you can see in #442, but after talking to @derberg we explored the ability to reuse what we already have.
This PR introduced and reuses what we already have to allow us to use this code more generically in the future.
Changes
build-post-list.js
is nowbuild-doc-list.js
.node-version
file to tell Netlify which version of node to use when building, yargs won't work on super old versionNew Arguments
output
- You can set the output of the filedirectory
- You can specify the directory to processgroupByCategories
- This allows you to run the script and support the frontmatter format to group categories.Grouping by front-matter
When
groupByCategories
is true, the front matter for the menu will be read and consumed. Here is an exampleThis example will render (in the sidebar):
At the moment the script relies on you having a
_section.md
file to group your docs (which is OK for a website, but #442 we want to make this abit more generic), and I want to give tool builders the ability to add docs without having to know about_section.md
files and enforcing a folder structure on them too much. If they follow this standard markdown pattern they can render what they want on the website (under their tools url which needs to be decided still)This solution allows people (from external tools) to group their docs without folders and
_section.md
format.All they have to do is document the
menu > docs > parent
which will build the side navigation for them.