-
Notifications
You must be signed in to change notification settings - Fork 10
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
[WIP] task/issue-275 Create Extensible Menus Query #285
Conversation
92916e5
to
f51b836
Compare
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.
Oh..., maybe i missing something, but I thought removing the require
calls from the shelf was just a matter of enabling the ability to use import()
.
I think this feature you are proposing here should really start with an issue first. Might be helpful to lead with proposing something via that workflow rather than just jumping into a PR, especially since this is also pulling in elements of #274.
I was really only expecting #275 to be import()
usage, tbh...
I thought we were removing need for the menu json file altogether. This way it's done on a page by page basis determines what page should be in what menu, and if necessary, it will add all headings as a table of contents within the graph for the page. In fact, your code started to do this with a seperate query within the shelf but you never utilized it. Now it's being utilized. |
// TODO remove require call - #275 | ||
this.shelfList = require(`./${page}.json`); | ||
|
||
// TODO not actually integrated, still using .json files - #271 |
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.
This line is what I'm referring to when I resolved 275 and started 271, using my method. You knew we were going to use a query here. You started using the query, but only printed it out to console and never fully implemented it. I thought the require was only temporary because the query wasn't completed. Now it is completed.
Well the details of #275 are specifically in reference to the fact that we shouldn't be using NodeJS APIs (
I think per something I saw in #265 , this would require additional Babel configuration. I can rename the issue if it helps clarify the intent but that was the outcome I was looking for from that issue. For this PR then and as with most (new) things, I still recommend that it all new ideas / enhancements goes through an issue workflow first ideally, to allow for technical design review / decision and share code snippets and APIs. Given the amount of moving parts here, I think this warrants it and then the issue links and branch names can be reflective of the intended scope / issue. |
You specifically put a query because the idea is to query our menu through graphql not import or require. There's no need to import or require that json file because its redundant(and therefore being removed) with a working graphql query. That's the point I think you're missing here. Read the rest of your code for the component. No json file, no import, no require. |
I understand the point, I wrote the issue. 😉 like I said, I'll just rename the issue because the main point was supporting My opinion on issues preceding PRs still stands and would / should apply here though. Keep #275 for |
closing this issue and i'll resubmit it |
Related Issue
Resolves #275
Summary of Changes
linkheadings: true
menu, index, linkheadings
which are added to our graph via the graph lifecyclelinkheadings
is flagged true, during graph lifecycle(as markdown file is already being read) we will parse the file for all headings, add it to our graph for that specific page, into an array we will use for our shelf later.menu
front-matter is used to specifically define a menu to use with any given markdown file e.g.navigation
orside
link
andmenu
side
ornavigation
listheadings
if so, it will loop through thetableOfContents
variable for that page, and create a list of children for that specific link.TODO
Note
At the moment this WIP. Data is received correctly, for all menus, only need to render it.