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

Add new config DOC_FOLDERS to support multiple doc folders #207

Merged
merged 6 commits into from
Jun 7, 2019

Conversation

javidhsueh
Copy link
Contributor

No description provided.

@javidhsueh javidhsueh requested review from jckr and ibgreen and removed request for jckr June 6, 2019 20:40
gatsbyConfig.plugins.push({
resolve: 'gatsby-source-filesystem',
options: {
name: 'docs',
Copy link
Contributor

Choose a reason for hiding this comment

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

what does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will source files in the folder into Gatsby system and create File nodes. Later on, gatsby-transformer-remark transforms markdown files into MarkdownRemark nodes.

Here I'm trying to source data from DOC_FOLDER or DOC_FOLDERS

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should these all have the same name: 'docs'? Does this affect how we query them?

@@ -18,6 +18,8 @@
| `EXAMPLES` | `Array` | See below |
| `INDEX_PAGE_URL` | `String` | Optional URL to a replacement component for the home page. |
| `DOC_PAGE_URL` | `String` | Optional URL to a replacement component for doc pages. |
| `DOC_FOLDER` | `String` | The path to the doc folder. |
Copy link
Contributor

@jckr jckr Jun 6, 2019

Choose a reason for hiding this comment

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

right now DOC_FOLDER doesn't do anything. ocular will always look into /docs

Copy link
Contributor Author

@javidhsueh javidhsueh Jun 6, 2019

Choose a reason for hiding this comment

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

I think we should expose it explicitly to the users instead of looking into /docs magically.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If DOC_FOLDER doesn't do anything let's delete it and use DOC_FOLDERS only? Having two of these does not seem to be in the user's interest.

@jckr
Copy link
Contributor

jckr commented Jun 7, 2019

from our conversation what this does is that this allows to build one single documentation tree from files existing in various folders.
But we'll also want to build several documentation trees (ie not necessarily starting with /docs).
What I'd like is an API that doesn't force us to change the configuration down the road.

@ibgreen
Copy link
Collaborator

ibgreen commented Jun 7, 2019

But we'll also want to build several documentation trees (ie not necessarily starting with /docs).

What use case do you have in mind?

@javidhsueh
Copy link
Contributor Author

from our conversation what this does is that this allows to build one single documentation tree from files existing in various folders.
But we'll also want to build several documentation trees (ie not necessarily starting with /docs).
What I'd like is an API that doesn't force us to change the configuration down the road.

Right now, it still supports 'DOC_FOLDER' and 'DOC_FOLDERS' at the same time. The 'DOC_FOLDER' will supersede over 'DOC_FOLDERS' if both of them exist.

@@ -18,6 +18,8 @@
| `EXAMPLES` | `Array` | See below |
| `INDEX_PAGE_URL` | `String` | Optional URL to a replacement component for the home page. |
| `DOC_PAGE_URL` | `String` | Optional URL to a replacement component for doc pages. |
| `DOC_FOLDER` | `String` | The path to the doc folder. |
Copy link
Collaborator

Choose a reason for hiding this comment

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

If DOC_FOLDER doesn't do anything let's delete it and use DOC_FOLDERS only? Having two of these does not seem to be in the user's interest.

gatsbyConfig.plugins.push({
resolve: 'gatsby-source-filesystem',
options: {
name: 'docs',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should these all have the same name: 'docs'? Does this affect how we query them?

@javidhsueh
Copy link
Contributor Author

  • Remove comment
  • Remove "DOC_FOLDER" from documentation
  • Add messages to warn that some config to be deprecated soon. (DOC_FOLDER)

@javidhsueh javidhsueh merged commit 70ce6b8 into master Jun 7, 2019
@javidhsueh javidhsueh deleted the javid/multiple-docs branch June 7, 2019 19:36
@jckr
Copy link
Contributor

jckr commented Jun 7, 2019

the use case I have in mind is vis academy which i think is not the only "classic" ocular website with several documentation trees.
in vis academy, not only md files are in different folder, but they are built into different trees with different urls which don't necessarily start with /docs/.

this is in that spirit that i opened #173.

the issue today is that "docs" is not only assumed to be the location of md files and documentation files, but also of the url of all of the documentation. when there are too many pages / too many levels it makes sense to no longer want to have all documentation be under one single tree, even if they can be visible under the search for instance.

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