mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-16 16:25:56 +02:00
feat(v2): add support to import assets using relative link in markdown syntax (#3096)
* add a rehyper plugin * fix yarn.lok * add target * convert to remark * add docs * remove unused package * remove file-loader * add test for file-loader * fix test
This commit is contained in:
parent
64293bf87f
commit
325559933f
10 changed files with 218 additions and 0 deletions
|
@ -14,6 +14,7 @@ const stringifyObject = require('stringify-object');
|
|||
const slug = require('./remark/slug');
|
||||
const rightToc = require('./remark/rightToc');
|
||||
const transformImage = require('./remark/transformImage');
|
||||
const tranformAsset = require('./remark/transformAssets');
|
||||
|
||||
const DEFAULT_OPTIONS = {
|
||||
rehypePlugins: [],
|
||||
|
@ -34,11 +35,16 @@ module.exports = async function (fileString) {
|
|||
transformImage,
|
||||
{staticDir: reqOptions.staticDir, filePath: this.resourcePath},
|
||||
],
|
||||
[
|
||||
tranformAsset,
|
||||
{staticDir: reqOptions.staticDir, filePath: this.resourcePath},
|
||||
],
|
||||
...(reqOptions.remarkPlugins || []),
|
||||
],
|
||||
rehypePlugins: [
|
||||
...(reqOptions.beforeDefaultRehypePlugins || []),
|
||||
...DEFAULT_OPTIONS.rehypePlugins,
|
||||
|
||||
...(reqOptions.rehypePlugins || []),
|
||||
],
|
||||
filepath: this.resourcePath,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue