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

Added toggles to external and internal markdown previews #185

Merged
merged 3 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/viewer/src/components/Dev/Preview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<Typeset {body} {truncated} />
<hr />
<section class="description-markdown">
<Source source={body} />
<Source source={body} external />
</section>
</div>
</div>
2 changes: 1 addition & 1 deletion packages/viewer/src/components/Properties/Show.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</section>

<section class="description-markdown">
<Source source={property.description} />
<Source source={property.description} internal external />
</section>

<Tabs {tabs} {tab} {rel} />
Expand Down
16 changes: 12 additions & 4 deletions packages/viewer/src/components/Shared/Source.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import ExtMarkdown from './ExtMarkdown.svelte'
export let source: string
let showMarkdown = false
export let internal = false
export let external = false
</script>

<button
Expand All @@ -13,8 +15,14 @@
{#if showMarkdown}Hide{:else}Show{/if} markdown
</button>
{#if showMarkdown}
<h4>π-Base Markdown</h4>
<pre>{source}</pre>
<hr />
<ExtMarkdown {source} />
{#if internal}
<h4>π-Base Markdown</h4>
<pre>{source}</pre>
{#if external}
<hr />
{/if}
{/if}
{#if external}
<ExtMarkdown {source} />
{/if}
{/if}
2 changes: 1 addition & 1 deletion packages/viewer/src/components/Spaces/Show.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</section>

<section class="description-markdown">
<Source source={space.description} />
<Source source={space.description} internal external />
</section>

<Tabs {tabs} {tab} {rel} />
Expand Down
2 changes: 1 addition & 1 deletion packages/viewer/src/components/Theorems/Show.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</section>

<section class="description-markdown">
<Source source={theorem.description} />
<Source source={theorem.description} internal external />
</section>

<Tabs {tabs} {tab} {rel} />
Expand Down
2 changes: 1 addition & 1 deletion packages/viewer/src/components/Traits/Show.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<Typeset body={meta.description} />
</section>
<section class="description-markdown">
<Source source={meta.description} />
<Source source={meta.description} internal external />
</section>
<h3>References</h3>
<References references={meta.refs} />
Expand Down
Loading