-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
98 additions
and
5 deletions.
There are no files selected for viewing
94 changes: 94 additions & 0 deletions
94
packages/aptos-nextra-components/src/utils/mdast/examples/keyRotation.expect.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<a id="0x1_account_KeyRotation"></a> | ||
|
||
## Struct `KeyRotation` | ||
|
||
```move | ||
#[event] | ||
struct KeyRotation has drop, store | ||
``` | ||
|
||
<details> | ||
<summary>Fields</summary> | ||
|
||
<dl> | ||
<dt> | ||
<code><a href="account.md#0x1_account">account</a>: <b>address</b></code> | ||
</dt> | ||
<dd> | ||
|
||
</dd> | ||
<dt> | ||
<code>old_authentication_key: <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a><u8></code> | ||
</dt> | ||
<dd> | ||
|
||
</dd> | ||
<dt> | ||
<code>new_authentication_key: <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a><u8></code> | ||
</dt> | ||
<dd> | ||
|
||
</dd> | ||
</dl> | ||
|
||
</details> | ||
|
||
<a id="0x1_account_Account"></a> | ||
|
||
## Resource `Account` | ||
|
||
Resource representing an account. | ||
|
||
```move | ||
struct Account has store, key | ||
``` | ||
|
||
<details> | ||
<summary>Fields</summary> | ||
|
||
<dl> | ||
<dt> | ||
<code>authentication_key: <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a><u8></code> | ||
</dt> | ||
<dd> | ||
|
||
</dd> | ||
<dt> | ||
<code>sequence_number: u64</code> | ||
</dt> | ||
<dd> | ||
|
||
</dd> | ||
<dt> | ||
<code>guid_creation_num: u64</code> | ||
</dt> | ||
<dd> | ||
|
||
</dd> | ||
<dt> | ||
<code>coin_register_events: <a href="event.md#0x1_event_EventHandle">event::EventHandle</a><<a href="account.md#0x1_account_CoinRegisterEvent">account::CoinRegisterEvent</a>></code> | ||
</dt> | ||
<dd> | ||
|
||
</dd> | ||
<dt> | ||
<code>key_rotation_events: <a href="event.md#0x1_event_EventHandle">event::EventHandle</a><<a href="account.md#0x1_account_KeyRotationEvent">account::KeyRotationEvent</a>></code> | ||
</dt> | ||
<dd> | ||
|
||
</dd> | ||
<dt> | ||
<code>rotation_capability_offer: <a href="account.md#0x1_account_CapabilityOffer">account::CapabilityOffer</a><<a href="account.md#0x1_account_RotationCapability">account::RotationCapability</a>></code> | ||
</dt> | ||
<dd> | ||
|
||
</dd> | ||
<dt> | ||
<code>signer_capability_offer: <a href="account.md#0x1_account_CapabilityOffer">account::CapabilityOffer</a><<a href="account.md#0x1_account_SignerCapability">account::SignerCapability</a>></code> | ||
</dt> | ||
<dd> | ||
|
||
</dd> | ||
</dl> | ||
|
||
</details> |
File renamed without changes.
9 changes: 4 additions & 5 deletions
9
packages/aptos-nextra-components/src/utils/mdast/mdast.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import { expect, test } from 'vitest' | ||
import { astToMarkdown, convertHtmlToMarkdownCodeBlocks, readFileAsTree } from './mdast' | ||
|
||
test('mdast readFileAsTree from local markdown', () => { | ||
const tree = readFileAsTree(); | ||
console.log("Tree pre-treatment: ", tree); | ||
test('keyRotation parse and fix AST', () => { | ||
const tree = readFileAsTree("./examples/keyRotation.md"); | ||
convertHtmlToMarkdownCodeBlocks(tree); | ||
console.log("Tree post-codeblock treatment: ", tree); | ||
const markdown = astToMarkdown(tree); | ||
console.log(markdown) | ||
console.log(markdown); | ||
expect(markdown).toEqual(astToMarkdown(readFileAsTree('./examples/keyRotation.expect.md')).toString()) | ||
}) |