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

Improved New Documentation #3678

Merged
merged 54 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
cbcf7f8
docs: new Documentation
emersonbottero Oct 15, 2022
0da56a1
docs: new Documentation
emersonbottero Oct 15, 2022
c8b377b
docs: small improvements
emersonbottero Oct 17, 2022
c45bf05
docs: added warning and notes
emersonbottero Oct 18, 2022
d296049
docs: added warning and notes
emersonbottero Oct 18, 2022
e95eadd
docs: added warning and notes
emersonbottero Oct 18, 2022
66ea491
docs: fix layout problem
emersonbottero Oct 18, 2022
f2571e9
fix: Live editor links
sidharthv96 Oct 18, 2022
017fc48
Merge branch 'develop' of https://github.com/emersonbottero/mermaid i…
sidharthv96 Oct 18, 2022
4cd1e9a
docs: contribute with vitepress
emersonbottero Oct 20, 2022
4b64775
docs: small fixes
emersonbottero Oct 20, 2022
870cfdc
docs: transform custom blocks, warning notes jison
emersonbottero Oct 20, 2022
563aff2
fix: gh pages workflow
emersonbottero Oct 21, 2022
b62873a
sync last changes
emersonbottero Oct 25, 2022
47e1f61
fix: lint and spell errors
emersonbottero Oct 26, 2022
455839c
fix: Merge conflicts
emersonbottero Oct 26, 2022
289ac52
fix : CQ
emersonbottero Oct 26, 2022
ec5568b
chore: more revision fixes
emersonbottero Oct 27, 2022
6b3892b
Merge remote-tracking branch 'origin/develop' into pr/emersonbottero/…
sidharthv96 Oct 28, 2022
d7bf92b
fix: Use AST to replace notes & warnings.
sidharthv96 Oct 28, 2022
b7d24c8
chore: Fix favicon
sidharthv96 Oct 28, 2022
13e5c5b
chore: Fix vitepress build
sidharthv96 Oct 28, 2022
b0b4ccc
fix: Team members
sidharthv96 Oct 28, 2022
61e20ce
chore: update cspell.json
sidharthv96 Oct 28, 2022
6e5adbf
Merge remote-tracking branch 'origin/develop' into pr/emersonbottero/…
sidharthv96 Oct 28, 2022
e1d9d0b
chore: Fix doc links
sidharthv96 Oct 28, 2022
f3cf6d6
chore: Add prettier to docs:code
sidharthv96 Oct 28, 2022
8f5fe38
chore: format blockquote
sidharthv96 Oct 28, 2022
fed3260
chore: Update docs build vitepress command
sidharthv96 Oct 28, 2022
f87d163
chore: fix most of aloisklink reviews
emersonbottero Oct 31, 2022
a7c9fe7
Update packages/mermaid/src/docs.mts
sidharthv96 Oct 31, 2022
3675682
Apply suggestions from code review
sidharthv96 Oct 31, 2022
01ac770
chore: Review comments
sidharthv96 Oct 31, 2022
85444db
Merge branch 'develop' of https://github.com/emersonbottero/mermaid i…
sidharthv96 Oct 31, 2022
d1e235a
chore: Ignore `packages/mermaid/src/docs/config/setup`
sidharthv96 Oct 31, 2022
450c308
Update packages/mermaid/.lintstagedrc.json
sidharthv96 Oct 31, 2022
24198ed
Merge remote-tracking branch 'origin/develop' into pr/emersonbottero/…
sidharthv96 Oct 31, 2022
359a570
Precommit Test
sidharthv96 Oct 31, 2022
d08701e
Precommit Test
sidharthv96 Oct 31, 2022
1e410de
Precommit Test
sidharthv96 Oct 31, 2022
3b7463e
Precommit Test
sidharthv96 Oct 31, 2022
c72bdc8
chore: Cleanup lintStaged
sidharthv96 Oct 31, 2022
f36e0ef
chore: Add actions deploy
sidharthv96 Oct 31, 2022
56c2fe3
Publish
sidharthv96 Oct 31, 2022
2c5a207
Fix lint
sidharthv96 Oct 31, 2022
78565d1
Add pnpm
sidharthv96 Oct 31, 2022
83fb0f4
Fix base
sidharthv96 Oct 31, 2022
b735c21
chore: Remove test branch
sidharthv96 Oct 31, 2022
a923478
chore: Configure typedoc source links
sidharthv96 Oct 31, 2022
61b7033
fix: Lint
sidharthv96 Oct 31, 2022
70ec91d
docs: Change yarn to pnpm
sidharthv96 Nov 1, 2022
4699ba3
Update contributors
sidharthv96 Nov 1, 2022
86f835c
Merge branch 'develop' into pr/emersonbottero/3678
sidharthv96 Nov 1, 2022
05fd856
chore: cSpell
sidharthv96 Nov 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/mermaid/src/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig({
themeConfig: {
nav: nav(),
editLink: {
pattern: 'https://github.com/mermaid-js/mermaid/edit/develop/docs/:path',
pattern: 'https://github.com/mermaid-js/mermaid/edit/develop/packages/mermaid/src/docs/:path',
text: 'Edit this page on GitHub',
},

Expand Down
26 changes: 25 additions & 1 deletion packages/mermaid/src/docs/.vitepress/mermaid-markdown-all.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
import { MermaidMarkdown } from 'vitepress-plugin-mermaid';
// import { deflate } from 'pako';
// import { fromUint8Array } from 'js-base64';
import shiki from 'shiki';

// const serializeState = (state: State, serde: SerdeType = 'pako'): string => {
// if (serdes[serde] === undefined) {
// throw new Error(`Unknown serde type: ${serde}`);
// }
// const json = JSON.stringify(state);
// const serialized = serdes[serde].serialize(json);
// return `${serde}:${serialized}`;
// };

// const serialize = (state: string): string => {
// const data = new TextEncoder().encode(state);
// const compressed = deflate(data, { level: 9 });
// return fromUint8Array(compressed, true);
// };
emersonbottero marked this conversation as resolved.
Show resolved Hide resolved

export default {
config: async (md) => {
MermaidMarkdown(md);
Expand All @@ -15,9 +32,16 @@ export default {
let code = highlighter.codeToHtml(token.content, { lang: 'mermaid' });
code = code.replace('#2e3440ff', 'transparent');
code = code.replace('#292D3E', 'transparent');
console.log(token.content);

code =
'<h5>Code:</h5>' +
'<div class="language-mermaid"><button class="copy"></button><span class="lang">mermaid</span>' +
`<div class="language-mermaid">` +
// tODO: compute edit link!
// `<a class="edit" href="https://mermaid.live/edit#pako:${serialize(
// token.content
// )}" target=”_blank”>✒️</a>` +
`<button class="copy"></button><span class="lang">mermaid</span>` +
code +
'</div>';

Expand Down
6 changes: 6 additions & 0 deletions packages/mermaid/src/docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@
.vp-doc > div {
width: 100%;
}

a.edit {
margin: 12px;
position: relative;
top: 10px;
}
6 changes: 3 additions & 3 deletions packages/mermaid/src/docs/syntax/flowchart.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,10 @@ Beginner's tip—a full example using interactive links in a html context:
</pre>

<script>
var callback = function () {
const callback = function () {
alert('A callback was triggered');
};
var config = {
const config = {
startOnLoad: true,
flowchart: { useMaxWidth: true, htmlLabels: true, curve: 'cardinal' },
securityLevel: 'loose',
Expand Down Expand Up @@ -594,7 +594,7 @@ A shorter form of adding a class is to attach the classname to the node using th
```mermaid-example
flowchart LR
A:::someclass --> B
classDef someclass fill:#f96;
classDef someclass fill:#f96
```

### Css classes
Expand Down