Skip to content

Commit e471b7c

Browse files
authored
refactor: Generate reference documentation from TS Doc (#121)
1 parent 4e5207f commit e471b7c

File tree

240 files changed

+8305
-8288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+8305
-8288
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ npm-debug.log*
1919
yarn-debug.log*
2020
yarn-error.log*
2121

22-
src/alphatabdoc/
22+
src/alphatabdoc/
23+
docs/reference/types/

docs/getting-started/configuration-web.mdx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -108,28 +108,6 @@ api.scoreLoaded.on( (score) => {
108108
});
109109
```
110110

111-
</TabItem>
112-
<TabItem value="html">
113-
114-
DOM events are namespaced with a `alphaTab.` prefix and can be subscribed either via `addEventListener(eventName, handler)` or via jQuerys `.on(eventName, handler)`.
115-
To access potential parameters that are passed along the event, you will need to access the event details.
116-
117-
For raw DOM events, the info object will be contained in the [`detail`](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail) property of the DOM event.
118-
119-
```js
120-
element.addEventListener('alphaTab.scoreLoaded', (e) => {
121-
console.log('Score was loaded!', e.detail);
122-
});
123-
```
124-
125-
For jQuery events the object related to the event will be the second parameter:
126-
127-
```js
128-
$(element).on('alphaTab.scoreLoaded', (e, score) => {
129-
console.log('Score was loaded!', score);
130-
});
131-
```
132-
133111
</TabItem>
134112
</Tabs>
135113

docs/guides/coloring.mdx

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,6 @@ import { SinceBadge } from '@site/src/components/SinceBadge';
99

1010
<SinceBadge since="1.5.0" />
1111

12-
13-
import * as alphaTab from '@coderline/alphatab';
14-
import { getDescriptionText } from '@site/src/alphatabdoc';
15-
16-
export function EnumMemberList({ doc }) {
17-
return (
18-
<>
19-
<code>{doc.name}</code>
20-
<ul>
21-
{doc.members.map(n => (<li key={n.name}><code>{n.name}</code> - {getDescriptionText(n.tsdoc)}</li>))}
22-
</ul>
23-
</>
24-
)
25-
}
26-
2712
alphaTab supports individual styling of music notation elements via a special `style` container which is available on
2813
most levels of the [Data Model](../reference/score.mdx). This means you can customize the colors of individual notes being rendered
2914
base on custom logic.
@@ -57,47 +42,46 @@ alphaTab tries to give fine grained access to coloring music notation elements.
5742

5843
On Score level initialize the `score.style = new alphaTab.model.ScoreStyle()` and then select the element to color via `alphaTab.model.ScoreSubElement`.
5944

60-
import scoreSubElementDoc from '@site/src/alphatabdoc/model/ScoreSubElement';
45+
import ScoreSubElementDoc from '@site/docs/reference/types/model/scoresubelement/index.mdx';
6146

62-
<EnumMemberList doc={scoreSubElementDoc} />
47+
<ScoreSubElementDoc inlined={true} />
6348

6449
### Track level
6550

6651
On Track level initialize the `track.style = new alphaTab.model.TrackStyle()` and then select the element to color via `alphaTab.model.TrackSubElement`.
6752

68-
import trackSubElementDoc from '@site/src/alphatabdoc/model/TrackSubElement';
53+
import TrackSubElementDoc from '@site/docs/reference/types/model/tracksubelement/index.mdx';
6954

70-
<EnumMemberList doc={trackSubElementDoc} />
55+
<TrackSubElementDoc inlined={true} />
7156

7257
### Bar level
7358

7459
On Bar level initialize the `bar.style = new alphaTab.model.BarStyle()` and then select the element to color via `alphaTab.model.BarSubElement`.
7560

76-
import barSubElementDoc from '@site/src/alphatabdoc/model/BarSubElement';
77-
78-
<EnumMemberList doc={barSubElementDoc} />
61+
import BarSubElementDoc from '@site/docs/reference/types/model/barsubelement/index.mdx';
7962

63+
<BarSubElementDoc inlined={true} />
8064

8165
### Voice level
8266

8367
On Bar level initialize the `voice.style = new alphaTab.model.VoiceStyle()` and then select the element to color via `alphaTab.model.VoiceSubElement`.
8468

85-
import voiceSubElementDoc from '@site/src/alphatabdoc/model/VoiceSubElement';
69+
import VoiceSubElementDoc from '@site/docs/reference/types/model/voicesubelement/index.mdx';
8670

87-
<EnumMemberList doc={voiceSubElementDoc} />
71+
<VoiceSubElementDoc inlined={true} />
8872

8973
### Beat level
9074

9175
On Beat level initialize the `beat.style = new alphaTab.model.BeatStyle()` and then select the element to color via `alphaTab.model.BeatSubElement`.
9276

93-
import beatSubElementDoc from '@site/src/alphatabdoc/model/BeatSubElement';
77+
import BeatSubElementDoc from '@site/docs/reference/types/model/beatsubelement/index.mdx';
9478

95-
<EnumMemberList doc={beatSubElementDoc} />
79+
<BeatSubElementDoc inlined={true} />
9680

9781
### Note level
9882

9983
On Note level initialize the `note.style = new alphaTab.model.NoteStyle()` and then select the element to color via `alphaTab.model.NoteSubElement`.
10084

101-
import noteSubElementDoc from '@site/src/alphatabdoc/model/NoteSubElement';
85+
import NoteSubElementDoc from '@site/docs/reference/types/model/notesubelement/index.mdx';
10286

103-
<EnumMemberList doc={noteSubElementDoc} />
87+
<NoteSubElementDoc inlined={true} />

docs/guides/data-attributes.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Data Attributes
3+
---
4+
5+
TODO: Document deprecation of Data Attributes integration and move reference doc here.

docs/guides/dom-events.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Data Events
3+
---
4+
5+
TODO: DOM Events deprecation of Data Attributes integration and move reference doc here.

docs/guides/jquery.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: jQuery
3+
---
4+
5+
TODO: Document deprecation of jQuery integration and move reference doc here.

docs/guides/nodejs.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { SinceBadge } from '@site/src/components/SinceBadge';
66

77
<SinceBadge since="1.2.3" />
88

9+
export const SourceLinks = 'linkAlphaTabApi="/docs/reference/types/AlphaTabApi" linkScore="/docs/reference/types/model/Score"'
10+
911
The JavaScript version of alphaTab is primarily optimized for usage in Browsers. At least the top level `AlphaTabApi`
1012
which is a UI focused interface to alphaTab. But alphaTab can also be used in other
1113
JavaScript environments like Node.js or headless JavaScript engines. The core of alphaTab is platform independent
@@ -412,4 +414,4 @@ finalImageCanvas[Symbol.dispose]();
412414
await fs.promises.writeFile(outputFilePath, new Uint8Array(png));
413415
```
414416

415-
<img src="/img/guides/nodejs/png.png" />
417+
<img src="/img/guides/nodejs/png.png" />

docs/reference/alphasynth.mdx

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/reference/alphasynth/countinvolume.mdx

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/reference/alphasynth/destroy.mdx

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)