Skip to content

Commit 7d1a8b5

Browse files
committed
Docs & README.md
1 parent 6b3c00f commit 7d1a8b5

15 files changed

Lines changed: 101 additions & 5 deletions

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ protoparser -vvv -output=myfile MeetingYesterday.pml html
218218
| `-theme=name` | Set export theme (used in HTML/PDF) |
219219
| `-config=PATH` | Use external config for rendering/export |
220220
| `--help` | Show CLI help |
221+
| `--listMacros <dir>` | List all macros in the specified path or builtin macros |
222+
| `--macroHelp <file_path>` | Show help for a specific macro file |
223+
| `--listDocs` | List all available documentation files |
224+
| `--docs <name>` | Show documentation for a specific command or topic |
221225

222226
### Local development
223227

macros/alert.pml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44
<script>alert("{{msg}}")</script>
55

66
=docs:
7-
Shows an alert box with the given message.
7+
This macro is used to display an alert message in the browser. It can be useful for notifying users of important information or errors.
8+
9+
Example usage:
10+
@@macro=alert:msg=This is an alert message!
11+
12+
The `msg` parameter should contain the text you want to display in the alert dialog.

macros/badge.pml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,11 @@
33
=template:
44
<span style="background:#{{bg || '333'}};color:#fff;border-radius:999px;padding:0.2em 0.7em;font-size:0.9em">
55
{{text}}
6-
</span>
6+
</span>
7+
=docs:
8+
This macro is used to create a badge with customizable background color and text. It can be useful for highlighting important information or categorizing content visually.
9+
10+
Example usage:
11+
@@macro=badge:bg=ff0000;text=Important
12+
13+
The `bg` parameter sets the background color of the badge (default is dark gray), and the `text` parameter specifies the text to display inside the badge.

macros/clicktoreveal.pml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@
33
=template:
44
<button onclick="document.getElementById('rvl').style.display='block'">Reveal contents</button>
55
<div id="rvl" style="display:none">{{content}}</div>
6+
=docs:
7+
This macro is used to create a button that reveals hidden content when clicked. It can be useful for displaying additional information or details without cluttering the page.
8+
9+
Example usage:
10+
@@macro=click_reveal:content=This is the hidden content that will be revealed when the button is clicked.
11+
12+
The `content` parameter should contain the text or HTML you want to display when the button is clicked. The content will initially be hidden and will only appear after the user clicks the "Reveal contents" button.

macros/codeblock_copy.pml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@
33
=template:
44
<pre><code>{{code}}</code></pre>
55
<button onclick="navigator.clipboard.writeText(`{{code}}`)">Copy</button>
6+
=docs:
7+
This macro is used to display a block of code with a "Copy" button that allows users to easily copy the code to their clipboard.
8+
9+
Example usage:
10+
@@macro=code_block:code=console.log('Hello, World!');
11+
12+
The `code` parameter should contain the code you want to display. The "Copy" button will copy the code to the clipboard when clicked.

macros/finance/f_end.pml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
=template:
44
</tbody>
55
</table>
6+
=docs:
7+
This macro is used to close a table that was opened with the `f_start` macro.
8+
It should be placed at the end of the table to ensure proper formatting and closure.
9+
10+
Example:
11+
@@macro=f_end:x=x

macros/finance/f_entry.pml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,10 @@
3131
}
3232
});
3333
</script>
34+
=docs:
35+
This macro is used to create a finance entry in a table format. It allows you to specify the title, amount, type (income or expense), category, payment method, and any notes related to the entry.
36+
37+
Example usage:
38+
@@macro=f_entry:title=Job;amount=1500;type=income;category=Job;method=Bank;notes=No provisions
39+
or
40+
@@macro=f_entry:title=Steam Sale;amount=67.49;type=expense;category=Gaming;method=PayPal;notes=

macros/finance/f_start.pml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@
1313
</tr>
1414
</thead>
1515
<tbody>
16+
17+
=docs:
18+
This macro is used to start a financial overview table. It sets up the table structure with headers for title, amount, category, method, and notes. You can use this macro at the beginning of your financial entries to create a well-formatted table.
19+
20+
Example usage:
21+
@@macro=f_start:x=x
22+
23+
After using this macro, you can add entries using the `f_entry` macro and close the table with the `f_end` macro.

macros/finance/f_totals.pml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,12 @@
2222
`;
2323
}
2424
</script>
25+
=docs:
26+
This macro is used to display the total income, expenses, and balance in a financial overview table. It calculates the totals based on the entries made with the `f_entry` macro and displays them in a summary row at the end of the table.
27+
28+
Example usage:
29+
@@macro=f_totals:x=x
30+
31+
The totals will be dynamically calculated and displayed in the table, providing a quick overview of your financial status.
32+
Use this macro before the `f_end` macro to ensure it appears in the correct place in the table.
33+
It is typically placed after all entries have been added using the `f_entry` macro.

macros/quote.pml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,11 @@
44
<blockquote style="border-left:4px solid #999;padding-left:1em;color:#555">
55
<em>{{text}}</em>
66
<br><small>– {{author}}</small>
7-
</blockquote>
7+
</blockquote>
8+
=docs:
9+
This macro is used to create a styled blockquote for quotes. It allows you to display a quote with the author's name in a visually appealing format.
10+
11+
Example usage:
12+
@@macro=quote:text=The only limit to our realization of tomorrow is our doubts of today.;author=Franklin D. Roosevelt
13+
14+
The `text` parameter contains the quote itself, and the `author` parameter specifies the name of the person who said the quote.

0 commit comments

Comments
 (0)