Skip to content

Commit

Permalink
chore: Update readme and license
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Dec 18, 2023
1 parent 8ec2ab3 commit fa233a8
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 7 deletions.
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Notice to external contributors


## General info

Hello! In order for us (YANDEX LLC) to accept patches and other contributions from you, you will have to adopt our Yandex Contributor License Agreement (the “**CLA**”). The current version of the CLA can be found here:
1) https://yandex.ru/legal/cla/?lang=en (in English) and
2) https://yandex.ru/legal/cla/?lang=ru (in Russian).

By adopting the CLA, you state the following:

* You obviously wish and are willingly licensing your contributions to us for our open source projects under the terms of the CLA,
* You have read the terms and conditions of the CLA and agree with them in full,
* You are legally able to provide and license your contributions as stated,
* We may use your contributions for our open source projects and for any other our project too,
* We rely on your assurances concerning the rights of third parties in relation to your contributions.

If you agree with these principles, please read and adopt our CLA. By providing us your contributions, you hereby declare that you have already read and adopt our CLA, and we may freely merge your contributions with our corresponding open source project and use it in further in accordance with terms and conditions of the CLA.

## Provide contributions

If you have already adopted terms and conditions of the CLA, you are able to provide your contributions. When you submit your pull request, please add the following information into it:

```
I hereby agree to the terms of the CLA available at: [link].
```

Replace the bracketed text as follows:
* [link] is the link to the current version of the CLA: https://yandex.ru/legal/cla/?lang=en (in English) or https://yandex.ru/legal/cla/?lang=ru (in Russian).

It is enough to provide us such notification once.

## Other questions

If you have any questions, please mail us at [email protected].
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Yandex LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
12 changes: 7 additions & 5 deletions Readme.md → README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Diplodoc Mermaid extension

[![NPM version](https://img.shields.io/npm/v/@diplodoc/mermaid-extension.svg?style=flat)](https://www.npmjs.org/package/@diplodoc/mermaid-extension)

This is extension for Diplodoc platform which adds support for Mermaid diagrams.

Extension contains some parts:
Expand Down Expand Up @@ -45,14 +47,14 @@ Add mermaid runtime to your final page
});
</script>
</body>
</html>
</html>
```

## Prepared Mermaid runtime

The problem with Mermaid is that it has big bundle size.
The most expected behavior is loading it asynchronously.
But if we want to disable Mermaid's `startOnLoad` option, then we don't know when the Mermaid will be initialized.
But if we want to disable Mermaid's `startOnLoad` option, then we don't know when the Mermaid will be initialized.

**Prepared Mermaid runtime** designed to solve this problem.
We disable Mermaid's `startOnLoad` option to precise control render step.
Expand Down Expand Up @@ -133,13 +135,13 @@ const Doc: React.FC = ({ content }) => {
})
]
})

// Load mermaid only if one or more diagram should be rendered
if (result.script.includes(MERMAID_RUNTIME)) {
// Load oversized mermaid runtime asyncronously
import('@diplodoc/mermaid-extension/runtime')
}

return <div dangerouslySetInnerHTML={{ __html: result.html }} />
}

Expand All @@ -161,4 +163,4 @@ export const App: React.FC = ({ theme }) => {
/>
</>
}
```
```
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"markdown-it"
],
"author": "",
"license": "ISC",
"license": "MIT",
"files": [
"plugin",
"runtime",
Expand Down

0 comments on commit fa233a8

Please sign in to comment.