Skip to content

Commit

Permalink
for being convinient to make toc (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Moon-DaeSeung authored May 1, 2023
1 parent ccb7123 commit e07f622
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
heading_1: { color, rich_text: texts, is_toggleable }
} = props;
let open = false;
// Give id to make it convenient to write TableOfContents
export let id = texts.map(({ plain_text }) => plain_text).join('');
</script>

<div
{id}
class:notion-toggle-open={open}
class={`${getColorCss(color)} notion-block notion-h1 notion-toggle`}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
heading_2: { color, rich_text: texts, is_toggleable }
} = props;
let open = false;
// Give id to make it convenient to write TableOfContents
export let id = texts.map(({ plain_text }) => plain_text).join('');
</script>

<div
{id}
class:notion-toggle-open={open}
class={`${getColorCss(color)} notion-block notion-h2 notion-toggle`}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
heading_3: { color, rich_text: texts, is_toggleable }
} = props;
let open = false
// Give id to make it convenient to write TableOfContents
export let id = texts.map(({plain_text}) => plain_text).join('')
</script>

<div
id={id}
class:notion-toggle-open={open}
class={`${getColorCss(color)} notion-block notion-h3 notion-toggle`}
>
Expand Down

0 comments on commit e07f622

Please sign in to comment.