-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update README #116
Merged
Merged
Update README #116
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d435381
Remove unused options from README and plugin options schema
rogermparent 21afbbd
Add new options to the README and actually indent the default options
rogermparent 3aed01a
Merge branch 'main' into update-readme
rogermparent 9825654
Fix formatting and make Default always on top
rogermparent f317afb
Move README
rogermparent 778dd64
Finish incomplete item and make postCssPlugins block behave with linter
rogermparent d597f5d
Add main header and intro blurb
rogermparent 7dd41c9
Merge branch 'main' into update-readme
rogermparent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,8 @@ | ||
# Gatsby Theme: Iterative | ||
# Gatsby Theme: Iterative development monorepo | ||
|
||
This Gatsby Theme houses the shared website code for all websites for | ||
[Iterative](https://iterative.ai). This package is currently purpose-built | ||
specifically for our websites and not very useful outside of them, but we intend | ||
to change that as we make improvements and iron out issues! | ||
This repo is dedicated to the development of `gatsby-theme-iterative`, a shared | ||
code bundle used between all the Gatsby websites hosted by | ||
[Iterative, inc](iterative.ai)! | ||
|
||
## Usage | ||
|
||
### Options | ||
|
||
- disable: boolean Default: Boolean(process.env.SKIP_DOCS) | ||
|
||
- getTemplate: function Default: () => defaultGetTemplate | ||
|
||
- defaultTemplate: string Default: require.resolve('./src/templates/doc.tsx') | ||
|
||
- remark: boolean Default: true | ||
|
||
- filesystem: boolean Default: true | ||
|
||
- glossaryDirectory: string Default: 'docs/user-guide/basic-concepts' | ||
|
||
- simpleLinkerTerms: { matches: string, url: string }[] These terms will be | ||
passed to the simpleLinker remark plugin | ||
|
||
- cssBase: string Used as base files for global PostCSS variables and queries | ||
|
||
- customMediaConfig: object config passed to `postcss-custom-media` | ||
|
||
- customPropertiesConfig: object config passed to `postcss-custom-properties` | ||
|
||
- colorModConfig: object config passed to `postcss-color-mod` | ||
|
||
- postCssPlugins: Plugin[] If specified, this array will completely replace | ||
plugins this theme passes to PostCSS. This is mostly an escape hatch for if | ||
styles are broken with the default plugins. Check out | ||
[the theme's `gatsby-config`](https://github.com/iterative/gatsby-theme-iterative/blob/main/packages/gatsby-theme-iterative/gatsby-config.js) | ||
to see the default plugins, as not having them in this option will very likely | ||
break core functionality. | ||
|
||
### Examples | ||
|
||
See this example from | ||
[the example website's `gatsby-config.js`](https://github.com/iterative/gatsby-theme-iterative/blob/main/packages/example/gatsby-config.js). | ||
|
||
```js | ||
const path = require('path') | ||
const { | ||
name: themePackageName | ||
} = require('../gatsby-theme-iterative/package.json') | ||
|
||
module.exports = { | ||
trailingSlash: 'never', | ||
siteMetadata: { | ||
title: 'Example website', | ||
description: 'Example website description', | ||
keywords: ['docs', 'test'], | ||
siteUrl: 'http://localhost:8000' | ||
}, | ||
plugins: [ | ||
{ | ||
resolve: themePackageName, | ||
options: { | ||
simpleLinkerTerms: require('./content/linked-terms') | ||
} | ||
}, | ||
{ | ||
resolve: 'gatsby-source-filesystem', | ||
options: { | ||
name: 'images', | ||
path: path.join(__dirname, 'static', 'img') | ||
} | ||
}, | ||
'@sentry/gatsby' | ||
] | ||
} | ||
``` | ||
For more details about the theme itself, check out its | ||
[README](packages/gatsby-theme-iterative/README.md)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
# Gatsby Theme: Iterative | ||
|
||
This Gatsby theme is what [Iterative, inc.](https://iterative.ai) uses to power | ||
all of our Gatsby websites! It contains all of our shared utility code, as well | ||
as our full docs engine. This project is still evolving, and while it's | ||
currently very specific to iterative.ai websites we hope to make it usable for | ||
others in the future. | ||
|
||
## Usage | ||
|
||
### Options | ||
|
||
- disable: boolean | ||
|
||
Default: Boolean(process.env.SKIP_DOCS) | ||
|
||
Stops this theme from making pages. Could be used as a conditional for test | ||
and development purposes. | ||
|
||
- defaultTemplate: string | ||
|
||
Default: require.resolve('./src/templates/doc.tsx') | ||
|
||
Will be passed to the `getTemplate` function to use as a default template, the | ||
default function simply returns this if `template` isn't specified. | ||
|
||
- getTemplate: function | ||
|
||
Default: | ||
|
||
```ts | ||
const defaultGetTemplate = (template, defaultTemplate) => | ||
template | ||
? require.resolve(path.resolve('src', 'templates', template + '.tsx')) | ||
: defaultTemplate | ||
``` | ||
|
||
This function will be given the `template` field specified in the page's | ||
frontmatter, as well as the `defaultTemplate` specified by the option above. | ||
It is expected to return the absolute path to a React component to be given to | ||
Gatsby's `createPage` action. | ||
|
||
- remark: boolean | ||
|
||
Default: true | ||
|
||
if true, this theme will add its own instance of `gatsby-transformer-remark`. | ||
|
||
- filesystem: boolean | ||
|
||
Default: true | ||
|
||
if true, this theme will add its own instance of `gatsby-source-filesystem`. | ||
|
||
- glossaryPath: string | ||
|
||
Default: path.resolve('content', 'docs', 'user-guide', 'basic-concepts') | ||
|
||
- simpleLinkerTerms: { matches: string, url: string }[] | ||
|
||
Default: undefined | ||
|
||
These terms will be passed to `plugins/gatsby-remark-dvc-linker`, which will | ||
scan code blocks for ones with content matching `matches`, and then link it to | ||
that entry's `url`. | ||
|
||
- postCssPlugins: Plugin[] | ||
|
||
Default: | ||
|
||
```js | ||
const postCssPlugins = [ | ||
require('tailwindcss/nesting')(require('postcss-nested')), | ||
autoprefixer, | ||
require('tailwindcss') | ||
] | ||
``` | ||
|
||
If specified, this array will completely replace plugins this theme passes to | ||
PostCSS. This is mostly an escape hatch for if styles are broken with the | ||
default plugins. Check out | ||
[the theme's `gatsby-config`](https://github.com/iterative/gatsby-theme-iterative/blob/main/packages/gatsby-theme-iterative/gatsby-config.js) | ||
to see the default plugins, as not having them in this option will very likely | ||
break core functionality. | ||
|
||
- docsInstanceName: string | ||
|
||
Default: 'iterative-docs' | ||
|
||
The `name` that will be passed to the `gatsby-source-filesystem` instance for | ||
docs pages. The resulting `sourceInstanceName` will be used to identify files | ||
that will be processed as docs pages. | ||
|
||
- docsPath: string | ||
|
||
Default: path.resolve('content', 'docs') | ||
|
||
- glossaryInstanceName: string | ||
|
||
Default: 'iterative-glossary' | ||
|
||
The `name` that will be passed to the `gatsby-source-filesystem` instance for | ||
glossary entries. The resulting `sourceInstanceName` will be used to identify | ||
files that will be processed as glossary pages. | ||
|
||
- argsLinkerPath: string | ||
|
||
Default: ['command-reference', `ref`, 'cli-reference'] | ||
|
||
The path that `plugins/gatsby-remark-args-linker` will operate on, connecting | ||
arguments listed in the summary with their summaries deeper in the page. | ||
|
||
- docsPrefix: string | ||
|
||
Default: 'doc' | ||
|
||
This is the prefix that the docs pages will render to, including the index | ||
page at the exact path. | ||
|
||
### Examples | ||
|
||
See this example from | ||
[the example website's `gatsby-config.js`](https://github.com/iterative/gatsby-theme-iterative/blob/main/packages/example/gatsby-config.js). | ||
|
||
```js | ||
const path = require('path') | ||
const { | ||
name: themePackageName | ||
} = require('../gatsby-theme-iterative/package.json') | ||
|
||
module.exports = { | ||
trailingSlash: 'never', | ||
siteMetadata: { | ||
title: 'Example website', | ||
description: 'Example website description', | ||
keywords: ['docs', 'test'], | ||
siteUrl: 'http://localhost:8000' | ||
}, | ||
plugins: [ | ||
{ | ||
resolve: themePackageName, | ||
options: { | ||
simpleLinkerTerms: require('./content/linked-terms') | ||
} | ||
}, | ||
{ | ||
resolve: 'gatsby-source-filesystem', | ||
options: { | ||
name: 'images', | ||
path: path.join(__dirname, 'static', 'img') | ||
} | ||
}, | ||
'@sentry/gatsby' | ||
] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
const path = require('path') | ||
|
||
module.exports = { | ||
glossaryPath: path.resolve('content', 'docs', 'user-guide', 'basic-concepts'), | ||
docsPath: path.resolve('content', 'docs'), | ||
glossaryInstanceName: 'iterative-glossary', | ||
docsInstanceName: 'iterative-docs', | ||
glossaryPath: path.resolve('content', 'docs', 'user-guide', 'basic-concepts'), | ||
glossaryInstanceName: 'iterative-glossary', | ||
argsLinkerPath: ['command-reference', `ref`, 'cli-reference'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ exports.pluginOptionsSchema = ({ Joi }) => { | |
), | ||
remark: Joi.boolean().default(true), | ||
filesystem: Joi.boolean().default(true), | ||
glossaryDirectory: Joi.string().default( | ||
glossaryPath: Joi.string().default( | ||
path.resolve('content', 'docs', 'user-guide', 'basic-concepts') | ||
Comment on lines
18
to
20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. incomplete rename from before |
||
), | ||
docsDirectory: Joi.string().default(path.resolve('content', 'docs')), | ||
|
@@ -29,8 +29,6 @@ exports.pluginOptionsSchema = ({ Joi }) => { | |
url: Joi.string() | ||
}) | ||
), | ||
cssBase: Joi.string(), | ||
customMediaConfig: Joi.object(), | ||
postCssPlugins: Joi.array(), | ||
argsLinkerPath: Joi.alternatives() | ||
.try(Joi.string(), Joi.array().items(Joi.string())) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think a few other options were added too on #33. Can we also add those, or do we want to add them through another PR?
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.
I'll open a draft ticket on the board and assign myself for a follow-up after I'm done with plausible
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.
Actually, for now I'll add a super-basic list so we at least have them. I'll leave the ticket for more elaboration later.
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.
Just added the new commands and some more elaboration on others. Still needs some work, but it'll serve as a base.