-
Notifications
You must be signed in to change notification settings - Fork 4
Allow submodule version aliases for import paths #202
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
Conversation
Amplify deployment status
|
2ec7e17
to
4c62c93
Compare
Closes #195 Add a `remark` plugin that lets a docs author include an `import` statement that points to a directory in the current version submodule of the docs site. This makes it possible to import the path of a static asset or, with the `!!raw-loader!` directive, the full content, using an `import` statement, without having to know which versioned submodule an asset is in at a given time. To use this, add the string `@version` to the start of an import path, e.g.,: ```jsx import PNGPath from '@version/docs/img/myimg.png' ``` In a `gravitational/teleport` clone at the current default version of the docs site, the new plugin would add the following: ```jsx import PNGPath from '@site/content/17.x/docs/img/myimg.png' ``` Note that we currently use a workaround in which we place some static assets in the `/static` directory, which exists outside the submodule directory tree. This is approach is cumbersome since it requires a change to `docs-website` for every asset we want to include using an `import` statement. The `@site` alias is a Docusaurus feature that the docs engine replaces with the root path of the Docusaurus project. The plugin fills in the path of the current `gravitational/teleport` submodule. To import the content of a text asset, rather than the file path, you would use the `!!raw-loader` syntax as you would for any Docusaurus asset: ```jsx import PNGPath from '!!raw-loader!@version/docs/img/myimg.png' ```
4c62c93
to
d6e33f5
Compare
for the dep review, you may need to add the variant that is failing there like this but also, check and see if the dependency can maybe be updated or changed to a version that we might support (assuming the license changes). i know its a peer dep, so maybe not |
@avatus Thanks for taking a look! I'm a little leery of adding an allowed license variant since the variant is |
i think without making the license change, the only other options we have is somehow get them to change their license (we have fixed licenses before with PRs to other deps), or find another package that does something similar |
Revert unnecessary dependency changes. Remove @types/estree. Also remove an extraneous `mdast-util-mdxjs-esm` mention in `package.json`. Add swc/core to the list of dependencies with allowed licenses for the dependency review workflow. While the package uses the Apache 2.0 license, which is already configured as allowed in the workflow, the workflow also detects an unknown license that does not appear to be present in the package's code repository.
4a45319
to
5877372
Compare
You rock!! |
Closes #195
Add a
remark
plugin that lets a docs author include animport
statement that points to a directory in the current version submodule of the docs site. This makes it possible to import the path of a static asset or, with the!!raw-loader!
directive, the full content, using animport
statement, without having to know which versioned submodule an asset is in at a given time.To use this, add the string
@version
to the start of an import path, e.g.,:In a
gravitational/teleport
clone at the current default version of the docs site, the new plugin would add the following:Note that we currently use a workaround in which we place some static assets in the
/static
directory, which exists outside the submodule directory tree. This is approach is cumbersome since it requires a change todocs-website
for every asset we want to include using animport
statement.The
@site
alias is a Docusaurus feature that the docs engine replaces with the root path of the Docusaurus project. The plugin fills in the path of the currentgravitational/teleport
submodule.To import the content of a text asset, rather than the file path, you would use the
!!raw-loader
syntax as you would for any Docusaurus asset: