Skip to content

Commit

Permalink
Added toggles to external and internal markdown previews (#185)
Browse files Browse the repository at this point in the history
* Added toggles to external and internal markdown previews

* Lint

* Update packages/viewer/src/components/Shared/Source.svelte

---------

Co-authored-by: Steven Clontz <steven.clontz@gmail.com>
  • Loading branch information
Not-Abram and StevenClontz authored Nov 1, 2024
1 parent de042c8 commit 743812b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
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

0 comments on commit 743812b

Please sign in to comment.