Skip to content

Commit

Permalink
Merge pull request #266 from gagahpangeran/markdown-toc
Browse files Browse the repository at this point in the history
Add support for generated table of content in markdown
  • Loading branch information
gagahpangeran authored May 30, 2024
2 parents 032d0c7 + 1ee74a1 commit 59cdd26
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
6 changes: 6 additions & 0 deletions content/blog/l3akctf-2024-writeup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ in the [closing section](#closing-and-some-story).
Overall, I like the challenges, especially bbsqli. Because I could solve it
using only my phone and also I learn something new about SQL Quine.

Here is the table of content of this writeup.

```toc
exclude: Closing And Some Story
```

## Misc

I only solve bonus challenge in misc. So nothing interesting here.
Expand Down
9 changes: 9 additions & 0 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ export const plugins: GatsbyConfig["plugins"] = [
strict: `ignore`
}
},
{
resolve: `gatsby-remark-table-of-contents`,
options: {
fromHeading: 2,
toHeading: 3,
className: "markdown__toc",
tight: true
}
},
`gatsby-remark-prismjs`,
`gatsby-remark-copy-linked-files`,
`gatsby-remark-smartypants`,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"gatsby-remark-prismjs": "^7.13.1",
"gatsby-remark-responsive-iframe": "^6.13.1",
"gatsby-remark-smartypants": "^6.13.1",
"gatsby-remark-table-of-contents": "^2.0.0",
"gatsby-source-filesystem": "^5.13.1",
"gatsby-transformer-remark": "^6.13.1",
"gatsby-transformer-sharp": "^5.13.1",
Expand Down
10 changes: 9 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7265,6 +7265,14 @@ gatsby-remark-smartypants@^6.13.1:
retext-smartypants "^4.0.0"
unist-util-visit "^2.0.3"

gatsby-remark-table-of-contents@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/gatsby-remark-table-of-contents/-/gatsby-remark-table-of-contents-2.0.0.tgz#9df384c5915a6b038deedcf831a1997fbb830974"
integrity sha512-Hl/zfvwX0FWMjaurzOTLpHNQ4rOd4AXnNrRsqJLwZPecZBc42UDX/JFL4hYS/NfrPd/svtwipkBXGo51CaKFXw==
dependencies:
js-yaml "^3.14.1"
mdast-util-toc "^5.1.0"

gatsby-script@^2.13.0:
version "2.13.0"
resolved "https://registry.yarnpkg.com/gatsby-script/-/gatsby-script-2.13.0.tgz#0fa7316739ebc31da217091e54db8ef86f41dbb3"
Expand Down Expand Up @@ -9350,7 +9358,7 @@ joi@^17.9.2:
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

js-yaml@^3.13.1:
js-yaml@^3.13.1, js-yaml@^3.14.1:
version "3.14.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
Expand Down

0 comments on commit 59cdd26

Please sign in to comment.